[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

PATCHES: more from Debian against 0.72



Ok, since 0.72 showed a lot of cleanups and almost perfect -Werror
compilation (with the expection of DEBUG_REL compilation :), I'm getting
some nit picking patches out :)

Summary:

000_libs_main: The documentation for the DEBUG compilation has some notes
about _PAM_LOGFILE needing to a) exist and b) be mode 666. First off, when
using fopen(..., "a") as the D(()) macro uses, it does not require the
file to exist at all, and will create one. This fixes the 3 places where
it occured and uses open(2) with O_WRONLY|O_APPEND (and O_NOFOLLOW if
present on the system) to enforce this.

002_install_conf: One minor change on the debian.defs

006_compile_warnings: Fixes one compiler warning in pam_tally_app.c
compilation.

009_modules_pam_wheel: By default this module uses getlogin(), which
according to the docs I've read (and experience) is not the best idea.
However, the module does have a use_uid option that makes it use getuid().
I've changed the module to use getuid() by default, and still accept the
use_uid option but ignore it (for compatibility). This patch also updates
the documentation for pam_wheel to reflect this.

010_docs_pwdb-to-unix: Now that the pam_unix module can handle options
that were only specific to pam_pwdb at one time, there are references in
the docs that are incorrect. This fixes those so that it does not say
"only works with pam_pwdb". Also pam_wheel does not require libpwdb.

013_source_cleanup: Now this patch may be pure preference on my part, but
it cleans up the code a lot and makes more sense (atleast to me). First of
all, _GNU_SOURCE is not linux specific, so wrapping it in a "#ifdef linux"
block is just wrong (the Debian hurd porter had a few choice words for
this setup :). However, _GNU_SOURCE is pretty much platform specific, (ie.
solaris doesn't use it, but linux and hurd do, while bsd should define
_BSD_SOURCE, etc...), so it probably makes more sense in the defs files
(atleast until an autoconf build is setup). Finally, features.h does not
need to be included when using _GNU_SOURCE since it is done automatically
by including the toplevel headers (like stdlib.h, etc..).

This patch removes those defines from their respective sources and into
the appropriate defs. Also note that in glibc, the __USE_FOO defines are
not supposed to be used anyway, but use the _FOO_SOURCE defines instead,
which internally handles the __USE_FOO defines.

014_modules_pam_rhosts: Some cleanup on header includes. This changes the
define checks to the "HAVE_FOO_H" type, which will make the cross over to
autoconf much easier.

Now, what I wanted to work on next was autoconf building, but I'm not sure
how far along any other attempts are or what is being looked for in the
setup (Andrew?).

Enjoy,
  Ben

-- 
 -----------=======-=-======-=========-----------=====------------=-=------
/  Ben Collins  --  ...on that fantastic voyage...  --  Debian GNU/Linux   \
`     bcollins@debian.org  -  collinbm@djj.state.va.us  -  bmc@visi.net    '
 `---=========------=======-------------=-=-----=-===-======-------=--=---'
