dnl shadow now uses the libc's shadow implementation
AC_CHECK_HEADER([shadow.h],,[AC_MSG_ERROR([You need a libc with shadow.h])])
-AC_CHECK_FUNCS(arc4random_buf l64a fchmod fchown fsync futimes getgroups \
+AC_CHECK_FUNCS(arc4random_buf l64a fchmod fchown fsync futimes \
gethostname getentropy getrandom getspnam gettimeofday getusershell \
getutent initgroups lchown lckpwdf lstat lutimes memcpy memset \
setgroups sigaction strchr updwtmp updwtmpx innetgr getpwnam_r \
*/
int main (int argc, char **argv)
{
-#ifdef HAVE_GETGROUPS
long sys_ngroups;
GETGROUPS_T *groups;
-#else
- char *logname;
- char *getlogin ();
-#endif
-#ifdef HAVE_GETGROUPS
sys_ngroups = sysconf (_SC_NGROUPS_MAX);
groups = (GETGROUPS_T *) malloc (sizeof (GETGROUPS_T) * sys_ngroups);
-#endif
+
(void) setlocale (LC_ALL, "");
(void) bindtextdomain (PACKAGE, LOCALEDIR);
(void) textdomain (PACKAGE);
* current user.
*/
-#ifdef HAVE_GETGROUPS
int i;
int pri_grp; /* TODO: should be GETGROUPS_T */
/*
}
}
(void) putchar ('\n');
-#else
- /*
- * This system does not have the getgroups() system call, so
- * I must check the groups file directly.
- */
- logname = getlogin ();
- if (NULL != logname) {
- print_groups (logname);
- } else {
- exit (EXIT_FAILURE);
- }
-#endif
} else {
/*
static void usage (void)
{
-#ifdef HAVE_GETGROUPS
(void) fputs (_("Usage: id [-a]\n"), stderr);
-#else
- (void) fputs (_("Usage: id\n"), stderr);
-#endif
exit (EXIT_FAILURE);
}
* gid_t for everything. Some systems have a small and fixed NGROUPS,
* usually about 16 or 32. Others use bigger values.
*/
-#ifdef HAVE_GETGROUPS
GETGROUPS_T *groups;
int ngroups;
bool aflg = 0;
-#endif
struct passwd *pw;
struct group *gr;
* work if the system library is recompiled.
*/
sys_ngroups = sysconf (_SC_NGROUPS_MAX);
-#ifdef HAVE_GETGROUPS
groups = (GETGROUPS_T *) malloc (sizeof (GETGROUPS_T) * sys_ngroups);
+
/*
* See if the -a flag has been given to print out the concurrent
* group set.
aflg = true;
}
}
-#else
- if (argc > 1) {
- usage ();
- }
-#endif
ruid = getuid ();
euid = geteuid ();
(void) printf (" EGID=%lu", (unsigned long) egid);
}
}
-#ifdef HAVE_GETGROUPS
+
/*
* Print out the concurrent group set if the user has requested it.
* The group numbers will be printed followed by their names.
}
}
free (groups);
-#endif
/*
* Finish off the line.