From 3d0805e9e7c45e6c0f9fb5e587d8b4a5a5f3c74c Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 19 Oct 2015 04:37:19 +0200 Subject: 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 --- debianutils/start_stop_daemon.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'debianutils') 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) write_pidfile(pidfile); } if (opt & OPT_c) { - struct bb_uidgid_t ugid = { -1, -1 }; + struct bb_uidgid_t ugid; parse_chown_usergroup_or_die(&ugid, chuid); - if (ugid.uid != (uid_t) -1) { + if (ugid.uid != (uid_t) -1L) { struct passwd *pw = xgetpwuid(ugid.uid); - if (ugid.gid != (gid_t) -1) + if (ugid.gid != (gid_t) -1L) pw->pw_gid = ugid.gid; /* initgroups, setgid, setuid: */ change_identity(pw); - } else if (ugid.gid != (gid_t) -1) { + } else if (ugid.gid != (gid_t) -1L) { xsetgid(ugid.gid); setgroups(1, &ugid.gid); } -- cgit v1.2.3