1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
|
Index: sup-20091019/Makefile
===================================================================
--- sup-20091019.orig/Makefile 2009-10-20 17:24:06.000000000 +0200
+++ sup-20091019/Makefile 2009-10-20 17:25:53.000000000 +0200
@@ -105,7 +105,7 @@
OSF_LIBS = -lbsd
EXTRALIBS = libextra.a
sup_OFILES = ${SUPCL} ${SUPS}
-supfilesrv_OFILES = supfilesrv.o scan.o ${SUPS}
+supfilesrv_OFILES = supfilesrv.o scan.o ${SUPS} wrap_pwd.o
supfilesrv_LIBS = libextra.a
supscan_OFILES = supscan.o stree.o scan.o
SOLARIS_LIBS = -lsocket -lnsl
Index: sup-20091019/wrap_pwd.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ sup-20091019/wrap_pwd.h 2009-10-20 17:25:53.000000000 +0200
@@ -0,0 +1,16 @@
+/* wrap_pwd.h: Copyright (C) TOYODA Eizi, 1997
+ * In the public domain.
+ */
+
+#ifndef _WRAP_PWD_H
+# define _WRAP_PWD_H
+
+struct passwd *wrap_getpwnam(const char *name);
+struct passwd *wrap_getpwuid(uid_t uid);
+
+# ifndef _WRAP_PWD_NO_MACROS
+# define getpwnam(name) wrap_getpwnam(name)
+# define getpwuid(uid) wrap_getpwuid(uid)
+# endif /* _WRAP_PWD_NO_MACROS */
+
+#endif /* _WRAP_PWD_H */
Index: sup-20091019/wrap_pwd.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ sup-20091019/wrap_pwd.c 2009-10-20 17:25:53.000000000 +0200
@@ -0,0 +1,36 @@
+/* wrap_pwd.c: Copyright (C) TOYODA Eizi, 1997 */
+/* In the public domain. */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <pwd.h>
+#include <shadow.h>
+
+#define _WRAP_PWD_NO_MACROS
+#include "wrap_pwd.h"
+
+static struct passwd pw;
+
+ struct passwd *
+wrap_getpwnam(const char *name)
+{
+ struct passwd *xpw;
+ struct spwd *shadow;
+ pw = *(xpw = getpwnam(name));
+ if ((shadow = getspnam(name)) != NULL) {
+ pw.pw_passwd = shadow->sp_pwdp;
+ }
+ return &pw;
+}
+
+ struct passwd *
+wrap_getpwuid(uid_t uid)
+{
+ struct passwd *xpw;
+ struct spwd *shadow;
+ pw = *(xpw = getpwuid(uid));
+ if ((shadow = getspnam(pw.pw_name)) != NULL) {
+ pw.pw_passwd = shadow->sp_pwdp;
+ }
+ return &pw;
+}
Index: sup-20091019/supfilesrv.c
===================================================================
--- sup-20091019.orig/supfilesrv.c 2009-10-20 17:24:24.000000000 +0200
+++ sup-20091019/supfilesrv.c 2009-10-20 17:25:53.000000000 +0200
@@ -217,6 +217,7 @@
#include <errno.h>
#include <setjmp.h>
#include <pwd.h>
+#include "wrap_pwd.h"
#include <grp.h>
#include <fcntl.h>
#include <stdarg.h>
|