From: Guillem Jover Date: Mon, 21 Jan 2008 05:02:04 +0000 (+0200) Subject: s-s-d: Fix signed vs unsigned warning when comparing to getuid and getgid X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca4146598ea3bb8f079786b6c97856fdb1862b62;p=dpkg s-s-d: Fix signed vs unsigned warning when comparing to getuid and getgid --- diff --git a/ChangeLog b/ChangeLog index dfa4d13e..7fa3d489 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-01-21 Guillem Jover + + * utils/start-stop-daemon.c (main): Cast runas_uid and runas_gid to + uid_t and gid_t when comparing to getuid() and getgid(). + 2008-01-21 Guillem Jover * configure.ac (AC_CHECK_FUNCS): Merge arguments from both macro diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c index cf34c6d5..ed21c3c2 100644 --- a/utils/start-stop-daemon.c +++ b/utils/start-stop-daemon.c @@ -1413,11 +1413,12 @@ main(int argc, char **argv) if (chdir(changedir) < 0) fatal("Unable to chdir() to %s", changedir); - if (changeuser != NULL && getuid() != runas_uid) { + if (changeuser != NULL && getuid() != (uid_t)runas_uid) { if (setuid(runas_uid)) fatal("Unable to set uid to %s", changeuser); } - if (changegroup != NULL && *changegroup != '\0' && getgid() != runas_gid) { + if (changegroup != NULL && *changegroup != '\0' && + getgid() != (gid_t)runas_gid) { if (!gid_in_current_groups(runas_gid)) if (initgroups(changeuser, runas_gid)) fatal("Unable to set initgroups() with gid %d",