/[gentoo-alt]/trunk/sys-libs/openpam/files/openpam-20050201-gentoo.patch
Gentoo

Contents of /trunk/sys-libs/openpam/files/openpam-20050201-gentoo.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 459 - (show annotations) (download)
Sat Jun 11 11:04:52 2005 UTC (8 years, 10 months ago) by flameeyes
File size: 6783 byte(s)
Fix compilation on Gentoo/Linux.

1 diff -Nur openpam-20050201/include/security/Makefile.am openpam-20050201-gentoo/include/security/Makefile.am
2 --- openpam-20050201/include/security/Makefile.am 2005-02-01 00:00:00.000000000 +0100
3 +++ openpam-20050201-gentoo/include/security/Makefile.am 2005-06-11 12:48:19.038207056 +0200
4 @@ -6,4 +6,5 @@
5 pam_appl.h \
6 pam_constants.h \
7 pam_modules.h \
8 - pam_types.h
9 + pam_types.h \
10 + pam_mod_misc.h
11 diff -Nur openpam-20050201/include/security/pam_mod_misc.h openpam-20050201-gentoo/include/security/pam_mod_misc.h
12 --- openpam-20050201/include/security/pam_mod_misc.h 1970-01-01 01:00:00.000000000 +0100
13 +++ openpam-20050201-gentoo/include/security/pam_mod_misc.h 2005-06-11 12:48:19.038207056 +0200
14 @@ -0,0 +1,56 @@
15 +/*-
16 + * Copyright 1998 Juniper Networks, Inc.
17 + * All rights reserved.
18 + *
19 + * Redistribution and use in source and binary forms, with or without
20 + * modification, are permitted provided that the following conditions
21 + * are met:
22 + * 1. Redistributions of source code must retain the above copyright
23 + * notice, this list of conditions and the following disclaimer.
24 + * 2. Redistributions in binary form must reproduce the above copyright
25 + * notice, this list of conditions and the following disclaimer in the
26 + * documentation and/or other materials provided with the distribution.
27 + *
28 + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
29 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
30 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
32 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
37 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38 + * SUCH DAMAGE.
39 + *
40 + * $FreeBSD: src/lib/libpam/libpam/security/pam_mod_misc.h,v 1.12 2003/05/31 16:56:35 des Exp $
41 + */
42 +
43 +#ifndef PAM_MOD_MISC_H
44 +#define PAM_MOD_MISC_H
45 +
46 +#include <sys/cdefs.h>
47 +
48 +/*
49 + * Common option names
50 + */
51 +#define PAM_OPT_NULLOK "nullok"
52 +#define PAM_OPT_AUTH_AS_SELF "auth_as_self"
53 +#define PAM_OPT_ECHO_PASS "echo_pass"
54 +#define PAM_OPT_DEBUG "debug"
55 +
56 +__BEGIN_DECLS
57 +void _pam_verbose_error(pam_handle_t *, int, const char *,
58 + const char *, const char *, ...);
59 +__END_DECLS
60 +
61 +#define PAM_LOG(...) \
62 + openpam_log(PAM_LOG_DEBUG, __VA_ARGS__)
63 +
64 +#define PAM_RETURN(arg) \
65 + return (arg)
66 +
67 +#define PAM_VERBOSE_ERROR(...) \
68 + _pam_verbose_error(pamh, flags, __FILE__, __FUNCTION__, __VA_ARGS__)
69 +
70 +#endif
71 diff -Nur openpam-20050201/lib/Makefile.am openpam-20050201-gentoo/lib/Makefile.am
72 --- openpam-20050201/lib/Makefile.am 2005-02-01 00:00:00.000000000 +0100
73 +++ openpam-20050201-gentoo/lib/Makefile.am 2005-06-11 12:48:19.038207056 +0200
74 @@ -46,6 +46,7 @@
75 pam_verror.c \
76 pam_vinfo.c \
77 pam_vprompt.c \
78 + pam_debug_log.c \
79 $(NULL)
80
81 libpam_la_LDFLAGS = -no-undefined -version-info @LIB_MAJ@ @DL_LIBS@
82 diff -Nur openpam-20050201/lib/openpam_dynamic.c openpam-20050201-gentoo/lib/openpam_dynamic.c
83 --- openpam-20050201/lib/openpam_dynamic.c 2005-02-01 00:00:00.000000000 +0100
84 +++ openpam-20050201-gentoo/lib/openpam_dynamic.c 2005-06-11 12:48:19.039206904 +0200
85 @@ -73,8 +73,21 @@
86 *strrchr(vpath, '.') = '\0';
87 if ((dlh = dlopen(vpath, RTLD_NOW)) == NULL) {
88 openpam_log(PAM_LOG_DEBUG, "%s: %s", vpath, dlerror());
89 - FREE(module);
90 - return (NULL);
91 +
92 + /* Gentoo Code to handle /lib/security directory */
93 + FREE(vpath);
94 + if ( asprintf(&vpath, "%s/%s.%d", OPENPAM_MODULES_DIR, path, LIB_MAJ) < 0 )
95 + goto buf_err;
96 + if ((dlh = dlopen(vpath, RTLD_NOW)) == NULL) {
97 + openpam_log(PAM_LOG_DEBUG, "%s: %s", vpath, dlerror());
98 + *strrchr(vpath, '.') = '\0';
99 + if ((dlh = dlopen(vpath, RTLD_NOW)) == NULL) {
100 + openpam_log(PAM_LOG_DEBUG, "%s: %s", vpath, dlerror());
101 + FREE(module);
102 +
103 + return (NULL);
104 + }
105 + }
106 }
107 }
108 FREE(vpath);
109 diff -Nur openpam-20050201/lib/pam_debug_log.c openpam-20050201-gentoo/lib/pam_debug_log.c
110 --- openpam-20050201/lib/pam_debug_log.c 1970-01-01 01:00:00.000000000 +0100
111 +++ openpam-20050201-gentoo/lib/pam_debug_log.c 2005-06-11 12:55:17.688562528 +0200
112 @@ -0,0 +1,64 @@
113 +/*-
114 + * Copyright 2001 Mark R V Murray
115 + * All rights reserved.
116 + *
117 + * Redistribution and use in source and binary forms, with or without
118 + * modification, are permitted provided that the following conditions
119 + * are met:
120 + * 1. Redistributions of source code must retain the above copyright
121 + * notice, this list of conditions and the following disclaimer.
122 + * 2. Redistributions in binary form must reproduce the above copyright
123 + * notice, this list of conditions and the following disclaimer in the
124 + * documentation and/or other materials provided with the distribution.
125 + *
126 + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
127 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
128 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
129 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
130 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
131 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
132 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
133 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
134 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
135 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
136 + * SUCH DAMAGE.
137 + */
138 +
139 +#include <sys/cdefs.h>
140 +
141 +#ifndef __GLIBC__
142 +#include <libgen.h>
143 +#endif
144 +
145 +#include <stdarg.h>
146 +#include <stdio.h>
147 +#include <stdlib.h>
148 +#include <string.h>
149 +
150 +#include <security/pam_appl.h>
151 +#include <security/openpam.h>
152 +#include <security/pam_mod_misc.h>
153 +
154 +/* Print a verbose error, including the function name and a
155 + * cleaned up filename.
156 + */
157 +void
158 +_pam_verbose_error(pam_handle_t *pamh, int flags,
159 + const char *file, const char *function, const char *format, ...)
160 +{
161 + va_list ap;
162 + char *fmtbuf, *modname, *period;
163 +
164 + if (!(flags & PAM_SILENT) && !openpam_get_option(pamh, "no_warn")) {
165 + modname = basename(file);
166 + period = strchr(modname, '.');
167 + if (period == NULL)
168 + period = strchr(modname, '\0');
169 + va_start(ap, format);
170 + asprintf(&fmtbuf, "%.*s: %s: %s\n", (int)(period - modname),
171 + modname, function, format);
172 + pam_verror(pamh, fmtbuf, ap);
173 + free(fmtbuf);
174 + va_end(ap);
175 + }
176 +}

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.20