aboutsummaryrefslogtreecommitdiff
path: root/debianutils
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2015-10-19 04:37:19 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2015-10-19 04:37:19 +0200
commit3d0805e9e7c45e6c0f9fb5e587d8b4a5a5f3c74c (patch)
treed950f4ca13fcd5993a34daf36b61f719e226497a /debianutils
parent526d85831e7480b9c7a3673d8dd356a438e6dd74 (diff)
downloadbusybox-w32-3d0805e9e7c45e6c0f9fb5e587d8b4a5a5f3c74c.tar.gz
busybox-w32-3d0805e9e7c45e6c0f9fb5e587d8b4a5a5f3c74c.tar.bz2
busybox-w32-3d0805e9e7c45e6c0f9fb5e587d8b4a5a5f3c74c.zip
libbb: make parse_chown_usergroup_or_die() set unspecified uid/gid to -1
function old new delta parse_chown_usergroup_or_die 102 115 +13 chown_main 190 175 -15 start_stop_daemon_main 1043 1027 -16 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/2 up/down: 13/-31) Total: -18 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'debianutils')
-rw-r--r--debianutils/start_stop_daemon.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/debianutils/start_stop_daemon.c b/debianutils/start_stop_daemon.c
index 42f1943dd..d7c730f45 100644
--- a/debianutils/start_stop_daemon.c
+++ b/debianutils/start_stop_daemon.c
@@ -539,15 +539,15 @@ int start_stop_daemon_main(int argc UNUSED_PARAM, char **argv)
539 write_pidfile(pidfile); 539 write_pidfile(pidfile);
540 } 540 }
541 if (opt & OPT_c) { 541 if (opt & OPT_c) {
542 struct bb_uidgid_t ugid = { -1, -1 }; 542 struct bb_uidgid_t ugid;
543 parse_chown_usergroup_or_die(&ugid, chuid); 543 parse_chown_usergroup_or_die(&ugid, chuid);
544 if (ugid.uid != (uid_t) -1) { 544 if (ugid.uid != (uid_t) -1L) {
545 struct passwd *pw = xgetpwuid(ugid.uid); 545 struct passwd *pw = xgetpwuid(ugid.uid);
546 if (ugid.gid != (gid_t) -1) 546 if (ugid.gid != (gid_t) -1L)
547 pw->pw_gid = ugid.gid; 547 pw->pw_gid = ugid.gid;
548 /* initgroups, setgid, setuid: */ 548 /* initgroups, setgid, setuid: */
549 change_identity(pw); 549 change_identity(pw);
550 } else if (ugid.gid != (gid_t) -1) { 550 } else if (ugid.gid != (gid_t) -1L) {
551 xsetgid(ugid.gid); 551 xsetgid(ugid.gid);
552 setgroups(1, &ugid.gid); 552 setgroups(1, &ugid.gid);
553 } 553 }