diff -urN Linux-PAM-0.72.bak/libpam/include/security/_pam_macros.h Linux-PAM-0.72/libpam/include/security/_pam_macros.h
--- Linux-PAM-0.72.bak/libpam/include/security/_pam_macros.h	Mon Nov  8 00:41:23 1999
+++ Linux-PAM-0.72/libpam/include/security/_pam_macros.h	Tue Dec 14 13:33:18 1999
@@ -64,6 +64,9 @@
 #include <sys/types.h>
 #include <stdarg.h>
 #include <errno.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
 
 /*
  * This is for debugging purposes ONLY. DO NOT use on live systems !!!
@@ -81,37 +84,55 @@
 				   , const int line)
 {
     FILE *logfile;
-    int must_close = 1;
-    
-    if (!(logfile = fopen(_PAM_LOGFILE,"a"))) {
+    int must_close = 1, fd;
+   
+#ifdef O_NOFOLLOW
+    if ((fd = open(_PAM_LOGFILE, O_WRONLY|O_NOFOLLOW|O_APPEND)) != -1) {
+#else
+    if ((fd = open(_PAM_LOGFILE, O_WRONLY|O_APPEND)) != -1) {
+#endif
+	if (!(logfile = fdopen(fd,"a"))) {
+	    logfile = stderr;
+	    must_close = 0;
+	    close(fd);
+	}
+    } else {
         logfile = stderr;
-        must_close = 0;
+	must_close = 0;
     }
     fprintf(logfile,"[%s:%s(%d)] ",file, fn, line);
-    if (must_close) {
-        fflush(logfile);
+    fflush(logfile);
+    if (must_close)
         fclose(logfile);
-    }
 }
 
 static void _pam_output_debug(const char *format, ...)
 {
     va_list args;
     FILE *logfile;
-    int must_close = 1;
+    int must_close = 1, fd;
     
     va_start(args, format);
 
-    if (!(logfile = fopen(_PAM_LOGFILE,"a"))) {
-        logfile = stderr;
-        must_close = 0;
+#ifdef O_NOFOLLOW
+    if ((fd = open(_PAM_LOGFILE, O_WRONLY|O_NOFOLLOW|O_APPEND)) != -1) {
+#else
+    if ((fd = open(_PAM_LOGFILE, O_WRONLY|O_APPEND)) != -1) {
+#endif
+	if (!(logfile = fdopen(fd,"a"))) {
+	    logfile = stderr;
+	    must_close = 0;
+	    close(fd);
+	}
+    } else {
+	logfile = stderr;
+	must_close = 0;
     }
     vfprintf(logfile, format, args);
     fprintf(logfile, "\n");
-    if (must_close) {
-        fflush(logfile);
+    fflush(logfile);
+    if (must_close)
         fclose(logfile);
-    }
 
     va_end(args);
 }
diff -urN Linux-PAM-0.72.bak/libpam/pam_malloc.c Linux-PAM-0.72/libpam/pam_malloc.c
--- Linux-PAM-0.72.bak/libpam/pam_malloc.c	Sat Dec 26 23:34:23 1998
+++ Linux-PAM-0.72/libpam/pam_malloc.c	Tue Dec 14 13:32:35 1999
@@ -87,18 +87,27 @@
 static void _pam_output_xdebug_info(void)
 {
     FILE *logfile;
-    int must_close = 1;
-    
-    if (!(logfile = fopen(_PAM_LOGFILE,"a"))) {
-        logfile = stderr;
-        must_close = 0;
+    int must_close = 1, fd;
+
+#ifdef O_NOFOLLOW
+    if ((fd = open(_PAM_LOGFILE, O_WRONLY|O_NOFOLLOW|O_APPEND)) != -1) {
+#else
+    if ((fd = open(_PAM_LOGFILE, O_WRONLY|O_APPEND)) != -1) {
+#endif
+	if (!(logfile = fdopen(fd,"a"))) {
+	    logfile = stderr;
+	    must_close = 0;
+	    close(fd);
+	}
+    } else {
+	logfile = stderr;
+	must_close = 0;
     }
     fprintf(logfile, "[%s:%s(%d)->%s()] ",
            last_file, last_call, last_line, last_fn);
-    if (must_close) {
-        fflush(logfile);
+    fflush(logfile);
+    if (must_close)
         fclose(logfile);
-    }
 }
 
 static void hinder(void)
diff -urN Linux-PAM-0.72.bak/defs/debian.defs Linux-PAM-0.72/defs/debian.defs
--- Linux-PAM-0.72.bak/defs/debian.defs	Sun Nov 21 17:59:25 1999
+++ Linux-PAM-0.72/defs/debian.defs	Tue Dec 14 13:43:42 1999
@@ -7,7 +7,7 @@
 # installed files on the system.
 ##
 
-CFLAGS	:= -O2 -I${shell pwd}/include # -D__NO_STRING_INLINES
+CFLAGS	:= -O2 -D_GNU_SOURCE -D_REENTRANT
 ifneq (,$(findstring $(DEB_BUILD_OPTIONS),debug DEBUG Debug))
   CFLAGS += -g
 endif
--- Linux-PAM-0.72/modules/pam_tally/pam_tally.c~	Tue Dec 14 12:52:35 1999
+++ Linux-PAM-0.72/modules/pam_tally/pam_tally.c	Tue Dec 14 12:52:29 1999
@@ -70,7 +70,9 @@
 #endif
 
 static struct faillog faillog;
+#ifndef MAIN
 static time_t fail_time;
+#endif
 
 /*---------------------------------------------------------------------*/
 
--- Linux-PAM-0.70/modules/pam_wheel/pam_wheel.c~	Mon Nov  1 13:07:19 1999
+++ Linux-PAM-0.70/modules/pam_wheel/pam_wheel.c	Mon Nov  1 13:13:41 1999
@@ -74,9 +74,8 @@
 /* argument parsing */
 
 #define PAM_DEBUG_ARG       0x0001
-#define PAM_USE_UID_ARG     0x0002
-#define PAM_TRUST_ARG       0x0004
-#define PAM_DENY_ARG        0x0010  
+#define PAM_TRUST_ARG       0x0002
+#define PAM_DENY_ARG        0x0004
 
 static int _pam_parse(int argc, const char **argv)
 {
@@ -89,8 +88,7 @@
 
           if (!strcmp(*argv,"debug"))
                ctrl |= PAM_DEBUG_ARG;
-          else if (!strcmp(*argv,"use_uid"))
-               ctrl |= PAM_USE_UID_ARG;
+          else if (!strcmp(*argv,"use_uid")); /* ignored for compat. */
           else if (!strcmp(*argv,"trust"))
                ctrl |= PAM_TRUST_ARG;
           else if (!strcmp(*argv,"deny"))
@@ -150,22 +148,13 @@
         return PAM_IGNORE;
      }
      
