source:
clfs-sysroot/patches/shadow-4.0.18.1-sysroot_hacks-1.patch@
f1f6d91
Last change on this file since f1f6d91 was 1d53724, checked in by , 18 years ago | |
---|---|
|
|
File size: 14.3 KB |
-
lib/Makefile.am
Submitted By: Joe Ciccone <jciccone@linuxfromscratch.org> Date: 2006-11-24 Initial Package Version: 4.0.18.1 Origin: Joe Ciccone Upstream Status: None Description: Changes the hardcoded /etc to the value of the --sysconfdir parameter passed to configure. Allows the utilities to be run as a user other then root and properly modify the passwd and group files for the target system. diff -Naur shadow-4.0.18.1.orig/lib/Makefile.am shadow-4.0.18.1/lib/Makefile.am
old new 2 2 AUTOMAKE_OPTIONS = 1.0 foreign 3 3 4 4 DEFS = 5 AM_CPPFLAGS = -DSYSCONFDIR=\"$(sysconfdir)\" 5 6 6 7 lib_LTLIBRARIES = libshadow.la 7 8 -
lib/Makefile.in
diff -Naur shadow-4.0.18.1.orig/lib/Makefile.in shadow-4.0.18.1/lib/Makefile.in
old new 217 217 sharedstatedir = @sharedstatedir@ 218 218 sysconfdir = @sysconfdir@ 219 219 target_alias = @target_alias@ 220 AM_CPPFLAGS = -DSYSCONFDIR=\"$(sysconfdir)\" 220 221 AUTOMAKE_OPTIONS = 1.0 foreign 221 222 lib_LTLIBRARIES = libshadow.la 222 223 libshadow_la_LDFLAGS = -version-info 0:0:0 -
lib/commonio.c
diff -Naur shadow-4.0.18.1.orig/lib/commonio.c shadow-4.0.18.1/lib/commonio.c
old new 153 153 if (!fp) 154 154 return NULL; 155 155 156 #ifdef HAVE_FCHOWN157 if (fchown (fileno (fp), sb->st_uid, sb->st_gid))158 goto fail;159 #else160 if (chown (name, sb->st_mode))161 goto fail;162 #endif163 164 156 #ifdef HAVE_FCHMOD 165 157 if (fchmod (fileno (fp), sb->st_mode & 0664)) 166 158 goto fail; … … 703 695 * Default permissions for new [g]shadow files. 704 696 * (passwd and group always exist...) 705 697 */ 706 sb.st_mode = 0 400;698 sb.st_mode = 0600; 707 699 sb.st_uid = 0; 708 700 sb.st_gid = 0; 709 701 } -
shadow-4.0.18.1
diff -Naur shadow-4.0.18.1.orig/lib/defines.h shadow-4.0.18.1/lib/defines.h
old new 284 284 #endif 285 285 286 286 #ifndef PASSWD_FILE 287 #define PASSWD_FILE "/etc/passwd"287 #define PASSWD_FILE SYSCONFDIR"/passwd" 288 288 #endif 289 289 290 290 #ifndef GROUP_FILE 291 #define GROUP_FILE "/etc/group"291 #define GROUP_FILE SYSCONFDIR"/group" 292 292 #endif 293 293 294 294 #ifndef SHADOW_FILE 295 #define SHADOW_FILE "/etc/shadow"295 #define SHADOW_FILE SYSCONFDIR"/shadow" 296 296 #endif 297 297 298 298 #ifdef SHADOWGRP 299 299 #ifndef SGROUP_FILE 300 #define SGROUP_FILE "/etc/gshadow"300 #define SGROUP_FILE SYSCONFDIR"/gshadow" 301 301 #endif 302 302 #endif 303 303 -
shadow-4.0.18.1
diff -Naur shadow-4.0.18.1.orig/lib/getdef.c shadow-4.0.18.1/lib/getdef.c
old new 114 114 }; 115 115 116 116 #ifndef LOGINDEFS 117 #define LOGINDEFS "/etc/login.defs"117 #define LOGINDEFS SYSCONFDIR"/login.defs" 118 118 #endif 119 119 120 120 static char def_fname[] = LOGINDEFS; /* login config defs file */ -
lib/gshadow_.h
diff -Naur shadow-4.0.18.1.orig/lib/gshadow_.h shadow-4.0.18.1/lib/gshadow_.h
old new 67 67 int putsgent (); 68 68 #endif 69 69 70 #define GSHADOW "/etc/gshadow"70 #define GSHADOW SYSCONFDIR"/gshadow" 71 71 #endif /* ifndef _H_GSHADOW */ -
shadow-4.0.18.1
diff -Naur shadow-4.0.18.1.orig/lib/port.h shadow-4.0.18.1/lib/port.h
old new 50 50 * PORT_DAY - Day of the week to a bit value (0 = Sunday). 51 51 */ 52 52 53 #define PORTS "/etc/porttime"53 #define PORTS SYSCONFDIR"/porttime" 54 54 #define PORT_IDS 64 55 55 #define PORT_TTY 64 56 56 #define PORT_TIMES 24 -
libmisc/Makefile.am
diff -Naur shadow-4.0.18.1.orig/libmisc/Makefile.am shadow-4.0.18.1/libmisc/Makefile.am
old new 1 1 2 2 EXTRA_DOST = .indent.pro 3 3 4 AM_CPPFLAGS = -DSYSCONFDIR=\"$(sysconfdir)\" 5 4 6 INCLUDES = -I$(top_srcdir)/lib 5 7 6 8 noinst_LIBRARIES = libmisc.a -
libmisc/Makefile.in
diff -Naur shadow-4.0.18.1.orig/libmisc/Makefile.in shadow-4.0.18.1/libmisc/Makefile.in
old new 224 224 target_alias = @target_alias@ 225 225 EXTRA_DOST = .indent.pro 226 226 INCLUDES = -I$(top_srcdir)/lib 227 AM_CPPFLAGS = -DSYSCONFDIR=\"$(sysconfdir)\" 227 228 noinst_LIBRARIES = libmisc.a 228 229 libmisc_a_SOURCES = \ 229 230 addgrps.c \ -
libmisc/limits.c
diff -Naur shadow-4.0.18.1.orig/libmisc/limits.c shadow-4.0.18.1/libmisc/limits.c
old new 51 51 #endif 52 52 #ifdef LIMITS 53 53 #ifndef LIMITS_FILE 54 #define LIMITS_FILE "/etc/limits"54 #define LIMITS_FILE SYSCONFDIR"/limits" 55 55 #endif 56 56 #define LOGIN_ERROR_RLIMIT 1 57 57 #define LOGIN_ERROR_LOGIN 2 -
src/Makefile.am
diff -Naur shadow-4.0.18.1.orig/src/Makefile.am shadow-4.0.18.1/src/Makefile.am
old new 3 3 .indent.pro 4 4 5 5 ubindir = ${prefix}/bin 6 usbindir = ${prefix}/ sbin6 usbindir = ${prefix}/bin 7 7 8 8 INCLUDES = \ 9 9 -I${top_srcdir}/lib \ … … 51 51 52 52 LDADD = $(top_builddir)/libmisc/libmisc.a \ 53 53 $(top_builddir)/lib/libshadow.la 54 AM_CPPFLAGS = -D LOCALEDIR=\"$(datadir)/locale\"54 AM_CPPFLAGS = -DSYSCONFDIR=\"$(sysconfdir)\" -DLOCALEDIR=\"$(datadir)/locale\" -DSG=\"`echo sg | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`\" -DVIGR=\"`echo vigr | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`\" 55 55 56 56 chage_LDADD = $(LDADD) $(LIBPAM) $(LIBAUDIT) $(LIBSELINUX) 57 57 chfn_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX) … … 88 88 89 89 install-am: all-am 90 90 $(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 91 ln -sf newgrp $(DESTDIR)$(ubindir)/sg92 ln -sf vipw $(DESTDIR)$(usbindir)/vigr91 ln -sf `echo newgrp | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` $(DESTDIR)$(ubindir)/`echo sg | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` 92 ln -sf `echo vipw | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` $(DESTDIR)$(usbindir)/`echo vigr | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` 93 93 for i in $(suidbins); do \ 94 chmod -f 4755 $(DESTDIR)$(bindir)/ $$i; \94 chmod -f 4755 $(DESTDIR)$(bindir)/`echo $$i | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ 95 95 done 96 96 for i in $(suidubins); do \ 97 chmod -f 4755 $(DESTDIR)$(ubindir)/ $$i; \97 chmod -f 4755 $(DESTDIR)$(ubindir)/`echo $$i | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ 98 98 done 99 -
src/Makefile.in
diff -Naur shadow-4.0.18.1.orig/src/Makefile.in shadow-4.0.18.1/src/Makefile.in
old new 368 368 .indent.pro 369 369 370 370 ubindir = ${prefix}/bin 371 usbindir = ${prefix}/ sbin371 usbindir = ${prefix}/bin 372 372 INCLUDES = \ 373 373 -I${top_srcdir}/lib \ 374 374 -I$(top_srcdir)/libmisc … … 378 378 LDADD = $(top_builddir)/libmisc/libmisc.a \ 379 379 $(top_builddir)/lib/libshadow.la 380 380 381 AM_CPPFLAGS = -D LOCALEDIR=\"$(datadir)/locale\"381 AM_CPPFLAGS = -DSYSCONFDIR=\"$(sysconfdir)\" -DLOCALEDIR=\"$(datadir)/locale\" -DSG=\"`echo sg | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`\" -DVIGR=\"`echo vigr | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`\" 382 382 chage_LDADD = $(LDADD) $(LIBPAM) $(LIBAUDIT) $(LIBSELINUX) 383 383 chfn_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX) 384 384 chgpasswd_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX) … … 914 914 915 915 install-am: all-am 916 916 $(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 917 ln -sf newgrp $(DESTDIR)$(ubindir)/sg918 ln -sf vipw $(DESTDIR)$(usbindir)/vigr917 ln -sf `echo newgrp | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` $(DESTDIR)$(ubindir)/`echo sg | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` 918 ln -sf `echo vipw | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` $(DESTDIR)$(usbindir)/`echo vigr | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` 919 919 for i in $(suidbins); do \ 920 chmod -f 4755 $(DESTDIR)$(bindir)/ $$i; \920 chmod -f 4755 $(DESTDIR)$(bindir)/`echo $$i | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ 921 921 done 922 922 for i in $(suidubins); do \ 923 chmod -f 4755 $(DESTDIR)$(ubindir)/ $$i; \923 chmod -f 4755 $(DESTDIR)$(ubindir)/`echo $$i | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ 924 924 done 925 925 926 # Tell versions [3.59,3.63) of GNU make to not export all variables. 926 927 # Otherwise a system limit (for SysV at least) may be exceeded. 927 928 .NOEXPORT: -
shadow-4.0.18.1
diff -Naur shadow-4.0.18.1.orig/src/chage.c shadow-4.0.18.1/src/chage.c
old new 361 361 textdomain (PACKAGE); 362 362 363 363 ruid = getuid (); 364 amroot = (ruid == 0);364 amroot = 1; //(ruid == 0); 365 365 #ifdef WITH_SELINUX 366 366 if (amroot && is_selinux_enabled () > 0) 367 367 amroot = (selinux_check_passwd_access (PASSWD__ROOTOK) == 0); -
shadow-4.0.18.1
diff -Naur shadow-4.0.18.1.orig/src/chsh.c shadow-4.0.18.1/src/chsh.c
old new 55 55 #include "pam_defs.h" 56 56 #endif 57 57 #ifndef SHELLS_FILE 58 #define SHELLS_FILE "/etc/shells"58 #define SHELLS_FILE SYSCONFDIR"/shells" 59 59 #endif 60 60 /* 61 61 * Global variables … … 195 195 /* 196 196 * This command behaves different for root and non-root users. 197 197 */ 198 amroot = getuid () == 0;198 amroot = 1; //getuid () == 0; 199 199 200 200 /* 201 201 * Get the program name. The program name is used as a prefix to -
shadow-4.0.18.1
diff -Naur shadow-4.0.18.1.orig/src/gpasswd.c shadow-4.0.18.1/src/gpasswd.c
old new 202 202 * prevent the invoker from issuing signals which would interfer 203 203 * with this command. 204 204 */ 205 amroot = getuid () == 0;205 amroot = 1; //getuid () == 0; 206 206 bywho = getuid (); 207 207 Prog = Basename (argv[0]); 208 208 … … 628 628 * output, etc. 629 629 */ 630 630 output: 631 if (setuid (0)) {632 fprintf (stderr, _("Cannot change ID to root.\n"));633 SYSLOG ((LOG_ERR, "can't setuid(0)"));634 #ifdef WITH_AUDIT635 audit_logger (AUDIT_USER_CHAUTHTOK, Prog, "changing id to root",636 group, -1, 0);637 #endif638 closelog ();639 exit (1);640 }641 631 pwd_init (); 642 632 643 633 if (!gr_lock ()) { -
src/login_nopam.c
diff -Naur shadow-4.0.18.1.orig/src/login_nopam.c shadow-4.0.18.1/src/login_nopam.c
old new 60 60 /* Path name of the access control file. */ 61 61 62 62 #ifndef TABLE 63 #define TABLE "/etc/login.access"63 #define TABLE SYSCONFDIR"/login.access" 64 64 #endif 65 65 66 66 /* Delimiters for fields and for lists of users, ttys or hosts. */ -
shadow-4.0.18.1
diff -Naur shadow-4.0.18.1.orig/src/logoutd.c shadow-4.0.18.1/src/logoutd.c
old new 48 48 #endif 49 49 50 50 #ifndef HUP_MESG_FILE 51 #define HUP_MESG_FILE "/etc/logoutd.mesg"51 #define HUP_MESG_FILE SYSCONFDIR"/logoutd.mesg" 52 52 #endif 53 53 54 54 #if HAVE_UTMPX_H -
shadow-4.0.18.1
diff -Naur shadow-4.0.18.1.orig/src/newgrp.c shadow-4.0.18.1/src/newgrp.c
old new 153 153 */ 154 154 Prog = Basename (argv[0]); 155 155 is_newgrp = (strcmp (Prog, "newgrp") == 0); 156 OPENLOG (is_newgrp ? "newgrp" : "sg");156 OPENLOG (is_newgrp ? "newgrp" : SG); 157 157 gid = getgid (); 158 158 argc--; 159 159 argv++; … … 466 466 if (child < 0) { 467 467 /* error in fork() */ 468 468 fprintf (stderr, _("%s: failure forking: %s"), 469 is_newgrp ? "newgrp" : "sg", strerror (errno));469 is_newgrp ? "newgrp" : SG, strerror (errno)); 470 470 #ifdef WITH_AUDIT 471 471 audit_logger (AUDIT_USER_START, Prog, "changing", 472 472 NULL, getuid (), 0); -
shadow-4.0.18.1
diff -Naur shadow-4.0.18.1.orig/src/passwd.c shadow-4.0.18.1/src/passwd.c
old new 614 614 * The program behaves differently when executed by root than when 615 615 * executed by a normal user. 616 616 */ 617 amroot = (getuid () == 0);617 amroot = 1; //(getuid () == 0); 618 618 619 619 /* 620 620 * Get the program name. The program name is used as a prefix to … … 878 878 exit (E_SUCCESS); 879 879 } 880 880 #endif /* USE_PAM */ 881 if (setuid (0)) {882 fprintf (stderr, _("Cannot change ID to root.\n"));883 SYSLOG ((LOG_ERR, "can't setuid(0)"));884 closelog ();885 exit (E_NOPERM);886 }887 881 if (spw_file_present ()) 888 882 update_shadow (); 889 883 else -
shadow-4.0.18.1
diff -Naur shadow-4.0.18.1.orig/src/suauth.c shadow-4.0.18.1/src/suauth.c
old new 8 8 #include "prototypes.h" 9 9 10 10 #ifndef SUAUTHFILE 11 #define SUAUTHFILE "/etc/suauth"11 #define SUAUTHFILE SYSCONFDIR"/suauth" 12 12 #endif 13 13 14 14 #define NOACTION 0 -
shadow-4.0.18.1
diff -Naur shadow-4.0.18.1.orig/src/useradd.c shadow-4.0.18.1/src/useradd.c
old new 60 60 #include "shadowio.h" 61 61 62 62 #ifndef SKEL_DIR 63 #define SKEL_DIR "/etc/skel"63 #define SKEL_DIR SYSCONFDIR"/skel" 64 64 #endif 65 65 #ifndef USER_DEFAULTS_FILE 66 #define USER_DEFAULTS_FILE "/etc/default/useradd"67 #define NEW_USER_FILE "/etc/default/nuaddXXXXXX"66 #define USER_DEFAULTS_FILE SYSCONFDIR"/default/useradd" 67 #define NEW_USER_FILE SYSCONFDIR"/default/nuaddXXXXXX" 68 68 #endif 69 69 /* 70 70 * Needed for MkLinux DR1/2/2.1 - J. -
shadow-4.0.18.1
diff -Naur shadow-4.0.18.1.orig/src/vipw.c shadow-4.0.18.1/src/vipw.c
old new 245 245 textdomain (PACKAGE); 246 246 247 247 progname = ((a = strrchr (*argv, '/')) ? a + 1 : *argv); 248 do_vipw = (strcmp (progname, "vigr") != 0);248 do_vipw = (strcmp (progname, VIGR) != 0); 249 249 250 250 { 251 251 /*
Note:
See TracBrowser
for help on using the repository browser.