usr/src/cmd/sudo/solaris.patch
changeset 86 7cec84c09a67
parent 85 2b1f0bf1e1e8
child 87 f1183b751617
equal deleted inserted replaced
85:2b1f0bf1e1e8 86:7cec84c09a67
     1 diff -c -r sudo-1.7.4p4/Makefile.in sudo-1.7.4p4.sun/Makefile.in
       
     2 *** sudo-1.7.4p4/Makefile.in	Fri Sep  3 23:43:57 2010
       
     3 --- sudo-1.7.4p4.sun/Makefile.in	Thu Sep 23 22:07:12 2010
       
     4 ***************
       
     5 *** 24,29 ****
       
     6 --- 24,31 ----
       
     7   
       
     8   #### Start of system configuration section. ####
       
     9   
       
    10 + TESTMACH:sh = if [ -z "$MACH64" ] ; then echo "Run make from Makfile.sfw" >&2 ; exit 1; else [ -d $MACH64 ] || mkdir $MACH64 ; fi
       
    11 + 
       
    12   srcdir = @srcdir@
       
    13   devdir = @devdir@
       
    14   authdir = $(srcdir)/auth
       
    15 ***************
       
    16 *** 86,91 ****
       
    17 --- 88,96 ----
       
    18   mandirsu = $(mandir)/$(mantype)$(mansectsu)
       
    19   mandirform = $(mandir)/$(mantype)$(mansectform)
       
    20   
       
    21 + datadir = @datadir@
       
    22 + ldifdir = $(datadir)/lib/ldif
       
    23 + 
       
    24   # User and group ids the installed files should be "owned" by
       
    25   install_uid = 0
       
    26   install_gid = 0
       
    27 ***************
       
    28 *** 207,212 ****
       
    29 --- 212,228 ----
       
    30   libsudo_noexec.la: sudo_noexec.lo
       
    31   	$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ sudo_noexec.lo -avoid-version -rpath $(noexecdir)
       
    32   
       
    33 + #
       
    34 + # Create 64-bit versions of the shared library
       
    35 + #
       
    36 + $(MACH64)/sudo_noexec.lo: $(srcdir)/sudo_noexec.c
       
    37 + 	$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS64) $(DEFS) $(OPTIONS) -o $(MACH64)/sudo_noexec.o $(srcdir)/sudo_noexec.c
       
    38 + 
       
    39 + $(MACH64)/libsudo_noexec.la: $(MACH64)/sudo_noexec.lo
       
    40 + 	$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -m64 -o $@ $(MACH64)/sudo_noexec.lo -avoid-version -rpath $(noexecdir)
       
    41 + 
       
    42 + libsudo_noexec: libsudo_noexec.la $(MACH64)/libsudo_noexec.la
       
    43 + 
       
    44   # Uncomment the following if you want "make distclean" to clean the parser
       
    45   @DEV@GENERATED = gram.h gram.c toke.c def_data.c def_data.h getdate
       
    46   
       
    47 ***************
       
    48 *** 475,519 ****
       
    49   	    hg log --style=changelog -b default --date '<2010-01-18 00:00:00' >> $@; \
       
    50   	fi
       
    51   
       
    52 ! install: install-dirs install-binaries @INSTALL_NOEXEC@ install-sudoers install-doc
       
    53   
       
    54   install-dirs:
       
    55   	$(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$(sudodir) \
       
    56   	    $(DESTDIR)$(visudodir) $(DESTDIR)$(noexecdir) \
       
    57   	    $(DESTDIR)$(sudoersdir) $(DESTDIR)$(docdir) \
       
    58 ! 	    $(DESTDIR)$(mandirsu) $(DESTDIR)$(mandirform)
       
    59   	$(SHELL) $(srcdir)/mkinstalldirs -m 0700 $(DESTDIR)$(timedir)
       
    60   
       
    61   install-binaries: install-dirs $(PROGS)
       
    62 ! 	$(INSTALL) -b~ -O $(install_uid) -G $(install_gid) -M 04111 sudo $(DESTDIR)$(sudodir)/sudo
       
    63   	rm -f $(DESTDIR)$(sudodir)/sudoedit
       
    64   	ln $(DESTDIR)$(sudodir)/sudo $(DESTDIR)$(sudodir)/sudoedit
       
    65 ! 	if [ -f sudoreplay ]; then $(INSTALL) -b~ -O $(install_uid) -G $(install_gid) -M 0111 sudoreplay $(DESTDIR)$(sudodir)/sudoreplay; fi
       
    66 ! 	$(INSTALL) -b~ -O $(install_uid) -G $(install_gid) -M 0111 visudo $(DESTDIR)$(visudodir)/visudo
       
    67 ! 	if [ -f sesh ]; then $(INSTALL) -b~ -O $(install_uid) -G $(install_gid) -M 0111 sesh $(DESTDIR)$(libexecdir)/sesh; fi
       
    68   
       
    69 ! install-noexec: install-dirs libsudo_noexec.la
       
    70 ! 	if [ -f .libs/lib$(noexecfile) ]; then $(INSTALL) -b~ -O $(install_uid) -G $(install_gid) -M 0755 .libs/lib$(noexecfile) $(DESTDIR)$(noexecdir)/$(noexecfile); fi
       
    71   
       
    72   install-sudoers: install-dirs
       
    73 ! 	$(INSTALL) -d -O $(sudoers_uid) -G $(sudoers_gid) -M 0750 \
       
    74   	    $(DESTDIR)$(sudoersdir)/sudoers.d
       
    75   	test -f $(DESTDIR)$(sudoersdir)/sudoers || \
       
    76 ! 	    $(INSTALL) -O $(sudoers_uid) -G $(sudoers_gid) -M $(sudoers_mode) \
       
    77   		sudoers $(DESTDIR)$(sudoersdir)/sudoers
       
    78   
       
    79   install-doc: install-dirs ChangeLog
       
    80 ! 	(cd $(srcdir) && for f in ChangeLog HISTORY LICENSE NEWS README TROUBLESHOOTING UPGRADE sample.*; do $(INSTALL) -O $(install_uid) -G $(install_gid) -M 0444 $$f $(DESTDIR)$(docdir); done)
       
    81 ! 	@LDAP@(cd $(srcdir) && for f in README.LDAP schema.* sudoers2ldif; do $(INSTALL) -O $(install_uid) -G $(install_gid) -M 0444 $$f $(DESTDIR)$(docdir); done)
       
    82 ! 	$(INSTALL) -O $(install_uid) -G $(install_gid) -M 0444 @mansrcdir@/sudo.$(mantype) $(DESTDIR)$(mandirsu)/sudo.$(mansectsu)
       
    83   	@rm -f $(DESTDIR)$(mandirsu)/sudoedit.$(mansectsu)
       
    84   	ln $(DESTDIR)$(mandirsu)/sudo.$(mansectsu) $(DESTDIR)$(mandirsu)/sudoedit.$(mansectsu)
       
    85 ! 	@REPLAY@$(INSTALL) -O $(install_uid) -G $(install_gid) -M 0444 @mansrcdir@/sudoreplay.$(mantype) $(DESTDIR)$(mandirsu)/sudoreplay.$(mansectsu)
       
    86 ! 	$(INSTALL) -O $(install_uid) -G $(install_gid) -M 0444 @mansrcdir@/visudo.$(mantype) $(DESTDIR)$(mandirsu)/visudo.$(mansectsu)
       
    87 ! 	$(INSTALL) -O $(install_uid) -G $(install_gid) -M 0444 @mansrcdir@/sudoers.$(mantype) $(DESTDIR)$(mandirform)/sudoers.$(mansectform)
       
    88 ! 	@LDAP@$(INSTALL) -O $(install_uid) -G $(install_gid) -M 0444 @mansrcdir@/sudoers.ldap.$(mantype) $(DESTDIR)$(mandirform)/sudoers.ldap.$(mansectform)
       
    89   @MAN_POSTINSTALL@
       
    90   
       
    91   check:
       
    92   	@echo nothing to check
       
    93   
       
    94 --- 491,542 ----
       
    95   	    hg log --style=changelog -b default --date '<2010-01-18 00:00:00' >> $@; \
       
    96   	fi
       
    97   
       
    98 ! install: install-dirs install-binaries @INSTALL_NOEXEC@ install-sudoers install-doc install-ldif
       
    99   
       
   100   install-dirs:
       
   101   	$(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$(sudodir) \
       
   102   	    $(DESTDIR)$(visudodir) $(DESTDIR)$(noexecdir) \
       
   103   	    $(DESTDIR)$(sudoersdir) $(DESTDIR)$(docdir) \
       
   104 ! 	    $(DESTDIR)$(mandirsu) $(DESTDIR)$(mandirform) \
       
   105 ! 	    $(DESTDIR)$(ldifdir)
       
   106   	$(SHELL) $(srcdir)/mkinstalldirs -m 0700 $(DESTDIR)$(timedir)
       
   107   
       
   108   install-binaries: install-dirs $(PROGS)
       
   109 ! 	$(INSTALL) -O $(install_uid) -G $(install_gid) -m 04511 sudo $(DESTDIR)$(sudodir)/sudo
       
   110   	rm -f $(DESTDIR)$(sudodir)/sudoedit
       
   111   	ln $(DESTDIR)$(sudodir)/sudo $(DESTDIR)$(sudodir)/sudoedit
       
   112 ! 	if [ -f sudoreplay ]; then $(INSTALL) -O $(install_uid) -G $(install_gid) -m 0111 sudoreplay $(DESTDIR)$(sudodir)/sudoreplay; fi
       
   113 ! 	$(INSTALL) -O $(install_uid) -G $(install_gid) -m 0511 visudo $(DESTDIR)$(visudodir)/visudo
       
   114 ! 	if [ -f sesh ]; then $(INSTALL) -O $(install_uid) -G $(install_gid) -m 0511 sesh $(DESTDIR)$(libexecdir)/sesh; fi
       
   115   
       
   116 ! install-noexec: install-dirs libsudo_noexec.la $(MACH64)/libsudo_noexec.la
       
   117 ! 	if [ -f .libs/lib$(noexecfile) ]; then $(INSTALL) -O $(install_uid) -G $(install_gid) -m 0755 .libs/lib$(noexecfile) $(DESTDIR)$(noexecdir)/$(noexecfile); fi
       
   118 ! 	if [ -f $(MACH64)/.libs/lib$(noexecfile) ]; then $(INSTALL) -O $(install_uid) -G $(install_gid) -m 0755 $(MACH64)/.libs/lib$(noexecfile) $(DESTDIR)$(noexecdir)/$(MACH64)/$(noexecfile); fi
       
   119   
       
   120   install-sudoers: install-dirs
       
   121 ! 	$(INSTALL) -d -O $(sudoers_uid) -G $(sudoers_gid) -m 0750 \
       
   122   	    $(DESTDIR)$(sudoersdir)/sudoers.d
       
   123   	test -f $(DESTDIR)$(sudoersdir)/sudoers || \
       
   124 ! 	    $(INSTALL) -O $(sudoers_uid) -G $(sudoers_gid) -m $(sudoers_mode) \
       
   125   		sudoers $(DESTDIR)$(sudoersdir)/sudoers
       
   126   
       
   127   install-doc: install-dirs ChangeLog
       
   128 ! 	(cd $(srcdir) && for f in ChangeLog HISTORY LICENSE NEWS README TROUBLESHOOTING UPGRADE sample.*; do $(INSTALL) -O $(install_uid) -G $(install_gid) -m 0444 $$f $(DESTDIR)$(docdir); done)
       
   129 ! 	@LDAP@(cd $(srcdir) && for f in README.LDAP schema.* sudoers2ldif; do $(INSTALL) -O $(install_uid) -G $(install_gid) -m 0444 $$f $(DESTDIR)$(docdir); done)
       
   130 ! 	$(INSTALL) -O $(install_uid) -G $(install_gid) -m 0444 @mansrcdir@/sudo.$(mantype) $(DESTDIR)$(mandirsu)/sudo.$(mansectsu)
       
   131   	@rm -f $(DESTDIR)$(mandirsu)/sudoedit.$(mansectsu)
       
   132   	ln $(DESTDIR)$(mandirsu)/sudo.$(mansectsu) $(DESTDIR)$(mandirsu)/sudoedit.$(mansectsu)
       
   133 ! 	@REPLAY@$(INSTALL) -O $(install_uid) -G $(install_gid) -m 0444 @mansrcdir@/sudoreplay.$(mantype) $(DESTDIR)$(mandirsu)/sudoreplay.$(mansectsu)
       
   134 ! 	$(INSTALL) -O $(install_uid) -G $(install_gid) -m 0444 @mansrcdir@/visudo.$(mantype) $(DESTDIR)$(mandirsu)/visudo.$(mansectsu)
       
   135 ! 	$(INSTALL) -O $(install_uid) -G $(install_gid) -m 0444 @mansrcdir@/sudoers.$(mantype) $(DESTDIR)$(mandirform)/sudoers.$(mansectform)
       
   136 ! 	@LDAP@$(INSTALL) -O $(install_uid) -G $(install_gid) -m 0444 @mansrcdir@/sudoers.ldap.$(mantype) $(DESTDIR)$(mandirform)/sudoers.ldap.$(mansectform)
       
   137   @MAN_POSTINSTALL@
       
   138   
       
   139 + install-ldif:
       
   140 + 	$(INSTALL) -O $(install_uid) -G $(install_gid) -m 0444 $(srcdir)/schema.OpenLDAP $(DESTDIR)$(ldifdir)/sudo-schema.OpenLDAP
       
   141 + 	$(INSTALL) -O $(install_uid) -G $(install_gid) -m 0444 $(srcdir)/schema.iPlanet $(DESTDIR)$(ldifdir)/sudo-schema.iPlanet
       
   142 + 	$(INSTALL) -O $(install_uid) -G $(install_gid) -m 0444 $(srcdir)/sudoers2ldif $(DESTDIR)$(ldifdir)/sudoers2ldif
       
   143 + 
       
   144   check:
       
   145   	@echo nothing to check
       
   146   
       
   147 ***************
       
   148 *** 524,530 ****
       
   149   
       
   150   distclean: clean
       
   151   	-rm -rf Makefile pathnames.h config.h config.status config.cache \
       
   152 ! 		config.log libtool sudoers sudo_noexec.lo .libs $(GENERATED) \
       
   153   		sudo.man sudoers.man sudoers.ldap.man sudoreplay.man \
       
   154   		visudo.man sudo_usage.h Makefile.binary
       
   155   
       
   156 --- 547,554 ----
       
   157   
       
   158   distclean: clean
       
   159   	-rm -rf Makefile pathnames.h config.h config.status config.cache \
       
   160 ! 		config.log libtool sudoers sudo_noexec.lo $(MACH64) \
       
   161 ! 		.libs $(GENERATED) \
       
   162   		sudo.man sudoers.man sudoers.ldap.man sudoreplay.man \
       
   163   		visudo.man sudo_usage.h Makefile.binary
       
   164   
       
   165 Common subdirectories: sudo-1.7.4p4/auth and sudo-1.7.4p4.sun/auth
       
   166 diff -c -r sudo-1.7.4p4/configure sudo-1.7.4p4.sun/configure
       
   167 *** sudo-1.7.4p4/configure	Mon Sep  6 14:03:39 2010
       
   168 --- sudo-1.7.4p4.sun/configure	Fri Sep 17 14:22:18 2010
       
   169 ***************
       
   170 *** 18438,18444 ****
       
   171   	fi
       
   172       fi
       
   173       if test X"$with_noexec" != X"no"; then
       
   174 ! 	PROGS="${PROGS} libsudo_noexec.la"
       
   175   	INSTALL_NOEXEC="install-noexec"
       
   176   
       
   177   	eval noexec_file="$with_noexec"
       
   178 --- 18438,18444 ----
       
   179   	fi
       
   180       fi
       
   181       if test X"$with_noexec" != X"no"; then
       
   182 ! 	PROGS="${PROGS} libsudo_noexec"
       
   183   	INSTALL_NOEXEC="install-noexec"
       
   184   
       
   185   	eval noexec_file="$with_noexec"
       
   186 Common subdirectories: sudo-1.7.4p4/emul and sudo-1.7.4p4.sun/emul
       
   187 diff -c -r sudo-1.7.4p4/env.c sudo-1.7.4p4.sun/env.c
       
   188 *** sudo-1.7.4p4/env.c	Wed Aug 18 21:27:03 2010
       
   189 --- sudo-1.7.4p4.sun/env.c	Fri Sep 17 14:32:17 2010
       
   190 ***************
       
   191 *** 792,798 ****
       
   192 --- 792,819 ----
       
   193   #  ifdef _AIX
       
   194   	sudo_setenv("LDR_PRELOAD", def_noexec_file, TRUE);
       
   195   #  else
       
   196 + #    ifdef __sun
       
   197 + 	{
       
   198 + 	    char *p = NULL;
       
   199 + 	    char path[MAXPATHLEN], path64[MAXPATHLEN];
       
   200 + 
       
   201 + 	    if (strlcpy(path, def_noexec_file, sizeof (path)) < sizeof (path))
       
   202 + 	        p = strrchr(path, '/');
       
   203 + 	    if (p != NULL) {
       
   204 + 	        /* full pathname specified; set both 32/64 LD_PRELOAD vars */
       
   205 + 		*p = '\0';
       
   206 + 		if (snprintf(path64, sizeof (path64), "%s/64/%s",
       
   207 + 			path, p+1) < sizeof (path64))
       
   208 + 		    sudo_setenv("LD_PRELOAD_64", path64, TRUE);
       
   209 + 		sudo_setenv("LD_PRELOAD_32", def_noexec_file, TRUE);
       
   210 + 	    } else {
       
   211 + 	        /* relative pathname specified, ld.so.1 will search */
       
   212 + 		sudo_setenv("LD_PRELOAD", def_noexec_file,  TRUE);
       
   213 + 	    }
       
   214 + 	}
       
   215 + #    else
       
   216   	sudo_setenv("LD_PRELOAD", def_noexec_file, TRUE);
       
   217 + #    endif /* __sun */
       
   218   #  endif /* _AIX */
       
   219   # endif /* __osf__ || __sgi */
       
   220   #endif /* __darwin__ || __APPLE__ */
       
   221 Common subdirectories: sudo-1.7.4p4/m4 and sudo-1.7.4p4.sun/m4