-     if (ctrl & PAM_USE_UID_ARG) {
-         tpwd = getpwuid(getuid());
-         if (!tpwd) {
-            if (ctrl & PAM_DEBUG_ARG)
-                _pam_log(LOG_NOTICE,"who is running me ?!");
-            return PAM_SERVICE_ERR;
-         }
-         fromsu = tpwd->pw_name;
-     } else {
-         fromsu = getlogin();
-         if (!fromsu) {
-             if (ctrl & PAM_DEBUG_ARG)
-                _pam_log(LOG_NOTICE,"who is running me ?!");
-             return PAM_SERVICE_ERR;
-         }
+     tpwd = getpwuid(getuid());
+     if (!tpwd) {
+        if (ctrl & PAM_DEBUG_ARG)
+            _pam_log(LOG_NOTICE,"who is running me ?!");
+        return PAM_SERVICE_ERR;
      }
+     fromsu = tpwd->pw_name;
      
      if (!use_group[0]) {
 	 if ((grp = getgrnam("wheel")) == NULL) {
--- Linux-PAM-0.70/doc/modules/pam_wheel.sgml~	Mon Nov  1 13:13:59 1999
+++ Linux-PAM-0.70/doc/modules/pam_wheel.sgml	Mon Nov  1 13:14:27 1999
@@ -49,7 +49,6 @@
 
 <tag><bf>Recognized arguments:</bf></tag>
 <tt/debug/;
-<tt/use_uid/;
 <tt/trust/;
 <tt/deny/;
 <tt/group=XXXX/
@@ -69,13 +68,6 @@
 <item>
 <tt/debug/ -
 Supply more debugging information to <tt/syslog(3)/.
-
-<item>
-<tt/use_uid/ -
-This option modifies the behavior of the module by using the current
-<tt/uid/ of the process and not the <tt/getlogin(3)/ name of the user.
-This option is useful for being able to jump from one account to
-another, for example with 'su'.
 
 <item>
 <tt/trust/ -
--- Linux-PAM-0.71/doc/modules/pam_cracklib.sgml~	Mon Nov  8 11:51:38 1999
+++ Linux-PAM-0.71/doc/modules/pam_cracklib.sgml	Mon Nov  8 11:53:12 1999
@@ -48,10 +48,6 @@
 <p>
 This module can be plugged into the <tt/password/ stack of a given
 application to provide some plug-in strength-checking for passwords.
-(XXX - note this does not necessarily work with the pam_unix module,
-although it is known to work with the pam_pwdb replacement for the
-unix module -- see example and pam_pwdb write up for more
-information).
 
 <p>
 This module works in the following manner: it first calls the
@@ -213,10 +209,6 @@
 
 <tag><bf>Examples/suggested usage:</bf></tag>
 
-(At the time of writing, this module can only be stacked before the
-<tt/pam_pwdb/ module. Cracklib strength checking may be compiled by
-default into the <tt/pam_unix/ module.)
-
 <p>
 For an example of the use of this module, we show how it may be
 stacked with the password component of <tt/pam_pwdb/:
--- Linux-PAM-0.71/doc/modules/pam_wheel.sgml~	Mon Nov  8 11:55:47 1999
+++ Linux-PAM-0.71/doc/modules/pam_wheel.sgml	Mon Nov  8 11:56:01 1999
@@ -31,7 +31,6 @@
 <tag><bf>Clean code base:</bf></tag>
 
 <tag><bf>System dependencies:</bf></tag>
-Requires libpwdb.
 
 <tag><bf>Network aware:</bf></tag>
 
diff -urN Linux-PAM-0.72.bak/defs/linux.defs Linux-PAM-0.72/defs/linux.defs
--- Linux-PAM-0.72.bak/defs/linux.defs	Sat Jun 19 16:44:09 1999
+++ Linux-PAM-0.72/defs/linux.defs	Tue Dec 14 14:03:14 1999
@@ -10,7 +10,7 @@
 CC=gcc
 INSTALL=install
 MKDIR=mkdir -p
-CFLAGS=-O7 -pipe -g
+CFLAGS=-O7 -pipe -g -D_GNU_SOURCE
 ULIBS=#-lefence
 LD=ld
 LD_D=gcc -shared -Xlinker -x
diff -urN Linux-PAM-0.72.bak/defs/morgan.defs Linux-PAM-0.72/defs/morgan.defs
--- Linux-PAM-0.72.bak/defs/morgan.defs	Sat Jun 19 16:44:09 1999
+++ Linux-PAM-0.72/defs/morgan.defs	Tue Dec 14 14:03:27 1999
@@ -13,7 +13,7 @@
 CC=gcc
 INSTALL=install
 MKDIR=mkdir -p
-CFLAGS=$(RPM_OPT_FLAGS) -pipe -g
+CFLAGS=$(RPM_OPT_FLAGS) -pipe -g -D_GNU_SOURCE
 ULIBS=
 #-lefence
 LD=ld
diff -urN Linux-PAM-0.72.bak/defs/redhat.defs Linux-PAM-0.72/defs/redhat.defs
--- Linux-PAM-0.72.bak/defs/redhat.defs	Thu Jul  8 01:01:39 1999
+++ Linux-PAM-0.72/defs/redhat.defs	Tue Dec 14 14:03:42 1999
@@ -13,7 +13,7 @@
 CC=gcc
 INSTALL=install
 MKDIR=mkdir -p
-CFLAGS=$(RPM_OPT_FLAGS) -pipe -g
+CFLAGS=$(RPM_OPT_FLAGS) -pipe -g -D_GNU_SOURCE
 ULIBS=#-lefence
 LD=ld
 LD_D=gcc -shared -Xlinker -x
diff -urN Linux-PAM-0.72.bak/defs/redhat4.defs Linux-PAM-0.72/defs/redhat4.defs
--- Linux-PAM-0.72.bak/defs/redhat4.defs	Thu Jul  8 01:01:40 1999
+++ Linux-PAM-0.72/defs/redhat4.defs	Tue Dec 14 14:03:55 1999
@@ -13,7 +13,7 @@
 CC=gcc
 INSTALL=install
 MKDIR=mkdir -p
-CFLAGS=$(RPM_OPT_FLAGS) -pipe -g
+CFLAGS=$(RPM_OPT_FLAGS) -pipe -g -D_GNU_SOURCE
 ULIBS=#-lefence
 LD=ld
 LD_D=gcc -shared -Xlinker -x
diff -urN Linux-PAM-0.72.bak/defs/suse.defs Linux-PAM-0.72/defs/suse.defs
--- Linux-PAM-0.72.bak/defs/suse.defs	Fri Oct  8 23:37:59 1999
+++ Linux-PAM-0.72/defs/suse.defs	Tue Dec 14 14:04:39 1999
@@ -13,7 +13,7 @@
 CC=gcc
 INSTALL=install
 MKDIR=mkdir -p
-CFLAGS=$(RPM_OPT_FLAGS) -pipe -D_REENTRANT
+CFLAGS=$(RPM_OPT_FLAGS) -pipe -D_REENTRANT -D_GNU_SOURCE
 ULIBS=#-lefence
 LD=ld
 LD_D=gcc -shared -Xlinker -x
diff -urN Linux-PAM-0.72.bak/libpam/pam_log.c Linux-PAM-0.72/libpam/pam_log.c
--- Linux-PAM-0.72.bak/libpam/pam_log.c	Mon Nov  8 00:41:05 1999
+++ Linux-PAM-0.72/libpam/pam_log.c	Tue Dec 14 13:56:22 1999
@@ -5,13 +5,6 @@
  *
  */
 
-#ifdef linux
-# define _GNU_SOURCE
-# include <features.h>
-#else
-# define _BSD_SOURCE
-#endif
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdarg.h>
diff -urN Linux-PAM-0.72.bak/libpam_misc/misc_conv.c Linux-PAM-0.72/libpam_misc/misc_conv.c
--- Linux-PAM-0.72.bak/libpam_misc/misc_conv.c	Sun Jul  4 19:24:26 1999
+++ Linux-PAM-0.72/libpam_misc/misc_conv.c	Tue Dec 14 13:51:48 1999
@@ -6,11 +6,6 @@
  * Written by Andrew Morgan <morgan@linux.kernel.org>
  */
 
-#ifdef linux
-#define _GNU_SOURCE
-#include <features.h>
-#endif
-
 #include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
diff -urN Linux-PAM-0.72.bak/modules/pam_access/pam_access.c Linux-PAM-0.72/modules/pam_access/pam_access.c
--- Linux-PAM-0.72.bak/modules/pam_access/pam_access.c	Sun Jul 12 01:17:17 1998
+++ Linux-PAM-0.72/modules/pam_access/pam_access.c	Tue Dec 14 13:51:54 1999
@@ -7,11 +7,6 @@
  *
  */
 
-#ifdef linux
-# define _GNU_SOURCE
-# include <features.h>
-#endif
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
diff -urN Linux-PAM-0.72.bak/modules/pam_cracklib/pam_cracklib.c Linux-PAM-0.72/modules/pam_cracklib/pam_cracklib.c
--- Linux-PAM-0.72.bak/modules/pam_cracklib/pam_cracklib.c	Sun Nov 21 21:32:29 1999
+++ Linux-PAM-0.72/modules/pam_cracklib/pam_cracklib.c	Tue Dec 14 13:52:12 1999
@@ -29,9 +29,6 @@
  * S.A.G. in the section on the cracklib module.
  */
 
-#define _GNU_SOURCE
-#define _BSD_SOURCE
-
 #include <stdio.h>
 #ifdef NEED_CRYPT_HEADER
 # include <crypt.h>
diff -urN Linux-PAM-0.72.bak/modules/pam_env/pam_env.c Linux-PAM-0.72/modules/pam_env/pam_env.c
--- Linux-PAM-0.72.bak/modules/pam_env/pam_env.c	Mon Nov  8 00:46:53 1999
+++ Linux-PAM-0.72/modules/pam_env/pam_env.c	Tue Dec 14 13:58:02 1999
@@ -15,10 +15,6 @@
 #define DEFAULT_ETC_ENVFILE     "/etc/environment"
 #define DEFAULT_READ_ENVFILE    1
 
-#define _GNU_SOURCE
-#define _BSD_SOURCE
-
-#include <features.h>
 #include <ctype.h>
 #include <errno.h>
 #include <pwd.h>
diff -urN Linux-PAM-0.72.bak/modules/pam_filter/pam_filter.c Linux-PAM-0.72/modules/pam_filter/pam_filter.c
--- Linux-PAM-0.72.bak/modules/pam_filter/pam_filter.c	Tue Dec 14 13:46:21 1999
+++ Linux-PAM-0.72/modules/pam_filter/pam_filter.c	Tue Dec 14 13:52:29 1999
@@ -5,11 +5,6 @@
  * Richard Stevens' UNIX Network Programming book.
  */
 
-#ifdef linux
-# define _GNU_SOURCE
-# include <features.h>
-#endif
-
 #include <stdlib.h>
 #include <syslog.h>
 #include <unistd.h>
diff -urN Linux-PAM-0.72.bak/modules/pam_filter/upperLOWER/upperLOWER.c Linux-PAM-0.72/modules/pam_filter/upperLOWER/upperLOWER.c
--- Linux-PAM-0.72.bak/modules/pam_filter/upperLOWER/upperLOWER.c	Thu Jul  8 01:01:48 1999
+++ Linux-PAM-0.72/modules/pam_filter/upperLOWER/upperLOWER.c	Tue Dec 14 13:52:37 1999
@@ -18,11 +18,6 @@
  *
  */
 
-#ifdef linux
-# define _GNU_SOURCE
-# include <features.h>
-#endif
-
 #include <stdio.h>
 #include <syslog.h>
 #include <sys/time.h>
diff -urN Linux-PAM-0.72.bak/modules/pam_ftp/pam_ftp.c Linux-PAM-0.72/modules/pam_ftp/pam_ftp.c
--- Linux-PAM-0.72.bak/modules/pam_ftp/pam_ftp.c	Sun Nov 21 21:46:46 1999
+++ Linux-PAM-0.72/modules/pam_ftp/pam_ftp.c	Tue Dec 14 13:58:05 1999
@@ -14,10 +14,6 @@
 /* the following is a password that "can't be correct" */
 #define BLOCK_PASSWORD "\177BAD PASSWPRD\177"
 
-#define _GNU_SOURCE
-#define _BSD_SOURCE
-
-#include <features.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
diff -urN Linux-PAM-0.72.bak/modules/pam_group/pam_group.c Linux-PAM-0.72/modules/pam_group/pam_group.c
--- Linux-PAM-0.72.bak/modules/pam_group/pam_group.c	Sat Oct  9 01:11:31 1999
+++ Linux-PAM-0.72/modules/pam_group/pam_group.c	Tue Dec 14 13:56:57 1999
@@ -11,8 +11,6 @@
 "Version 0.5 for Linux-PAM\n"
 "Copyright (c) Andrew G. Morgan 1996 <morgan@linux.kernel.org>\n";
 
-#define _BSD_SOURCE
-
 #include <sys/file.h>
 #include <stdio.h>
 #include <stdlib.h>
diff -urN Linux-PAM-0.72.bak/modules/pam_issue/pam_issue.c Linux-PAM-0.72/modules/pam_issue/pam_issue.c
--- Linux-PAM-0.72.bak/modules/pam_issue/pam_issue.c	Mon Nov  8 00:44:43 1999
+++ Linux-PAM-0.72/modules/pam_issue/pam_issue.c	Tue Dec 14 13:52:50 1999
@@ -14,9 +14,6 @@
  * Released under the GNU LGPL version 2 or later
  */
 
-#define _GNU_SOURCE
-#define _BSD_SOURCE
-
 #include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
diff -urN Linux-PAM-0.72.bak/modules/pam_lastlog/pam_lastlog.c Linux-PAM-0.72/modules/pam_lastlog/pam_lastlog.c
--- Linux-PAM-0.72.bak/modules/pam_lastlog/pam_lastlog.c	Thu Jul  8 01:01:51 1999
+++ Linux-PAM-0.72/modules/pam_lastlog/pam_lastlog.c	Tue Dec 14 13:52:56 1999
@@ -10,11 +10,6 @@
  * present (login) service.
  */
 
-#ifdef linux
-# define _GNU_SOURCE
-# include <features.h>
-#endif
-
 #include <fcntl.h>
 #include <time.h>
 #ifdef HAVE_UTMP_H
diff -urN Linux-PAM-0.72.bak/modules/pam_limits/pam_limits.c Linux-PAM-0.72/modules/pam_limits/pam_limits.c
--- Linux-PAM-0.72.bak/modules/pam_limits/pam_limits.c	Tue Dec 14 13:46:21 1999
+++ Linux-PAM-0.72/modules/pam_limits/pam_limits.c	Tue Dec 14 13:58:22 1999
@@ -17,16 +17,8 @@
 #error THIS CODE IS KNOWN TO WORK ONLY ON LINUX !!!
 #endif 
 
-#define _GNU_SOURCE
-#define _BSD_SOURCE
-
-#include <features.h>
-
 #include <stdio.h>
 #include <unistd.h>
-#ifndef __USE_POSIX2
-#define __USE_POSIX2
-#endif /* __USE_POSIX2 */
 #include <string.h>
 #include <ctype.h>
 #include <stdlib.h>
diff -urN Linux-PAM-0.72.bak/modules/pam_listfile/pam_listfile.c Linux-PAM-0.72/modules/pam_listfile/pam_listfile.c
--- Linux-PAM-0.72.bak/modules/pam_listfile/pam_listfile.c	Tue Dec 14 13:46:21 1999
+++ Linux-PAM-0.72/modules/pam_listfile/pam_listfile.c	Tue Dec 14 13:53:29 1999
@@ -10,16 +10,6 @@
  * This code began life as the pam_rootok module.
  */
 
-#ifdef linux
-# define _SVID_SOURCE
-# define _BSD_SOURCE
-# define __USE_BSD
-# define __USE_SVID
-# define __USE_MISC
-# define _GNU_SOURCE
-# include <features.h>
-#endif
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/types.h>
diff -urN Linux-PAM-0.72.bak/modules/pam_mail/pam_mail.c Linux-PAM-0.72/modules/pam_mail/pam_mail.c
--- Linux-PAM-0.72.bak/modules/pam_mail/pam_mail.c	Sun Nov 21 21:15:45 1999
+++ Linux-PAM-0.72/modules/pam_mail/pam_mail.c	Tue Dec 14 13:53:36 1999
@@ -16,13 +16,6 @@
 #define YOUR_MAIL_STANDARD_FORMAT "You have %smail."
 #define NO_MAIL_STANDARD_FORMAT   "No mail." 
 
-#define _BSD_SOURCE
-
-#ifdef linux
-# define _GNU_SOURCE
-# include <features.h>
-#endif
-
 #include <ctype.h>
 #include <pwd.h>
 #include <stdarg.h>
diff -urN Linux-PAM-0.72.bak/modules/pam_mkhomedir/pam_mkhomedir.c Linux-PAM-0.72/modules/pam_mkhomedir/pam_mkhomedir.c
--- Linux-PAM-0.72.bak/modules/pam_mkhomedir/pam_mkhomedir.c	Mon Nov  8 00:45:36 1999
+++ Linux-PAM-0.72/modules/pam_mkhomedir/pam_mkhomedir.c	Tue Dec 14 13:53:49 1999
@@ -27,8 +27,6 @@
      <morgan@parc.power.net> 1996
  */
 
-/* I want snprintf dammit */
-#define _GNU_SOURCE 1
 #include <stdarg.h>
 #include <sys/types.h>
 #include <sys/stat.h>
diff -urN Linux-PAM-0.72.bak/modules/pam_pwdb/pam_pwdb.c Linux-PAM-0.72/modules/pam_pwdb/pam_pwdb.c
--- Linux-PAM-0.72.bak/modules/pam_pwdb/pam_pwdb.c	Thu Jul  8 01:02:02 1999
+++ Linux-PAM-0.72/modules/pam_pwdb/pam_pwdb.c	Tue Dec 14 13:54:00 1999
@@ -20,15 +20,6 @@
 
 /* #define DEBUG */
 
-#define _SVID_SOURCE
-#define _BSD_SOURCE
-#define _BSD_COMPAT
-
-#ifdef linux
-# define _GNU_SOURCE
-# include <features.h>
-#endif
-
 #include <sys/types.h>
 #include <stdarg.h>
 #include <stdlib.h>
diff -urN Linux-PAM-0.72.bak/modules/pam_pwdb/pwdb_chkpwd.c Linux-PAM-0.72/modules/pam_pwdb/pwdb_chkpwd.c
--- Linux-PAM-0.72.bak/modules/pam_pwdb/pwdb_chkpwd.c	Sun Nov 21 21:53:46 1999
+++ Linux-PAM-0.72/modules/pam_pwdb/pwdb_chkpwd.c	Tue Dec 14 13:54:06 1999
@@ -13,13 +13,6 @@
  *
  */
 
-#define _BSD_SOURCE
-
-#ifdef linux
-# define _GNU_SOURCE
-# include <features.h>
-#endif
-
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
diff -urN Linux-PAM-0.72.bak/modules/pam_radius/pam_radius.h Linux-PAM-0.72/modules/pam_radius/pam_radius.h
--- Linux-PAM-0.72.bak/modules/pam_radius/pam_radius.h	Thu Jul  8 01:02:05 1999
+++ Linux-PAM-0.72/modules/pam_radius/pam_radius.h	Tue Dec 14 13:59:24 1999
@@ -2,15 +2,7 @@
 #ifndef PAM_RADIUS_H
 #define PAM_RADIUS_H
 
-#define _GNU_SOURCE
-#include <features.h>
-
 #include <stdio.h>
-
-#ifndef __USE_POSIX2
-#define __USE_POSIX2
-#endif /* __USE_POSIX2 */
-
 #include <stdlib.h>
 
 #include <sys/types.h>
diff -urN Linux-PAM-0.72.bak/modules/pam_rootok/pam_rootok.c Linux-PAM-0.72/modules/pam_rootok/pam_rootok.c
--- Linux-PAM-0.72.bak/modules/pam_rootok/pam_rootok.c	Sat Oct  9 01:16:14 1999
+++ Linux-PAM-0.72/modules/pam_rootok/pam_rootok.c	Tue Dec 14 13:54:50 1999
@@ -6,8 +6,6 @@
  * Written by Andrew Morgan <morgan@linux.kernel.org> 1996/3/11
  */
 
-#define _GNU_SOURCE
-
 #include <stdio.h>
 #include <unistd.h>
 #include <syslog.h>
diff -urN Linux-PAM-0.72.bak/modules/pam_securetty/pam_securetty.c Linux-PAM-0.72/modules/pam_securetty/pam_securetty.c
--- Linux-PAM-0.72.bak/modules/pam_securetty/pam_securetty.c	Tue Dec 14 13:46:21 1999
+++ Linux-PAM-0.72/modules/pam_securetty/pam_securetty.c	Tue Dec 14 13:54:56 1999
@@ -10,8 +10,6 @@
  * Slight modifications AGM. 1996/12/3
  */
 
-#define _GNU_SOURCE
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/types.h>
diff -urN Linux-PAM-0.72.bak/modules/pam_shells/pam_shells.c Linux-PAM-0.72/modules/pam_shells/pam_shells.c
--- Linux-PAM-0.72.bak/modules/pam_shells/pam_shells.c	Sat Oct  9 01:16:38 1999
+++ Linux-PAM-0.72/modules/pam_shells/pam_shells.c	Tue Dec 14 13:57:01 1999
@@ -8,8 +8,6 @@
  * This code shamelessly ripped from the pam_securetty module.
  */
 
-#define _BSD_SOURCE
-
 #include <pwd.h>
 #include <stdarg.h>
 #include <stdio.h>
diff -urN Linux-PAM-0.72.bak/modules/pam_stress/pam_stress.c Linux-PAM-0.72/modules/pam_stress/pam_stress.c
--- Linux-PAM-0.72.bak/modules/pam_stress/pam_stress.c	Thu Jul  8 01:02:06 1999
+++ Linux-PAM-0.72/modules/pam_stress/pam_stress.c	Tue Dec 14 13:55:03 1999
@@ -5,11 +5,6 @@
  * created by Andrew Morgan <morgan@linux.kernel.org> 1996/3/12
  */
 
-#ifdef linux
-# define _GNU_SOURCE
-# include <features.h>
-#endif
-
 #include <stdlib.h>
 #include <stdio.h>
 #include <syslog.h>
diff -urN Linux-PAM-0.72.bak/modules/pam_tally/pam_tally.c Linux-PAM-0.72/modules/pam_tally/pam_tally.c
--- Linux-PAM-0.72.bak/modules/pam_tally/pam_tally.c	Tue Dec 14 13:46:21 1999
+++ Linux-PAM-0.72/modules/pam_tally/pam_tally.c	Tue Dec 14 13:55:11 1999
@@ -11,11 +11,6 @@
  * Stuff stolen from pam_rootok and pam_listfile
  */
 
-#ifdef linux
-# define _GNU_SOURCE
-# include <features.h>
-#endif
-
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
diff -urN Linux-PAM-0.72.bak/modules/pam_time/pam_time.c Linux-PAM-0.72/modules/pam_time/pam_time.c
--- Linux-PAM-0.72.bak/modules/pam_time/pam_time.c	Thu Jul  8 01:02:08 1999
+++ Linux-PAM-0.72/modules/pam_time/pam_time.c	Tue Dec 14 13:55:17 1999
@@ -13,11 +13,6 @@
 "\t\tVersion 0.22 for Linux-PAM\n"
 "Copyright (C) Andrew G. Morgan 1996 <morgan@linux.kernel.org>\n";
 
-#ifdef linux
-# define _GNU_SOURCE
-# include <features.h>
-#endif
-
 #include <sys/file.h>
 #include <stdio.h>
 #include <stdlib.h>
diff -urN Linux-PAM-0.72.bak/modules/pam_unix/pam_unix_acct.c Linux-PAM-0.72/modules/pam_unix/pam_unix_acct.c
--- Linux-PAM-0.72.bak/modules/pam_unix/pam_unix_acct.c	Tue Dec 14 13:46:21 1999
+++ Linux-PAM-0.72/modules/pam_unix/pam_unix_acct.c	Tue Dec 14 13:55:24 1999
@@ -34,13 +34,6 @@
  * OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#define _BSD_SOURCE
-
-#ifdef linux
-#define _GNU_SOURCE
-#include <features.h>
-#endif
-
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
diff -urN Linux-PAM-0.72.bak/modules/pam_unix/pam_unix_auth.c Linux-PAM-0.72/modules/pam_unix/pam_unix_auth.c
--- Linux-PAM-0.72.bak/modules/pam_unix/pam_unix_auth.c	Sat Oct  9 01:07:32 1999
+++ Linux-PAM-0.72/modules/pam_unix/pam_unix_auth.c	Tue Dec 14 13:55:32 1999
@@ -37,11 +37,6 @@
 
 /* #define DEBUG */
 
-#ifdef linux
-#define _GNU_SOURCE
-#include <features.h>
-#endif
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdarg.h>
diff -urN Linux-PAM-0.72.bak/modules/pam_unix/pam_unix_passwd.c Linux-PAM-0.72/modules/pam_unix/pam_unix_passwd.c
--- Linux-PAM-0.72.bak/modules/pam_unix/pam_unix_passwd.c	Tue Dec 14 13:46:21 1999
+++ Linux-PAM-0.72/modules/pam_unix/pam_unix_passwd.c	Tue Dec 14 13:55:40 1999
@@ -35,14 +35,6 @@
  * OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#define _BSD_SOURCE
-#define __USE_SVID
-
-#ifdef linux
-#define _GNU_SOURCE
-#include <features.h>
-#endif
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdarg.h>
diff -urN Linux-PAM-0.72.bak/modules/pam_unix/pam_unix_sess.c Linux-PAM-0.72/modules/pam_unix/pam_unix_sess.c
--- Linux-PAM-0.72.bak/modules/pam_unix/pam_unix_sess.c	Sat Oct  9 01:07:32 1999
+++ Linux-PAM-0.72/modules/pam_unix/pam_unix_sess.c	Tue Dec 14 13:55:46 1999
@@ -34,11 +34,6 @@
  * OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifdef linux
-#define _GNU_SOURCE
-#include <features.h>
-#endif
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdarg.h>
diff -urN Linux-PAM-0.72.bak/modules/pam_unix/support.c Linux-PAM-0.72/modules/pam_unix/support.c
--- Linux-PAM-0.72.bak/modules/pam_unix/support.c	Sat Oct  9 01:07:32 1999
+++ Linux-PAM-0.72/modules/pam_unix/support.c	Tue Dec 14 13:57:05 1999
@@ -4,8 +4,6 @@
  * Copyright information at end of file.
  */
 
-#define _BSD_SOURCE
-
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdarg.h>
diff -urN Linux-PAM-0.72.bak/modules/pam_unix/unix_chkpwd.c Linux-PAM-0.72/modules/pam_unix/unix_chkpwd.c
--- Linux-PAM-0.72.bak/modules/pam_unix/unix_chkpwd.c	Thu Jul  8 01:02:11 1999
+++ Linux-PAM-0.72/modules/pam_unix/unix_chkpwd.c	Tue Dec 14 13:55:51 1999
@@ -13,12 +13,6 @@
  *
  */
 
-#define _BSD_SOURCE
-#ifdef linux
-# define _GNU_SOURCE
-# include <features.h>
-#endif
-
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
diff -urN Linux-PAM-0.72.bak/modules/pam_unix/yppasswd_xdr.c Linux-PAM-0.72/modules/pam_unix/yppasswd_xdr.c
--- Linux-PAM-0.72.bak/modules/pam_unix/yppasswd_xdr.c	Thu Jul  8 01:02:12 1999
+++ Linux-PAM-0.72/modules/pam_unix/yppasswd_xdr.c	Tue Dec 14 13:55:56 1999
@@ -10,11 +10,6 @@
  * editied manually.
  */
 
-#ifdef linux
-# define _GNU_SOURCE
-# include <features.h>
-#endif
-
 #include <rpc/rpc.h>
 #include <rpcsvc/yp_prot.h>
 #include <rpcsvc/ypclnt.h>
diff -urN Linux-PAM-0.72.bak/modules/pam_userdb/conv.c Linux-PAM-0.72/modules/pam_userdb/conv.c
--- Linux-PAM-0.72.bak/modules/pam_userdb/conv.c	Sun Nov 21 21:19:01 1999
+++ Linux-PAM-0.72/modules/pam_userdb/conv.c	Tue Dec 14 13:57:09 1999
@@ -5,8 +5,6 @@
 /* $Id */
 /* Copyright at the end of the file */
 
-#define _BSD_SOURCE
-
 #include <stdlib.h>
 #include <string.h>
 
diff -urN Linux-PAM-0.72.bak/modules/pam_userdb/pam_userdb.c Linux-PAM-0.72/modules/pam_userdb/pam_userdb.c
--- Linux-PAM-0.72.bak/modules/pam_userdb/pam_userdb.c	Sun Nov 21 21:19:01 1999
+++ Linux-PAM-0.72/modules/pam_userdb/pam_userdb.c	Tue Dec 14 13:56:02 1999
@@ -6,10 +6,6 @@
  * See the end of the file for Copyright Information
  */
 
-#define _GNU_SOURCE
-#define _BSD_SOURCE
-
-#include <features.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
diff -urN Linux-PAM-0.72.bak/modules/pam_warn/pam_warn.c Linux-PAM-0.72/modules/pam_warn/pam_warn.c
--- Linux-PAM-0.72.bak/modules/pam_warn/pam_warn.c	Sun Nov 21 21:16:56 1999
+++ Linux-PAM-0.72/modules/pam_warn/pam_warn.c	Tue Dec 14 13:57:13 1999
@@ -6,8 +6,6 @@
  * Written by Andrew Morgan <morgan@linux.kernel.org> 1996/3/11
  */
 
-#define _BSD_SOURCE
-
 #include <stdio.h>
 #include <unistd.h>
 #include <syslog.h>
diff -urN Linux-PAM-0.72.bak/modules/pam_wheel/pam_wheel.c Linux-PAM-0.72/modules/pam_wheel/pam_wheel.c
--- Linux-PAM-0.72.bak/modules/pam_wheel/pam_wheel.c	Tue Dec 14 13:46:21 1999
+++ Linux-PAM-0.72/modules/pam_wheel/pam_wheel.c	Tue Dec 14 13:57:33 1999
@@ -21,8 +21,6 @@
  *    a wheel member.
  */
 
-#define _BSD_SOURCE
-
 #include <stdio.h>
 #include <unistd.h>
 #include <string.h>
diff -urN Linux-PAM-0.72.bak/modules/pam_rhosts/Makefile Linux-PAM-0.72/modules/pam_rhosts/Makefile
--- Linux-PAM-0.72.bak/modules/pam_rhosts/Makefile	Tue Dec 14 16:13:59 1999
+++ Linux-PAM-0.72/modules/pam_rhosts/Makefile	Tue Dec 14 16:20:47 1999
@@ -24,7 +24,13 @@
 endif
 
 ifeq ($(shell if [ -f /usr/include/fsuid.h ]; then echo yes ; fi),yes)
- CFLAGS += -DNEED_FSUID_H
+ CFLAGS += -DHAVE_FSUID_H
+endif
+ifeq ($(shell if [ -f /usr/include/sys/fsuid.h ]; then echo yes ; fi),yes)
+ CFLAGS += -DHAVE_SYS_FSUID_H -D_GNU_SOURCE
+endif
+ifeq ($(shell if [ -f /usr/include/endian.h ]; then echo yes ; fi),yes)
+ CFLAGS += -DHAVE_ENDIAN_H
 endif
 
 ####################### don't edit below #######################
diff -urN Linux-PAM-0.72.bak/modules/pam_rhosts/pam_rhosts_auth.c Linux-PAM-0.72/modules/pam_rhosts/pam_rhosts_auth.c
--- Linux-PAM-0.72.bak/modules/pam_rhosts/pam_rhosts_auth.c	Tue Dec 14 16:18:39 1999
+++ Linux-PAM-0.72/modules/pam_rhosts/pam_rhosts_auth.c	Tue Dec 14 16:24:56 1999
@@ -38,17 +38,15 @@
  * SUCH DAMAGE.
  */
 
-#define _BSD_SOURCE
-
 #define USER_RHOSTS_FILE "/.rhosts"     /* prefixed by user's home dir */
 
-#ifdef linux
+#ifdef HAVE_ENDIAN_H
 #include <endian.h>
 #endif
 
-#ifdef NEED_FSUID_H
+#ifdef HAVE_FSUID_H
 #include <sys/fsuid.h>
-#endif /* NEED_FSUID_H */
+#endif
 
 #include <sys/types.h>
 #include <sys/uio.h>
@@ -74,12 +72,8 @@
 #include <ctype.h>
 
 #include <net/if.h>
-#ifdef linux
-# include <linux/sockios.h>
-# ifndef __USE_MISC
-#  define __USE_MISC
-#  include <sys/fsuid.h>
-# endif /* __USE_MISC */
+#ifdef HAVE_SYS_FSUID_H
+#include <sys/fsuid.h>
 #endif
 
 #include <pwd.h>

Attachment: pgp00000.pgp
Description: PGP signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []