diff -dru shadow-4.0.3/lib/groupio.c shadow-4.0.3.fjo/lib/groupio.c --- shadow-4.0.3/lib/groupio.c Tue Aug 14 23:10:36 2001 +++ shadow-4.0.3.fjo/lib/groupio.c Fri Dec 20 13:19:29 2002 @@ -79,7 +79,14 @@ group_put(const void *ent, FILE *file) { const struct group *gr = ent; - return (putgrent(gr, file) == -1) ? -1 : 0; + int w; +#define T(a) if (a<1) return -1 + T(fprintf(file, "%s:%s:", gr->gr_name, gr->gr_passwd)); + if (gr->gr_gid > -1) T(fprintf(file, "%d", gr->gr_gid)); + T(fprintf(file, ":")); + for (w=0; gr->gr_mem[w]; w++) + T(fprintf(file, "%s%s", gr->gr_mem[w], (gr->gr_mem[w+1])?(","):(""))); + return (fprintf(file, "\n")!=1)?(-1):(0); } static struct commonio_ops group_ops = { diff -dru shadow-4.0.3/lib/shadowio.c shadow-4.0.3.fjo/lib/shadowio.c --- shadow-4.0.3/lib/shadowio.c Tue Aug 14 23:10:36 2001 +++ shadow-4.0.3.fjo/lib/shadowio.c Fri Dec 20 13:19:29 2002 @@ -55,17 +55,62 @@ return sp->sp_namp; } +static void shadow_parse_help (char *c, long *l) +{ + scan_ulong(c,l); + if (!*l) *l=-1; +} + static void * shadow_parse(const char *line) { - return (void *) sgetspent(line); + static struct spwd sp; + static char buf[512]; + int i; + char *r, *l = &buf[0]; + + strncpy(l, line, 512); + for (i=0; i<8; i++) { + r = strchr(l, ':'); + if (!r) return NULL; + *r = '\0'; + switch (i) { + case 0: sp.sp_namp = l; break; + case 1: sp.sp_pwdp = l; break; + case 2: shadow_parse_help(l, &sp.sp_lstchg); break; + case 3: shadow_parse_help(l, &sp.sp_min); break; + case 4: shadow_parse_help(l, &sp.sp_max); break; + case 5: shadow_parse_help(l, &sp.sp_warn); break; + case 6: shadow_parse_help(l, &sp.sp_inact); break; + case 7: shadow_parse_help(l, &sp.sp_expire); break; + } + l = ++r; + } + shadow_parse_help(l, &sp.sp_flag); + return &sp; +} + +static int shadow_put_helper(FILE *file, long l) +{ + if (l==-1) return fprintf(file, ":"); + return fprintf(file, ":%d", l); } static int shadow_put(const void *ent, FILE *file) { const struct spwd *sp = ent; - return (putspent(sp, file) == -1) ? -1 : 0; + /* nail me, stone me */ +#define T(a) if (a<1) return -1 + T(fprintf(file, "%s:%s", sp->sp_namp, sp->sp_pwdp)); + T(shadow_put_helper(file, sp->sp_lstchg)); + T(shadow_put_helper(file, sp->sp_min)); + T(shadow_put_helper(file, sp->sp_max)); + T(shadow_put_helper(file, sp->sp_warn)); + T(shadow_put_helper(file, sp->sp_inact)); + T(shadow_put_helper(file, sp->sp_expire)); + T(shadow_put_helper(file, sp->sp_flag)); + return (fprintf(file, "\n")!=1)?(-1):(0); } static struct commonio_ops shadow_ops = { diff -dru shadow-4.0.3/libmisc/log.c shadow-4.0.3.fjo/libmisc/log.c --- shadow-4.0.3/libmisc/log.c Thu Apr 16 21:57:44 1998 +++ shadow-4.0.3.fjo/libmisc/log.c Fri Dec 20 13:19:29 2002 @@ -90,7 +90,7 @@ time(&newlog.ll_time); strncpy(newlog.ll_line, line, sizeof newlog.ll_line); -#if HAVE_LL_HOST +#ifdef HAVE_LL_HOST strncpy(newlog.ll_host, host, sizeof newlog.ll_host); #endif if (lseek(fd, offset, SEEK_SET) == offset) diff -dru shadow-4.0.3/libmisc/login_access.c shadow-4.0.3.fjo/libmisc/login_access.c --- shadow-4.0.3/libmisc/login_access.c Fri Jan 30 00:22:34 1998 +++ shadow-4.0.3.fjo/libmisc/login_access.c Fri Dec 20 13:19:29 2002 @@ -213,8 +213,8 @@ getdomainname(domain, MAXHOSTNAMELEN); mydomain = domain; } - - return innetgr(group, machine, user, mydomain); +printf(__FILE__":%d "__FUNCTION__"(): innetgr not yet implemented!\n",__LINE__); + return -1; #endif } diff -dru shadow-4.0.3/libmisc/rlogin.c shadow-4.0.3.fjo/libmisc/rlogin.c --- shadow-4.0.3/libmisc/rlogin.c Fri Aug 27 21:02:51 1999 +++ shadow-4.0.3.fjo/libmisc/rlogin.c Fri Dec 20 13:19:29 2002 @@ -161,11 +161,6 @@ * go fix the #define in config.h. */ -#ifndef RUSEROK return 0; -#else - return ruserok (remote_host, pwd->pw_uid == 0, - remote_name, name) == RUSEROK; -#endif } #endif /* RLOGIN */ diff -dru shadow-4.0.3/libmisc/xmalloc.c shadow-4.0.3.fjo/libmisc/xmalloc.c --- shadow-4.0.3/libmisc/xmalloc.c Mon Dec 28 21:34:56 1998 +++ shadow-4.0.3.fjo/libmisc/xmalloc.c Fri Dec 20 13:19:29 2002 @@ -16,8 +16,6 @@ #include "defines.h" -extern char *malloc(); - char * xmalloc(size_t size) { diff -dru shadow-4.0.3/src/Makefile.in shadow-4.0.3.fjo/src/Makefile.in --- shadow-4.0.3/src/Makefile.in Wed Mar 13 20:04:10 2002 +++ shadow-4.0.3.fjo/src/Makefile.in Fri Dec 20 13:19:52 2002 @@ -758,10 +758,10 @@ install-data-am: install-ubinPROGRAMS install-usbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-exec-am: install-binPROGRAMS @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-info: install-info-am @@ -798,8 +798,8 @@ install-exec-hook: - ln -sf newgrp $(DESTDIR)$(bindir)/sg - ln -sf vigr $(DESTDIR)$(bindir)/vipw + ln -sf newgrp $(DESTDIR)$(ubindir)/sg + ln -sf vipw $(DESTDIR)$(usbindir)/vigr for i in $(suidbins); do \ chmod 4755 $(DESTDIR)$(bindir)/$$i; \ done diff -dru shadow-4.0.3/src/lastlog.c shadow-4.0.3.fjo/src/lastlog.c --- shadow-4.0.3/src/lastlog.c Sat Jan 5 16:41:43 2002 +++ shadow-4.0.3.fjo/src/lastlog.c Fri Dec 20 13:19:29 2002 @@ -38,11 +38,7 @@ #include #include "prototypes.h" #include "defines.h" -#if HAVE_LASTLOG_H -#include -#else -#include "lastlog_.h" -#endif +#include /* * Needed for MkLinux DR1/2/2.1 - J. */ diff -dru shadow-4.0.3/src/login.c shadow-4.0.3.fjo/src/login.c --- shadow-4.0.3/src/login.c Fri Mar 8 05:30:28 2002 +++ shadow-4.0.3.fjo/src/login.c Fri Dec 20 13:19:29 2002 @@ -44,11 +44,7 @@ #include #endif #include -#if HAVE_LASTLOG_H -#include -#else -#include "lastlog_.h" -#endif +#include #include "faillog.h" #include "failure.h" #include "pwauth.h" diff -dru shadow-4.0.3/src/newgrp.c shadow-4.0.3.fjo/src/newgrp.c --- shadow-4.0.3/src/newgrp.c Sun Jan 6 16:00:07 2002 +++ shadow-4.0.3.fjo/src/newgrp.c Fri Dec 20 13:19:29 2002 @@ -35,6 +35,7 @@ #include #include #include +#include #include "prototypes.h" #include "defines.h" #include "getdef.h" diff -dru shadow-4.0.3/src/pwunconv.c shadow-4.0.3.fjo/src/pwunconv.c --- shadow-4.0.3/src/pwunconv.c Sat Jan 5 16:41:44 2002 +++ shadow-4.0.3.fjo/src/pwunconv.c Fri Dec 20 13:19:29 2002 @@ -53,6 +53,7 @@ } #else /*{ */ +#define SHADOW "/etc/shadow" char *l64a (); static int shadow_locked = 0, passwd_locked = 0; diff -dru shadow-4.0.3/src/useradd.c shadow-4.0.3.fjo/src/useradd.c --- shadow-4.0.3/src/useradd.c Thu Jan 10 14:01:28 2002 +++ shadow-4.0.3.fjo/src/useradd.c Fri Dec 20 13:19:29 2002 @@ -49,11 +49,7 @@ #include #endif /* USE_PAM */ #include "pwauth.h" -#if HAVE_LASTLOG_H -#include -#else -#include "lastlog_.h" -#endif +#include #include "faillog.h" #ifndef SKEL_DIR #define SKEL_DIR "/etc/skel" diff -dru shadow-4.0.3/src/usermod.c shadow-4.0.3.fjo/src/usermod.c --- shadow-4.0.3/src/usermod.c Sat Jan 5 16:41:44 2002 +++ shadow-4.0.3.fjo/src/usermod.c Fri Dec 20 13:19:29 2002 @@ -49,11 +49,7 @@ #include "defines.h" #include "chkname.h" #include "faillog.h" -#if HAVE_LASTLOG_H -#include -#else -#include "lastlog_.h" -#endif +#include #include "pwauth.h" #include "getdef.h" /*