From: Simon Ruderich Date: Tue, 29 Nov 2016 14:29:59 +0000 (+0100) Subject: Rename die_msg() to die_fmt() X-Git-Tag: 0.1~20 X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=328d6d4cd65cd724297052818f3138a005e9a65e;p=ptyas%2Fptyas.git Rename die_msg() to die_fmt() --- diff --git a/ptyas.c b/ptyas.c index f96962e..05170ec 100644 --- a/ptyas.c +++ b/ptyas.c @@ -44,7 +44,7 @@ static void die(const char *s) { perror(s); exit(EXIT_FAILURE); } -static void die_msg(const char *fmt, ...) { +static void die_fmt(const char *fmt, ...) { va_list ap; va_start(ap, fmt); @@ -114,7 +114,7 @@ static void drop_privileges_or_die(uid_t uid, gid_t gid) { die("setgroups"); } if (getgroups(0, NULL) != 0) { - die_msg("failed to drop all groups"); + die_fmt("failed to drop all groups"); } /* Dropping groups may require privileges, do that first. */ @@ -138,12 +138,12 @@ static void drop_privileges_or_die(uid_t uid, gid_t gid) { } if ( uid != ruid || uid != euid || uid != suid || gid != rgid || gid != egid || gid != sgid) { - die_msg("failed to drop privileges"); + die_fmt("failed to drop privileges"); } } /* Just to be safe. */ if (setuid(0) != -1) { - die_msg("failed to drop privileges (setuid)"); + die_fmt("failed to drop privileges (setuid)"); } } @@ -282,14 +282,14 @@ int main(int argc, char **argv) { } else if (argc > 2) { exec_argv = argv + 2; } else { - die_msg("%s [...]\n", argv[0]); + die_fmt("%s [...]\n", argv[0]); } const char *user = argv[1]; struct passwd *passwd = getpwnam(user); if (!passwd) { - die_msg("unknown user name '%s'\n", user); + die_fmt("unknown user name '%s'\n", user); } uid_t uid = passwd->pw_uid;