components/sudo/patches/solaris.patch
changeset 279 c6af843791cd
equal deleted inserted replaced
278:77b380ba9d84 279:c6af843791cd
       
     1 diff -c -r sudo-1.7.4p4/configure sudo-1.7.4p4.sun/configure
       
     2 *** sudo-1.7.4p4/configure	Mon Sep  6 14:03:39 2010
       
     3 --- sudo-1.7.4p4.sun/configure	Fri Sep 17 14:22:18 2010
       
     4 ***************
       
     5 *** 18438,18444 ****
       
     6   	fi
       
     7       fi
       
     8       if test X"$with_noexec" != X"no"; then
       
     9 ! 	PROGS="${PROGS} libsudo_noexec.la"
       
    10   	INSTALL_NOEXEC="install-noexec"
       
    11   
       
    12   	eval noexec_file="$with_noexec"
       
    13 --- 18438,18444 ----
       
    14   	fi
       
    15       fi
       
    16       if test X"$with_noexec" != X"no"; then
       
    17 ! 	PROGS="${PROGS} libsudo_noexec"
       
    18   	INSTALL_NOEXEC="install-noexec"
       
    19   
       
    20   	eval noexec_file="$with_noexec"
       
    21 Common subdirectories: sudo-1.7.4p4/emul and sudo-1.7.4p4.sun/emul
       
    22 diff -c -r sudo-1.7.4p4/env.c sudo-1.7.4p4.sun/env.c
       
    23 *** sudo-1.7.4p4/env.c	Wed Aug 18 21:27:03 2010
       
    24 --- sudo-1.7.4p4.sun/env.c	Fri Sep 17 14:32:17 2010
       
    25 ***************
       
    26 *** 792,798 ****
       
    27 --- 792,819 ----
       
    28   #  ifdef _AIX
       
    29   	sudo_setenv("LDR_PRELOAD", def_noexec_file, TRUE);
       
    30   #  else
       
    31 + #    ifdef __sun
       
    32 + 	{
       
    33 + 	    char *p = NULL;
       
    34 + 	    char path[MAXPATHLEN], path64[MAXPATHLEN];
       
    35 + 
       
    36 + 	    if (strlcpy(path, def_noexec_file, sizeof (path)) < sizeof (path))
       
    37 + 	        p = strrchr(path, '/');
       
    38 + 	    if (p != NULL) {
       
    39 + 	        /* full pathname specified; set both 32/64 LD_PRELOAD vars */
       
    40 + 		*p = '\0';
       
    41 + 		if (snprintf(path64, sizeof (path64), "%s/64/%s",
       
    42 + 			path, p+1) < sizeof (path64))
       
    43 + 		    sudo_setenv("LD_PRELOAD_64", path64, TRUE);
       
    44 + 		sudo_setenv("LD_PRELOAD_32", def_noexec_file, TRUE);
       
    45 + 	    } else {
       
    46 + 	        /* relative pathname specified, ld.so.1 will search */
       
    47 + 		sudo_setenv("LD_PRELOAD", def_noexec_file,  TRUE);
       
    48 + 	    }
       
    49 + 	}
       
    50 + #    else
       
    51   	sudo_setenv("LD_PRELOAD", def_noexec_file, TRUE);
       
    52 + #    endif /* __sun */
       
    53   #  endif /* _AIX */
       
    54   # endif /* __osf__ || __sgi */
       
    55   #endif /* __darwin__ || __APPLE__ */
       
    56 Common subdirectories: sudo-1.7.4p4/m4 and sudo-1.7.4p4.sun/m4