2007-10-07 11:44:02 +00:00
|
|
|
/*
|
2021-12-05 09:35:27 -06:00
|
|
|
* SPDX-FileCopyrightText: 1991 - 1994, Julianne Frances Haugh
|
|
|
|
* SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
|
|
|
|
* SPDX-FileCopyrightText: 2001 - 2006, Tomasz Kłoczko
|
|
|
|
* SPDX-FileCopyrightText: 2007 - 2008, Nicolas François
|
2007-10-07 11:44:02 +00:00
|
|
|
*
|
2021-12-05 09:35:27 -06:00
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
2007-10-07 11:44:02 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* id - print current process user identification information
|
|
|
|
*
|
2007-10-07 11:44:59 +00:00
|
|
|
* Print the current process identifiers. This includes the
|
|
|
|
* UID, GID, effective-UID and effective-GID. Optionally print
|
2007-10-07 11:44:02 +00:00
|
|
|
* the concurrent group set if the current system supports it.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
2007-11-10 23:46:11 +00:00
|
|
|
#ident "$Id$"
|
2007-10-07 11:47:01 +00:00
|
|
|
|
2007-10-07 11:44:02 +00:00
|
|
|
#include <grp.h>
|
|
|
|
#include <pwd.h>
|
2007-10-07 11:47:01 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <sys/types.h>
|
2023-02-04 22:41:18 +01:00
|
|
|
|
|
|
|
#include "alloc.h"
|
2007-10-07 11:44:02 +00:00
|
|
|
#include "defines.h"
|
2023-02-04 22:41:18 +01:00
|
|
|
|
2007-10-07 11:44:02 +00:00
|
|
|
/* local function prototypes */
|
2007-10-07 11:44:59 +00:00
|
|
|
static void usage (void);
|
2007-10-07 11:44:02 +00:00
|
|
|
|
2007-10-07 11:44:59 +00:00
|
|
|
static void usage (void)
|
2007-10-07 11:44:02 +00:00
|
|
|
{
|
2008-06-10 19:45:06 +00:00
|
|
|
(void) fputs (_("Usage: id [-a]\n"), stderr);
|
* lib/exitcodes.h: Define E_SUCCESS as EXIT_SUCCESS. Added FIXMEs.
* libmisc/chowntty.c, libmisc/rlogin.c, libmisc/sub.c,
src/newusers.c, libmisc/sulog.c, libmisc/system.c, src/logoutd.c,
src/groups.c, src/id.c, lib/encrypt.c, libmisc/audit_help.c,
libmisc/limits.c: Return EXIT_FAILURE instead of 1, and
EXIT_SUCCESS instead of 0.
* libmisc/audit_help.c: Replace an fprintf() by fputs().
* libmisc/audit_help.c: Remove documentation of the audit_logger
returned values. The function returns void.
* libmisc/system.c: Only return status if waitpid succeeded.
Return -1 otherwise.
2009-04-30 21:08:49 +00:00
|
|
|
exit (EXIT_FAILURE);
|
2007-10-07 11:44:02 +00:00
|
|
|
}
|
|
|
|
|
2007-10-07 11:44:59 +00:00
|
|
|
/*ARGSUSED*/ int main (int argc, char **argv)
|
2007-10-07 11:44:02 +00:00
|
|
|
{
|
|
|
|
uid_t ruid, euid;
|
|
|
|
gid_t rgid, egid;
|
2007-10-07 11:44:51 +00:00
|
|
|
long sys_ngroups;
|
2007-10-07 11:44:59 +00:00
|
|
|
|
2007-10-07 11:44:02 +00:00
|
|
|
/*
|
|
|
|
* This block of declarations is particularly strained because of several
|
2007-10-07 11:44:59 +00:00
|
|
|
* different ways of doing concurrent groups. Old BSD systems used int for
|
|
|
|
* gid's, but short for the type passed to getgroups(). Newer systems use
|
|
|
|
* gid_t for everything. Some systems have a small and fixed NGROUPS,
|
|
|
|
* usually about 16 or 32. Others use bigger values.
|
2007-10-07 11:44:02 +00:00
|
|
|
*/
|
2007-10-07 11:44:51 +00:00
|
|
|
GETGROUPS_T *groups;
|
2007-10-07 11:44:59 +00:00
|
|
|
int ngroups;
|
2008-06-10 19:45:06 +00:00
|
|
|
bool aflg = 0;
|
2007-10-07 11:44:59 +00:00
|
|
|
struct passwd *pw;
|
|
|
|
struct group *gr;
|
2007-10-07 11:44:02 +00:00
|
|
|
|
2008-06-10 19:45:06 +00:00
|
|
|
(void) setlocale (LC_ALL, "");
|
|
|
|
(void) bindtextdomain (PACKAGE, LOCALEDIR);
|
|
|
|
(void) textdomain (PACKAGE);
|
2007-10-07 11:44:02 +00:00
|
|
|
|
2007-10-07 11:44:51 +00:00
|
|
|
/*
|
|
|
|
* Dynamically get the maximum number of groups from system, instead
|
|
|
|
* of using the symbolic constant NGROUPS_MAX. This ensures that the
|
|
|
|
* group limit is not hard coded into the binary, so it will still
|
|
|
|
* work if the system library is recompiled.
|
|
|
|
*/
|
2007-10-07 11:44:59 +00:00
|
|
|
sys_ngroups = sysconf (_SC_NGROUPS_MAX);
|
2023-02-04 22:41:18 +01:00
|
|
|
groups = MALLOCARRAY (sys_ngroups, GETGROUPS_T);
|
2021-12-27 20:50:06 +01:00
|
|
|
|
2007-10-07 11:44:02 +00:00
|
|
|
/*
|
2007-10-07 11:44:59 +00:00
|
|
|
* See if the -a flag has been given to print out the concurrent
|
|
|
|
* group set.
|
2007-10-07 11:44:02 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
if (argc > 1) {
|
2008-06-10 19:45:06 +00:00
|
|
|
if ((argc > 2) || (strcmp (argv[1], "-a") != 0)) {
|
2007-10-07 11:44:59 +00:00
|
|
|
usage ();
|
2008-06-10 19:45:06 +00:00
|
|
|
} else {
|
|
|
|
aflg = true;
|
|
|
|
}
|
2007-10-07 11:44:02 +00:00
|
|
|
}
|
|
|
|
|
2007-10-07 11:44:59 +00:00
|
|
|
ruid = getuid ();
|
|
|
|
euid = geteuid ();
|
|
|
|
rgid = getgid ();
|
|
|
|
egid = getegid ();
|
2007-10-07 11:44:02 +00:00
|
|
|
|
|
|
|
/*
|
2007-10-07 11:44:59 +00:00
|
|
|
* Print out the real user ID and group ID. If the user or group
|
|
|
|
* does not exist, just give the numerical value.
|
2007-10-07 11:44:02 +00:00
|
|
|
*/
|
|
|
|
|
* lib/prototypes.h, configure.in, libmisc/Makefile.am,
libmisc/xgetXXbyYY.c, libmisc/xgetpwnam.c, libmisc/xgetpwuid.c,
libmisc/xgetgrnam.c, libmisc/xgetgrgid.c, libmisc/xgetspnam.c:
Added functions xgetpwnam(), xgetpwuid(), xgetgrnam(),
xgetgrgid(), and xgetspnam(). They allocate memory for the
returned structure and are more robust to successive calls. They
are implemented with the libc's getxxyyy_r() functions if
available.
* libmisc/limits.c, libmisc/entry.c, libmisc/chowntty.c,
libmisc/addgrps.c, libmisc/myname.c, libmisc/rlogin.c,
libmisc/pwdcheck.c, src/newgrp.c, src/login_nopam.c,
src/userdel.c, src/lastlog.c, src/grpck.c, src/gpasswd.c,
src/newusers.c, src/chpasswd.c, src/chfn.c, src/groupmems.c,
src/usermod.c, src/expiry.c, src/groupdel.c, src/chgpasswd.c,
src/su.c, src/useradd.c, src/groupmod.c, src/passwd.c, src/pwck.c,
src/groupadd.c, src/chage.c, src/login.c, src/suauth.c,
src/faillog.c, src/groups.c, src/chsh.c, src/id.c: Review all the
usage of one of the getpwnam(), getpwuid(), getgrnam(),
getgrgid(), and getspnam() functions. It was noticed on
http://bugs.debian.org/341230 that chfn and chsh use a passwd
structure after calling a pam function, which result in using
information from the passwd structure requested by pam, not the
original one. It is much easier to use the new xget... functions
to avoid these issues. I've checked which call to the original
get... functions could be left (reducing the scope of the
structure if possible), and I've left comments to ease future
reviews (e.g. /* local, no need for xgetpwnam */).
Note: the getpwent/getgrent calls should probably be checked also.
* src/groupdel.c, src/expiry.c: Fix typos in comments.
* src/groupmod.c: Re-indent.
* libmisc/Makefile.am, lib/groupmem.c, lib/groupio.c, lib/pwmem.c,
lib/pwio.c, lib/shadowmem.c, lib/shadowio.c: Move the __<xx>_dup
functions (used by the xget... functions) from the <xx>io.c files
to the new <xx>mem.c files. This avoid linking some utils against
the SELinux library.
2007-11-18 23:15:26 +00:00
|
|
|
pw = getpwuid (ruid); /* local, no need for xgetpwuid */
|
2008-06-10 19:45:06 +00:00
|
|
|
if (NULL != pw) {
|
2008-06-13 21:31:23 +00:00
|
|
|
(void) printf ("UID=%lu(%s)",
|
|
|
|
(unsigned long) ruid, pw->pw_name);
|
2008-06-10 19:45:06 +00:00
|
|
|
} else {
|
2008-06-13 21:31:23 +00:00
|
|
|
(void) printf ("UID=%lu", (unsigned long) ruid);
|
2008-06-10 19:45:06 +00:00
|
|
|
}
|
2007-10-07 11:44:02 +00:00
|
|
|
|
* lib/prototypes.h, configure.in, libmisc/Makefile.am,
libmisc/xgetXXbyYY.c, libmisc/xgetpwnam.c, libmisc/xgetpwuid.c,
libmisc/xgetgrnam.c, libmisc/xgetgrgid.c, libmisc/xgetspnam.c:
Added functions xgetpwnam(), xgetpwuid(), xgetgrnam(),
xgetgrgid(), and xgetspnam(). They allocate memory for the
returned structure and are more robust to successive calls. They
are implemented with the libc's getxxyyy_r() functions if
available.
* libmisc/limits.c, libmisc/entry.c, libmisc/chowntty.c,
libmisc/addgrps.c, libmisc/myname.c, libmisc/rlogin.c,
libmisc/pwdcheck.c, src/newgrp.c, src/login_nopam.c,
src/userdel.c, src/lastlog.c, src/grpck.c, src/gpasswd.c,
src/newusers.c, src/chpasswd.c, src/chfn.c, src/groupmems.c,
src/usermod.c, src/expiry.c, src/groupdel.c, src/chgpasswd.c,
src/su.c, src/useradd.c, src/groupmod.c, src/passwd.c, src/pwck.c,
src/groupadd.c, src/chage.c, src/login.c, src/suauth.c,
src/faillog.c, src/groups.c, src/chsh.c, src/id.c: Review all the
usage of one of the getpwnam(), getpwuid(), getgrnam(),
getgrgid(), and getspnam() functions. It was noticed on
http://bugs.debian.org/341230 that chfn and chsh use a passwd
structure after calling a pam function, which result in using
information from the passwd structure requested by pam, not the
original one. It is much easier to use the new xget... functions
to avoid these issues. I've checked which call to the original
get... functions could be left (reducing the scope of the
structure if possible), and I've left comments to ease future
reviews (e.g. /* local, no need for xgetpwnam */).
Note: the getpwent/getgrent calls should probably be checked also.
* src/groupdel.c, src/expiry.c: Fix typos in comments.
* src/groupmod.c: Re-indent.
* libmisc/Makefile.am, lib/groupmem.c, lib/groupio.c, lib/pwmem.c,
lib/pwio.c, lib/shadowmem.c, lib/shadowio.c: Move the __<xx>_dup
functions (used by the xget... functions) from the <xx>io.c files
to the new <xx>mem.c files. This avoid linking some utils against
the SELinux library.
2007-11-18 23:15:26 +00:00
|
|
|
gr = getgrgid (rgid);; /* local, no need for xgetgrgid */
|
2008-06-10 19:45:06 +00:00
|
|
|
if (NULL != gr) {
|
2008-06-13 21:31:23 +00:00
|
|
|
(void) printf (" GID=%lu(%s)",
|
|
|
|
(unsigned long) rgid, gr->gr_name);
|
2008-06-10 19:45:06 +00:00
|
|
|
} else {
|
2008-06-13 21:31:23 +00:00
|
|
|
(void) printf (" GID=%lu", (unsigned long) rgid);
|
2008-06-10 19:45:06 +00:00
|
|
|
}
|
2007-10-07 11:44:02 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Print out the effective user ID and group ID if they are
|
|
|
|
* different from the real values.
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (ruid != euid) {
|
* lib/prototypes.h, configure.in, libmisc/Makefile.am,
libmisc/xgetXXbyYY.c, libmisc/xgetpwnam.c, libmisc/xgetpwuid.c,
libmisc/xgetgrnam.c, libmisc/xgetgrgid.c, libmisc/xgetspnam.c:
Added functions xgetpwnam(), xgetpwuid(), xgetgrnam(),
xgetgrgid(), and xgetspnam(). They allocate memory for the
returned structure and are more robust to successive calls. They
are implemented with the libc's getxxyyy_r() functions if
available.
* libmisc/limits.c, libmisc/entry.c, libmisc/chowntty.c,
libmisc/addgrps.c, libmisc/myname.c, libmisc/rlogin.c,
libmisc/pwdcheck.c, src/newgrp.c, src/login_nopam.c,
src/userdel.c, src/lastlog.c, src/grpck.c, src/gpasswd.c,
src/newusers.c, src/chpasswd.c, src/chfn.c, src/groupmems.c,
src/usermod.c, src/expiry.c, src/groupdel.c, src/chgpasswd.c,
src/su.c, src/useradd.c, src/groupmod.c, src/passwd.c, src/pwck.c,
src/groupadd.c, src/chage.c, src/login.c, src/suauth.c,
src/faillog.c, src/groups.c, src/chsh.c, src/id.c: Review all the
usage of one of the getpwnam(), getpwuid(), getgrnam(),
getgrgid(), and getspnam() functions. It was noticed on
http://bugs.debian.org/341230 that chfn and chsh use a passwd
structure after calling a pam function, which result in using
information from the passwd structure requested by pam, not the
original one. It is much easier to use the new xget... functions
to avoid these issues. I've checked which call to the original
get... functions could be left (reducing the scope of the
structure if possible), and I've left comments to ease future
reviews (e.g. /* local, no need for xgetpwnam */).
Note: the getpwent/getgrent calls should probably be checked also.
* src/groupdel.c, src/expiry.c: Fix typos in comments.
* src/groupmod.c: Re-indent.
* libmisc/Makefile.am, lib/groupmem.c, lib/groupio.c, lib/pwmem.c,
lib/pwio.c, lib/shadowmem.c, lib/shadowio.c: Move the __<xx>_dup
functions (used by the xget... functions) from the <xx>io.c files
to the new <xx>mem.c files. This avoid linking some utils against
the SELinux library.
2007-11-18 23:15:26 +00:00
|
|
|
pw = getpwuid (euid); /* local, no need for xgetpwuid */
|
2008-06-10 19:45:06 +00:00
|
|
|
if (NULL != pw) {
|
2008-06-13 21:31:23 +00:00
|
|
|
(void) printf (" EUID=%lu(%s)",
|
|
|
|
(unsigned long) euid, pw->pw_name);
|
2008-06-10 19:45:06 +00:00
|
|
|
} else {
|
2008-06-13 21:31:23 +00:00
|
|
|
(void) printf (" EUID=%lu", (unsigned long) euid);
|
2008-06-10 19:45:06 +00:00
|
|
|
}
|
2007-10-07 11:44:02 +00:00
|
|
|
}
|
|
|
|
if (rgid != egid) {
|
* lib/prototypes.h, configure.in, libmisc/Makefile.am,
libmisc/xgetXXbyYY.c, libmisc/xgetpwnam.c, libmisc/xgetpwuid.c,
libmisc/xgetgrnam.c, libmisc/xgetgrgid.c, libmisc/xgetspnam.c:
Added functions xgetpwnam(), xgetpwuid(), xgetgrnam(),
xgetgrgid(), and xgetspnam(). They allocate memory for the
returned structure and are more robust to successive calls. They
are implemented with the libc's getxxyyy_r() functions if
available.
* libmisc/limits.c, libmisc/entry.c, libmisc/chowntty.c,
libmisc/addgrps.c, libmisc/myname.c, libmisc/rlogin.c,
libmisc/pwdcheck.c, src/newgrp.c, src/login_nopam.c,
src/userdel.c, src/lastlog.c, src/grpck.c, src/gpasswd.c,
src/newusers.c, src/chpasswd.c, src/chfn.c, src/groupmems.c,
src/usermod.c, src/expiry.c, src/groupdel.c, src/chgpasswd.c,
src/su.c, src/useradd.c, src/groupmod.c, src/passwd.c, src/pwck.c,
src/groupadd.c, src/chage.c, src/login.c, src/suauth.c,
src/faillog.c, src/groups.c, src/chsh.c, src/id.c: Review all the
usage of one of the getpwnam(), getpwuid(), getgrnam(),
getgrgid(), and getspnam() functions. It was noticed on
http://bugs.debian.org/341230 that chfn and chsh use a passwd
structure after calling a pam function, which result in using
information from the passwd structure requested by pam, not the
original one. It is much easier to use the new xget... functions
to avoid these issues. I've checked which call to the original
get... functions could be left (reducing the scope of the
structure if possible), and I've left comments to ease future
reviews (e.g. /* local, no need for xgetpwnam */).
Note: the getpwent/getgrent calls should probably be checked also.
* src/groupdel.c, src/expiry.c: Fix typos in comments.
* src/groupmod.c: Re-indent.
* libmisc/Makefile.am, lib/groupmem.c, lib/groupio.c, lib/pwmem.c,
lib/pwio.c, lib/shadowmem.c, lib/shadowio.c: Move the __<xx>_dup
functions (used by the xget... functions) from the <xx>io.c files
to the new <xx>mem.c files. This avoid linking some utils against
the SELinux library.
2007-11-18 23:15:26 +00:00
|
|
|
gr = getgrgid (egid); /* local, no need for xgetgrgid */
|
2008-06-10 19:45:06 +00:00
|
|
|
if (NULL != gr) {
|
2008-06-13 21:31:23 +00:00
|
|
|
(void) printf (" EGID=%lu(%s)",
|
|
|
|
(unsigned long) egid, gr->gr_name);
|
2008-06-10 19:45:06 +00:00
|
|
|
} else {
|
2008-06-13 21:31:23 +00:00
|
|
|
(void) printf (" EGID=%lu", (unsigned long) egid);
|
2008-06-10 19:45:06 +00:00
|
|
|
}
|
2007-10-07 11:44:02 +00:00
|
|
|
}
|
2021-12-27 20:50:06 +01:00
|
|
|
|
2007-10-07 11:44:02 +00:00
|
|
|
/*
|
2007-10-07 11:44:59 +00:00
|
|
|
* Print out the concurrent group set if the user has requested it.
|
|
|
|
* The group numbers will be printed followed by their names.
|
2007-10-07 11:44:02 +00:00
|
|
|
*/
|
2007-10-07 11:44:51 +00:00
|
|
|
if (aflg && (ngroups = getgroups (sys_ngroups, groups)) != -1) {
|
* src/newgrp.c: Limit the scope of variable pid.
* src/login_nopam.c: Limit the scope of variables end, lineno, i,
str_len.
* src/logoutd.c: Limit the scope of variable c.
* src/vipw.c: Re-indent.
* src/vipw.c: Close the file after the creation of the backup.
* src/useradd.c (set_default): Close input file on failure.
* src/useradd.c: Limit the scope of variables spool, file, fd, gr,
gid, mode.
* src/passwd.c: Limit the scope of variables last and ok.
* src/chage.c: Fix typo (non breaking space).
* src/login.c: Limit the scope of variables erasechar killchar, c,
failed.
* src/groups.c: Limit the scope of variable ngroups, pri_grp, i.
* src/id.c: Limit the scope of variable i.
2010-03-23 11:26:34 +00:00
|
|
|
int i;
|
2007-10-07 11:44:02 +00:00
|
|
|
|
|
|
|
/*
|
2007-10-07 11:44:59 +00:00
|
|
|
* Start off the group message. It will be of the format
|
2007-10-07 11:44:02 +00:00
|
|
|
*
|
2007-10-07 11:44:59 +00:00
|
|
|
* groups=###(aaa),###(aaa),###(aaa)
|
2007-10-07 11:44:02 +00:00
|
|
|
*
|
|
|
|
* where "###" is a numerical value and "aaa" is the
|
|
|
|
* corresponding name for each respective numerical value.
|
|
|
|
*/
|
2008-06-10 19:45:06 +00:00
|
|
|
(void) puts (_(" groups="));
|
2007-10-07 11:44:02 +00:00
|
|
|
for (i = 0; i < ngroups; i++) {
|
2008-06-10 19:45:06 +00:00
|
|
|
if (0 != i)
|
|
|
|
(void) putchar (',');
|
2007-10-07 11:44:02 +00:00
|
|
|
|
* lib/prototypes.h, configure.in, libmisc/Makefile.am,
libmisc/xgetXXbyYY.c, libmisc/xgetpwnam.c, libmisc/xgetpwuid.c,
libmisc/xgetgrnam.c, libmisc/xgetgrgid.c, libmisc/xgetspnam.c:
Added functions xgetpwnam(), xgetpwuid(), xgetgrnam(),
xgetgrgid(), and xgetspnam(). They allocate memory for the
returned structure and are more robust to successive calls. They
are implemented with the libc's getxxyyy_r() functions if
available.
* libmisc/limits.c, libmisc/entry.c, libmisc/chowntty.c,
libmisc/addgrps.c, libmisc/myname.c, libmisc/rlogin.c,
libmisc/pwdcheck.c, src/newgrp.c, src/login_nopam.c,
src/userdel.c, src/lastlog.c, src/grpck.c, src/gpasswd.c,
src/newusers.c, src/chpasswd.c, src/chfn.c, src/groupmems.c,
src/usermod.c, src/expiry.c, src/groupdel.c, src/chgpasswd.c,
src/su.c, src/useradd.c, src/groupmod.c, src/passwd.c, src/pwck.c,
src/groupadd.c, src/chage.c, src/login.c, src/suauth.c,
src/faillog.c, src/groups.c, src/chsh.c, src/id.c: Review all the
usage of one of the getpwnam(), getpwuid(), getgrnam(),
getgrgid(), and getspnam() functions. It was noticed on
http://bugs.debian.org/341230 that chfn and chsh use a passwd
structure after calling a pam function, which result in using
information from the passwd structure requested by pam, not the
original one. It is much easier to use the new xget... functions
to avoid these issues. I've checked which call to the original
get... functions could be left (reducing the scope of the
structure if possible), and I've left comments to ease future
reviews (e.g. /* local, no need for xgetpwnam */).
Note: the getpwent/getgrent calls should probably be checked also.
* src/groupdel.c, src/expiry.c: Fix typos in comments.
* src/groupmod.c: Re-indent.
* libmisc/Makefile.am, lib/groupmem.c, lib/groupio.c, lib/pwmem.c,
lib/pwio.c, lib/shadowmem.c, lib/shadowio.c: Move the __<xx>_dup
functions (used by the xget... functions) from the <xx>io.c files
to the new <xx>mem.c files. This avoid linking some utils against
the SELinux library.
2007-11-18 23:15:26 +00:00
|
|
|
/* local, no need for xgetgrgid */
|
2007-10-07 11:44:59 +00:00
|
|
|
gr = getgrgid (groups[i]);
|
2008-06-10 19:45:06 +00:00
|
|
|
if (NULL != gr) {
|
2008-06-13 21:31:23 +00:00
|
|
|
(void) printf ("%lu(%s)",
|
|
|
|
(unsigned long) groups[i],
|
|
|
|
gr->gr_name);
|
2008-06-10 19:45:06 +00:00
|
|
|
} else {
|
2008-06-13 21:31:23 +00:00
|
|
|
(void) printf ("%lu",
|
|
|
|
(unsigned long) groups[i]);
|
2008-06-10 19:45:06 +00:00
|
|
|
}
|
2007-10-07 11:44:02 +00:00
|
|
|
}
|
|
|
|
}
|
2007-10-07 11:44:59 +00:00
|
|
|
free (groups);
|
2007-10-07 11:44:02 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Finish off the line.
|
|
|
|
*/
|
2008-06-10 19:45:06 +00:00
|
|
|
(void) putchar ('\n');
|
* lib/exitcodes.h: Define E_SUCCESS as EXIT_SUCCESS. Added FIXMEs.
* libmisc/chowntty.c, libmisc/rlogin.c, libmisc/sub.c,
src/newusers.c, libmisc/sulog.c, libmisc/system.c, src/logoutd.c,
src/groups.c, src/id.c, lib/encrypt.c, libmisc/audit_help.c,
libmisc/limits.c: Return EXIT_FAILURE instead of 1, and
EXIT_SUCCESS instead of 0.
* libmisc/audit_help.c: Replace an fprintf() by fputs().
* libmisc/audit_help.c: Remove documentation of the audit_logger
returned values. The function returns void.
* libmisc/system.c: Only return status if waitpid succeeded.
Return -1 otherwise.
2009-04-30 21:08:49 +00:00
|
|
|
|
|
|
|
return EXIT_SUCCESS;
|
2007-10-07 11:45:23 +00:00
|
|
|
}
|
2008-04-27 00:40:09 +00:00
|
|
|
|