File: 03_shadow.patch

package info (click to toggle)
sup 20060803-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 496 kB
  • ctags: 680
  • sloc: ansic: 8,166; makefile: 92
file content (79 lines) | stat: -rw-r--r-- 2,131 bytes parent folder | download
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
--- sup-20060803.orig/Makefile	2006-08-04 13:12:59.000000000 +0200
+++ sup-20060803/Makefile	2006-08-04 13:14:36.000000000 +0200
@@ -95,7 +95,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
--- sup-20060803.orig/wrap_pwd.h
+++ sup-20060803/wrap_pwd.h
@@ -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 */
--- sup-20060803.orig/wrap_pwd.c
+++ sup-20060803/wrap_pwd.c
@@ -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;
+}
--- sup-20060803.orig/supfilesrv.c	2006-08-03 18:09:33.000000000 +0200
+++ sup-20060803/supfilesrv.c	2006-08-04 13:17:42.000000000 +0200
@@ -219,6 +219,7 @@
 #include <errno.h>
 #include <setjmp.h>
 #include <pwd.h>
+#include "wrap_pwd.h"
 #include <grp.h>
 #include <fcntl.h>
 #include <stdarg.h>