From 25b1a8d5913db7744cb1ec67691e8981f23eca51 Mon Sep 17 00:00:00 2001 From: Serge Hallyn Date: Fri, 17 Apr 2020 16:31:56 -0500 Subject: [PATCH] remove unused and misleading 'owner' argument from find_new_sub* Signed-off-by: Serge Hallyn --- lib/prototypes.h | 6 ++---- libmisc/find_new_sub_gids.c | 3 +-- libmisc/find_new_sub_uids.c | 3 +-- src/newusers.c | 4 ++-- src/useradd.c | 4 ++-- 5 files changed, 8 insertions(+), 12 deletions(-) diff --git a/lib/prototypes.h b/lib/prototypes.h index 22603b98..90651fb9 100644 --- a/lib/prototypes.h +++ b/lib/prototypes.h @@ -161,12 +161,10 @@ extern int find_new_uid (bool sys_user, #ifdef ENABLE_SUBIDS /* find_new_sub_gids.c */ -extern int find_new_sub_gids (const char *owner, - gid_t *range_start, unsigned long *range_count); +extern int find_new_sub_gids (gid_t *range_start, unsigned long *range_count); /* find_new_sub_uids.c */ -extern int find_new_sub_uids (const char *owner, - uid_t *range_start, unsigned long *range_count); +extern int find_new_sub_uids (uid_t *range_start, unsigned long *range_count); #endif /* ENABLE_SUBIDS */ diff --git a/libmisc/find_new_sub_gids.c b/libmisc/find_new_sub_gids.c index ae8a937c..4d25abad 100644 --- a/libmisc/find_new_sub_gids.c +++ b/libmisc/find_new_sub_gids.c @@ -46,8 +46,7 @@ * * Return 0 on success, -1 if no unused GIDs are available. */ -int find_new_sub_gids (const char *owner, - gid_t *range_start, unsigned long *range_count) +int find_new_sub_gids (gid_t *range_start, unsigned long *range_count) { unsigned long min, max; unsigned long count; diff --git a/libmisc/find_new_sub_uids.c b/libmisc/find_new_sub_uids.c index 12cb2d2e..7113887e 100644 --- a/libmisc/find_new_sub_uids.c +++ b/libmisc/find_new_sub_uids.c @@ -46,8 +46,7 @@ * * Return 0 on success, -1 if no unused UIDs are available. */ -int find_new_sub_uids (const char *owner, - uid_t *range_start, unsigned long *range_count) +int find_new_sub_uids (uid_t *range_start, unsigned long *range_count) { unsigned long min, max; unsigned long count; diff --git a/src/newusers.c b/src/newusers.c index e9fe0e27..3104d6fd 100644 --- a/src/newusers.c +++ b/src/newusers.c @@ -1251,7 +1251,7 @@ int main (int argc, char **argv) if (is_sub_uid && !sub_uid_assigned(fields[0])) { uid_t sub_uid_start = 0; unsigned long sub_uid_count = 0; - if (find_new_sub_uids(fields[0], &sub_uid_start, &sub_uid_count) == 0) { + if (find_new_sub_uids(&sub_uid_start, &sub_uid_count) == 0) { if (sub_uid_add(fields[0], sub_uid_start, sub_uid_count) == 0) { fprintf (stderr, _("%s: failed to prepare new %s entry\n"), @@ -1271,7 +1271,7 @@ int main (int argc, char **argv) if (is_sub_gid && !sub_gid_assigned(fields[0])) { gid_t sub_gid_start = 0; unsigned long sub_gid_count = 0; - if (find_new_sub_gids(fields[0], &sub_gid_start, &sub_gid_count) == 0) { + if (find_new_sub_gids(&sub_gid_start, &sub_gid_count) == 0) { if (sub_gid_add(fields[0], sub_gid_start, sub_gid_count) == 0) { fprintf (stderr, _("%s: failed to prepare new %s entry\n"), diff --git a/src/useradd.c b/src/useradd.c index 645d4a40..8d8b4cf5 100644 --- a/src/useradd.c +++ b/src/useradd.c @@ -2465,7 +2465,7 @@ int main (int argc, char **argv) #ifdef ENABLE_SUBIDS if (is_sub_uid) { - if (find_new_sub_uids(user_name, &sub_uid_start, &sub_uid_count) < 0) { + if (find_new_sub_uids(&sub_uid_start, &sub_uid_count) < 0) { fprintf (stderr, _("%s: can't create subordinate user IDs\n"), Prog); @@ -2473,7 +2473,7 @@ int main (int argc, char **argv) } } if (is_sub_gid) { - if (find_new_sub_gids(user_name, &sub_gid_start, &sub_gid_count) < 0) { + if (find_new_sub_gids(&sub_gid_start, &sub_gid_count) < 0) { fprintf (stderr, _("%s: can't create subordinate group IDs\n"), Prog);