-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #14916: Use umask defined in /etc/login.defs in Technique "SSH authorized keys" for creating missing home dir #1445
Conversation
# read the /etc/login.defs to get umask for home creation if home dir is not there | ||
"nb_line_read" int => readstringarray("login_defs_content", "/etc/login.defs","#[^\n]*", "\s+", "99999", "9999999"); | ||
# Use the umask to get the value | ||
"homedir_mode_real" string => eval("777-${login_defs_content[UMASK][1]}}", "math", "infix"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo }} instead of }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch
"homedir_mode_real" string => eval("777-${login_defs_content[UMASK][1]}}", "math", "infix"); | ||
# Format to int | ||
"homedir_mode_int" string => format("%0.0f", ${homedir_mode_real}); | ||
"homedir_mode_to_use" string => "${homedir_mode_int}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not doing this in one line?
"homedir_mode_to_use" string => format("%0.0f", ${homedir_mode_real});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because homedir_mode_real may not exist, in this case, the format is not evaluated, and i use the default home_dir_to_use (line 65)
i'm not sure that doing it in one step may not cancel the actual value
… authorized keys\" for creating missing home dir
4877ac7
to
9639c15
Compare
Commit modified |
OK, merging this PR |
https://issues.rudder.io/issues/14916