useradd: respect -r flag when allocating subuids
We intend to not create subuids for system users. However we are checking for command line flags after we check whether -r flag was set, so it was never found to be true. Fix that. Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
parent
9ab9e6f331
commit
af064545bf
@ -2026,6 +2026,9 @@ int main (int argc, char **argv)
|
|||||||
#ifdef SHADOWGRP
|
#ifdef SHADOWGRP
|
||||||
is_shadow_grp = sgr_file_present ();
|
is_shadow_grp = sgr_file_present ();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
process_flags (argc, argv);
|
||||||
|
|
||||||
#ifdef ENABLE_SUBIDS
|
#ifdef ENABLE_SUBIDS
|
||||||
is_sub_uid = sub_uid_file_present () && !rflg &&
|
is_sub_uid = sub_uid_file_present () && !rflg &&
|
||||||
(!user_id || (user_id <= uid_max && user_id >= uid_min));
|
(!user_id || (user_id <= uid_max && user_id >= uid_min));
|
||||||
@ -2035,8 +2038,6 @@ int main (int argc, char **argv)
|
|||||||
|
|
||||||
get_defaults ();
|
get_defaults ();
|
||||||
|
|
||||||
process_flags (argc, argv);
|
|
||||||
|
|
||||||
#ifdef ACCT_TOOLS_SETUID
|
#ifdef ACCT_TOOLS_SETUID
|
||||||
#ifdef USE_PAM
|
#ifdef USE_PAM
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user