ocket8888 commented on code in PR #6880:
URL: https://github.com/apache/trafficcontrol/pull/6880#discussion_r888453853


##########
cache-config/t3c-diff/t3c-diff.go:
##########
@@ -49,6 +49,8 @@ func main() {
        version := getopt.BoolLong("version", 'V', "Print version information 
and exit")
        lineComment := getopt.StringLong("line_comment", 'l', "#", "Comment 
symbol")
        mode := getopt.IntLong("file-mode", 'm', 0644, "file mode default is 
644")
+       uid := getopt.IntLong("file-uid", 'u', 0, "file uid default is 0")
+       gid := getopt.IntLong("file-gid", 'g', 0, "file gid default is 0")

Review Comment:
   The help text that is the final argument to `getopt.IntLong` should be
   
   > ... the usage message for the option
   
   The default values for options are already automatically printed in the help 
text output, so the help text needn't include them at all.
   
   Speaking of the default values, though, is `0` really the best default for 
this? That seems prone to permissions errors when `t3c` isn't running as the 
root user. Plus, when I run a command-line utility, I don't typically expect it 
to create anything owned by any user or group besides the user and group that 
the process running it uses. Maybe the default should be the running process's 
uid/gid?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to