From 279ee07ee065405f4d4981b538c2f15b3ff00688 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sun, 17 Feb 2008 13:11:38 +0000 Subject: [PATCH] comment out SELinux manual bits unless --with-selinux was specified --- configure | 27 ++++++++++++++++----------- configure.in | 3 +++ sudo.man.pl | 16 ++++++++++++++++ 3 files changed, 35 insertions(+), 11 deletions(-) create mode 100644 sudo.man.pl diff --git a/configure b/configure index 313e95e5f..0892aa7cc 100755 --- a/configure +++ b/configure @@ -819,6 +819,7 @@ SUDOERS_UID SUDOERS_GID DEV SELINUX +SEMAN devdir mansectsu mansectform @@ -2090,6 +2091,7 @@ echo "$as_me: Configuring Sudo version 1.7" >&6;} + timeout=5 @@ -2128,6 +2130,7 @@ PROGS="sudo visudo" DEV="#" LDAP="#" SELINUX="#" +SEMAN='.\" ' AUTH_OBJS= AUTH_REG= AUTH_EXCL= @@ -3987,6 +3990,7 @@ _ACEOF SUDO_OBJS="${SUDO_OBJS} selinux.o" PROGS="${PROGS} sesh" SELINUX="" + SEMAN="" ;; no) ;; *) { { echo "$as_me:$LINENO: error: \"--with-selinux does not take an argument.\"" >&5 @@ -6160,7 +6164,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 6163 "configure"' > conftest.$ac_ext + echo '#line 6167 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -7704,11 +7708,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7707: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7711: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7711: \$? = $ac_status" >&5 + echo "$as_me:7715: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7994,11 +7998,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7997: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8001: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:8001: \$? = $ac_status" >&5 + echo "$as_me:8005: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -8098,11 +8102,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8101: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8105: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:8105: \$? = $ac_status" >&5 + echo "$as_me:8109: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -10443,7 +10447,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <conf$$subs.sed <<_ACEOF +ldap_secret!$ldap_secret$ac_delim nsswitch_conf!$nsswitch_conf$ac_delim EGREPPROG!$EGREPPROG$ac_delim CC!$CC$ac_delim @@ -23823,7 +23828,7 @@ KRB5CONFIG!$KRB5CONFIG$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 35; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 36; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff --git a/configure.in b/configure.in index 8739519e2..157e6b73d 100644 --- a/configure.in +++ b/configure.in @@ -34,6 +34,7 @@ AC_SUBST(SUDOERS_UID) AC_SUBST(SUDOERS_GID) AC_SUBST(DEV) AC_SUBST(SELINUX) +AC_SUBST(SEMAN) AC_SUBST(devdir) AC_SUBST(mansectsu) AC_SUBST(mansectform) @@ -121,6 +122,7 @@ PROGS="sudo visudo" DEV="#" LDAP="#" SELINUX="#" +SEMAN='.\" ' AUTH_OBJS= AUTH_REG= AUTH_EXCL= @@ -1157,6 +1159,7 @@ AC_ARG_WITH(selinux, [ --with-selinux enable SELinux support], SUDO_OBJS="${SUDO_OBJS} selinux.o" PROGS="${PROGS} sesh" SELINUX="" + SEMAN="" ;; no) ;; *) AC_MSG_ERROR(["--with-selinux does not take an argument."]) diff --git a/sudo.man.pl b/sudo.man.pl new file mode 100644 index 000000000..fc45ead40 --- /dev/null +++ b/sudo.man.pl @@ -0,0 +1,16 @@ +#!/usr/bin/perl -p + +BEGIN { + $prepend = 0; +} +if (/-r.*role.*-t.*type/) { + # comment out SELinux-specific line in SYNOPSIS + s/^/\@SEMAN\@/; +} elsif (/^\.IP(.*-[rt])?/) { + $prepend = defined($1); +} + +# comment out SELinux-specific lines in DESCRIPTION +if ($prepend) { + s/^/\@SEMAN\@/; +} -- 2.40.0