Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Please login to access the resource
home:AlecJY:crostini
shadow
shadow-bsc1230972-useradd-warning.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File shadow-bsc1230972-useradd-warning.patch of Package shadow
Patch for bsc#1230972 Derived from upstream 1d8487d85105a8373408ce8d1470c5ed14fa6356 The upstream change modifies check_uid_range() in useradd.c to print errors related to out-of-range UIDs to stderr instead of stdout. This patch backports check_uid_range(), including this change, to shadow version 4.8.1, and adds a call to check_uid_range() in main(). --- src/useradd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/src/useradd.c +++ b/src/useradd.c @@ -232,6 +232,7 @@ static void tallylog_reset (const char * static void usr_update (void); static void create_home (void); static void create_mail (void); +static void check_uid_range(int rflg, uid_t user_id); /* * fail_exit - undo as much as possible @@ -2314,6 +2315,25 @@ static void call_script (const char *use free(struid); } +static void check_uid_range(int rflg, uid_t user_id) +{ + uid_t uid_min ; + uid_t uid_max ; + if (rflg) { + uid_max = getdef_ulong("SYS_UID_MAX",getdef_ulong("UID_MIN",1000UL)-1); + if (user_id > uid_max) { + fprintf(stderr, _("%s warning: %s's uid %d is greater than SYS_UID_MAX %d\n"), Prog, user_name, user_id, uid_max); + } + }else{ + uid_min = getdef_ulong("UID_MIN", 1000UL); + uid_max = getdef_ulong("UID_MAX", 6000UL); + if (uid_min <= uid_max) { + if (user_id < uid_min || user_id >uid_max) + fprintf(stderr, _("%s warning: %s's uid %d outside of the UID_MIN %d and UID_MAX %d range.\n"), Prog, user_name, user_id, uid_min, uid_max); + } + } + +} /* * main - useradd command @@ -2497,6 +2517,8 @@ int main (int argc, char **argv) } } + if (uflg) + check_uid_range(rflg,user_id); #ifdef WITH_TCB if (getdef_bool ("USE_TCB")) { if (shadowtcb_create (user_name, user_id) == SHADOWTCB_FAILURE) {
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor