diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-26 16:18:36 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-26 16:18:36 +0000 |
commit | 6c3ea4f47ea280811a7fe53a22f7832e4533c9ec (patch) | |
tree | 3d7ed5da23b5dbf6f9e450dfb61642832249c31e /src/id.c | |
parent | Adding upstream version 1:4.13+dfsg1. (diff) | |
download | shadow-upstream/1%4.15.2.tar.xz shadow-upstream/1%4.15.2.zip |
Adding upstream version 1:4.15.2.upstream/1%4.15.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/id.c')
-rw-r--r-- | src/id.c | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -23,7 +23,10 @@ #include <pwd.h> #include <stdio.h> #include <sys/types.h> + +#include "alloc.h" #include "defines.h" + /* local function prototypes */ static void usage (void); @@ -33,7 +36,8 @@ static void usage (void) exit (EXIT_FAILURE); } - /*ARGSUSED*/ int main (int argc, char **argv) +int +main(int argc, char *argv[]) { uid_t ruid, euid; gid_t rgid, egid; @@ -63,7 +67,7 @@ static void usage (void) * work if the system library is recompiled. */ sys_ngroups = sysconf (_SC_NGROUPS_MAX); - groups = (GETGROUPS_T *) malloc (sizeof (GETGROUPS_T) * sys_ngroups); + groups = MALLOC(sys_ngroups, GETGROUPS_T); /* * See if the -a flag has been given to print out the concurrent @@ -71,11 +75,10 @@ static void usage (void) */ if (argc > 1) { - if ((argc > 2) || (strcmp (argv[1], "-a") != 0)) { - usage (); - } else { + if (argc > 2 || strcmp(argv[1], "-a") != 0) + usage(); + else aflg = true; - } } ruid = getuid (); |