#define USER_RHOSTS_FILE "/.rhosts" /* prefixed by user's home dir */
-#ifdef linux
+#ifdef __linux__
#include <endian.h>
#endif
#include <ctype.h>
#include <net/if.h>
-#ifdef linux
-# include <linux/sockios.h>
-# ifndef __USE_MISC
-# define __USE_MISC
-# include <sys/fsuid.h>
-# endif /* __USE_MISC */
-#endif
#include <pwd.h>
#include <grp.h>
#include <sys/file.h>
#include <sys/signal.h>
#include <sys/stat.h>
+#include <stdint.h>
#include <syslog.h>
#ifndef _PATH_HEQUIV
#define _PATH_HEQUIV "/etc/hosts.equiv"
#include <security/_pam_macros.h>
#include <security/_pam_modutil.h>
-/* to the best of my knowledge, all modern UNIX boxes have 32 bit integers */
-#define U32 unsigned int
+/* Use the C99 type; older platforms will need this to be typedef'ed
+ elsewhere */
+#define U32 uint32_t
/*
*/
/* We are root, this will not fail */
-#ifdef linux
+#ifdef __linux__
/* If we are on linux the better way is setfsuid */
uid = setfsuid(pwd->pw_uid);
hostf = fopen(pbuf, "r");
/* private group caveat */
if (opts->opt_private_group) {
- struct group *grp = getgrgid(sbuf.st_gid);
+ struct group *grp = _pammodutil_getgrgid(pamh, sbuf.st_gid);
if (NULL == grp || NULL == grp->gr_name
|| strcmp(luser,grp->gr_name)) {
* they are reset before we exit.
*/
-#ifdef linux
+#ifdef __linux__
setfsuid(uid);
#else
(void)seteuid(uid);