~ubuntu-branches/ubuntu/vivid/sup/vivid

« back to all changes in this revision

Viewing changes to debian/patches/03_shadow.patch

  • Committer: Bazaar Package Importer
  • Author(s): Jochen Friedrich
  • Date: 2006-11-02 15:03:30 UTC
  • mfrom: (1.1.1 upstream) (3.1.1 dapper)
  • Revision ID: james.westby@ubuntu.com-20061102150330-yt4yavw4rj1hz8yj
Tags: 20060803-2
Fix CFLAGS, so libwrap is built into sup again.

Show diffs side-by-side

added added

removed removed

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