From b1e92e4afd14a8b284932c62f5b1a348bfb037a0 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sat, 12 Jun 2010 09:32:03 -0400 Subject: [PATCH] Generate .cat files directly from .man.in instead of .man using default values in configure.in --HG-- branch : 1.7 --- Makefile.in | 57 +++--- configure | 54 +++--- configure.in | 35 ++-- sudo.cat | 100 +++++----- sudoers.cat | 508 +++++++++++++++++++++++++-------------------------- 5 files changed, 385 insertions(+), 369 deletions(-) diff --git a/Makefile.in b/Makefile.in index 1ec099054..1589cf32f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -180,7 +180,7 @@ INSDEP = $(srcdir)/ins_2001.h $(srcdir)/ins_classic.h $(srcdir)/ins_csops.h \ all: $(PROGS) -.SUFFIXES: .o .c .h .l .y .man .cat .lo +.SUFFIXES: .o .c .h .l .y .lo .c.o: $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $< @@ -188,10 +188,6 @@ all: $(PROGS) .c.lo: $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $< -.man.cat: - @rm -f $@ - sed '1s/^/.if n .ll 78n/' $< | $(NROFF) -man > $@ - libsudo.a: $(LIB_OBJS) $(COMMON_OBJS) $(AR) rv $@ $(LIB_OBJS) $(COMMON_OBJS) $(RANLIB) $@ @@ -414,50 +410,53 @@ securid5.o: $(authdir)/securid5.c $(AUTHDEP) sia.o: $(authdir)/sia.c $(AUTHDEP) $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/sia.c +varsub: $(srcdir)/configure.in + printf 's#@%s@#1#\ns#@%s@#1#\ns#@%s@#1#\ns#@%s@#/etc#g\ns#@%s@#/usr/local#g\ns#@%s@#4#g\ns#@%s@#1m#g\n' SEMAN BAMAN LCMAN sysconfdir prefix mansectform mansectsu > $@; sed -n '/Begin initial values for man page substitution/,/End initial values for man page substitution/{;p;}' $(srcdir)/configure.in | sed -e '/^#/d' -e 's/^/s#@/' -e 's/=[\\"]*/@#/' -e 's/[\\"]*$$/#g/' >> $@ + sudo.man.in: $(srcdir)/sudo.pod - @rm -f $(srcdir)/$@ - ( cd $(srcdir); mansectsu=`echo @MANSECTSU@|tr A-Z a-z`; mansectform=`echo @MANSECTFORM@|tr A-Z a-z`; sed -n -e '/^=pod/q' -e 's/^/.\\" /p' sudo.pod > $@; pod2man --quotes=none --date="`date '+%B %e, %Y'`" --section=$$mansectsu --release=$(VERSION) --center="MAINTENANCE COMMANDS" sudo.pod | sed -e "s/(5)/($$mansectform)/" -e "s/(8)/($$mansectsu)/" | perl -p sudo.man.pl >> $@ ) + mansectsu=`echo @MANSECTSU@|tr A-Z a-z`; mansectform=`echo @MANSECTFORM@|tr A-Z a-z`; sed -n -e '/^=pod/q' -e 's/^/.\\" /p' $(srcdir)/sudo.pod > $@; pod2man --quotes=none --date="`date '+%B %e, %Y'`" --section=$$mansectsu --release=$(VERSION) --center="MAINTENANCE COMMANDS" $(srcdir)/sudo.pod | sed -e "s/(5)/($$mansectform)/" -e "s/(8)/($$mansectsu)/" | perl -p $(srcdir)/sudo.man.pl >> $@ -sudo.man: sudo.man.in +sudo.man: $(srcdir)/sudo.man.in $(SHELL) config.status --file=$@ -sudo.cat: sudo.man +$(srcdir)/sudo.cat: varsub $(srcdir)/sudo.man.in + sed -f varsub $(srcdir)/sudo.man.in | $(NROFF) -man > $@ -visudo.man.in: $(srcdir)/visudo.pod - @rm -f $(srcdir)/$@ - ( cd $(srcdir); mansectsu=`echo @MANSECTSU@|tr A-Z a-z`; mansectform=`echo @MANSECTFORM@|tr A-Z a-z`; sed -n -e '/^=pod/q' -e 's/^/.\\" /p' visudo.pod > $@; pod2man --quotes=none --date="`date '+%B %e, %Y'`" --section=$$mansectsu --release=$(VERSION) --center="MAINTENANCE COMMANDS" visudo.pod | sed -e "s/(5)/($$mansectform)/" -e "s/(8)/($$mansectsu)/" -e 's|\\fI\\f\((CW*\)*I@\([^@]*\)\\fI@|\\fI@\2@|g' >> $@ ) +$(srcdir)/visudo.man.in: $(srcdir)/visudo.pod + mansectsu=`echo @MANSECTSU@|tr A-Z a-z`; mansectform=`echo @MANSECTFORM@|tr A-Z a-z`; sed -n -e '/^=pod/q' -e 's/^/.\\" /p' $(srcdir)/visudo.pod > $@; pod2man --quotes=none --date="`date '+%B %e, %Y'`" --section=$$mansectsu --release=$(VERSION) --center="MAINTENANCE COMMANDS" $(srcdir)/visudo.pod | sed -e "s/(5)/($$mansectform)/" -e "s/(8)/($$mansectsu)/" -e 's|\\fI\\f\((CW*\)*I@\([^@]*\)\\fI@|\\fI@\2@|g' >> $@ -visudo.man: visudo.man.in +visudo.man: $(srcdir)/visudo.man.in $(SHELL) config.status --file=$@ -visudo.cat: visudo.man +$(srcdir)/visudo.cat: varsub $(srcdir)/visudo.man.in + sed -f varsub $(srcdir)/visudo.man.in | $(NROFF) -man > $@ -sudoers.man.in: $(srcdir)/sudoers.pod - @rm -f $(srcdir)/$@ - ( cd $(srcdir); mansectsu=`echo @MANSECTSU@|tr A-Z a-z`; mansectform=`echo @MANSECTFORM@|tr A-Z a-z`; sed -n -e '/^=pod/q' -e 's/^/.\\" /p' sudoers.pod > $@; pod2man --quotes=none --date="`date '+%B %e, %Y'`" --section=$$mansectform --release=$(VERSION) --center="MAINTENANCE COMMANDS" sudoers.pod | sed -e "s/(5)/($$mansectform)/" -e "s/(8)/($$mansectsu)/" | perl -p sudoers.man.pl >> $@ ) +$(srcdir)/sudoers.man.in: $(srcdir)/sudoers.pod + mansectsu=`echo @MANSECTSU@|tr A-Z a-z`; mansectform=`echo @MANSECTFORM@|tr A-Z a-z`; sed -n -e '/^=pod/q' -e 's/^/.\\" /p' $(srcdir)/sudoers.pod > $@; pod2man --quotes=none --date="`date '+%B %e, %Y'`" --section=$$mansectform --release=$(VERSION) --center="MAINTENANCE COMMANDS" $(srcdir)/sudoers.pod | sed -e "s/(5)/($$mansectform)/" -e "s/(8)/($$mansectsu)/" | perl -p $(srcdir)/sudoers.man.pl >> $@ -sudoers.man: sudoers.man.in +sudoers.man: $(srcdir)/sudoers.man.in $(SHELL) config.status --file=$@ -sudoers.cat: sudoers.man +$(srcdir)/sudoers.cat: varsub $(srcdir)/sudoers.man.in + sed -f varsub $(srcdir)/sudoers.man.in | $(NROFF) -man > $@ -sudoers.ldap.man.in: $(srcdir)/sudoers.ldap.pod - @rm -f $(srcdir)/$@ - ( cd $(srcdir); mansectsu=`echo @MANSECTSU@|tr A-Z a-z`; mansectform=`echo @MANSECTFORM@|tr A-Z a-z`; sed -n -e '/^=pod/q' -e 's/^/.\\" /p' sudoers.ldap.pod > $@; pod2man --quotes=none --date="`date '+%B %e, %Y'`" --section=$$mansectform --release=$(VERSION) --center="MAINTENANCE COMMANDS" sudoers.ldap.pod | sed -e "s/(5)/($$mansectform)/" -e "s/(8)/($$mansectsu)/" -e 's|\\fI\\f\((CW*\)*I@\([^@]*\)\\fI@|\\fI@\2@|g' >> $@ ) +$(srcdir)/sudoers.ldap.man.in: $(srcdir)/sudoers.ldap.pod + mansectsu=`echo @MANSECTSU@|tr A-Z a-z`; mansectform=`echo @MANSECTFORM@|tr A-Z a-z`; sed -n -e '/^=pod/q' -e 's/^/.\\" /p' $(srcdir)/sudoers.ldap.pod > $@; pod2man --quotes=none --date="`date '+%B %e, %Y'`" --section=$$mansectform --release=$(VERSION) --center="MAINTENANCE COMMANDS" $(srcdir)/sudoers.ldap.pod | sed -e "s/(5)/($$mansectform)/" -e "s/(8)/($$mansectsu)/" -e 's|\\fI\\f\((CW*\)*I@\([^@]*\)\\fI@|\\fI@\2@|g' >> $@ -sudoers.ldap.man: sudoers.ldap.man.in +sudoers.ldap.man: $(srcdir)/sudoers.ldap.man.in $(SHELL) config.status --file=$@ -sudoers.ldap.cat: sudoers.ldap.man +$(srcdir)/sudoers.ldap.cat: varsub $(srcdir)/sudoers.ldap.man.in + sed -f varsub $(srcdir)/sudoers.ldap.man.in | $(NROFF) -man > $@ -sudoreplay.man.in: $(srcdir)/sudoreplay.pod - @rm -f $(srcdir)/$@ - ( cd $(srcdir); mansectsu=`echo @MANSECTSU@|tr A-Z a-z`; mansectform=`echo @MANSECTFORM@|tr A-Z a-z`; sed -n -e '/^=pod/q' -e 's/^/.\\" /p' sudoreplay.pod > $@; pod2man --quotes=none --date="`date '+%B %e, %Y'`" --section=$$mansectsu --release=$(VERSION) --center="MAINTENANCE COMMANDS" sudoreplay.pod | sed -e "s/(5)/($$mansectform)/" -e "s/(8)/($$mansectsu)/" -e 's|\\fI\\f\((CW*\)*I@\([^@]*\)\\fI@|\\fI@\2@|g' >> $@ ) +$(srcdir)/sudoreplay.man.in: $(srcdir)/sudoreplay.pod + mansectsu=`echo @MANSECTSU@|tr A-Z a-z`; mansectform=`echo @MANSECTFORM@|tr A-Z a-z`; sed -n -e '/^=pod/q' -e 's/^/.\\" /p' $(srcdir)/sudoreplay.pod > $@; pod2man --quotes=none --date="`date '+%B %e, %Y'`" --section=$$mansectsu --release=$(VERSION) --center="MAINTENANCE COMMANDS" $(srcdir)/sudoreplay.pod | sed -e "s/(5)/($$mansectform)/" -e "s/(8)/($$mansectsu)/" -e 's|\\fI\\f\((CW*\)*I@\([^@]*\)\\fI@|\\fI@\2@|g' >> $@ -sudoreplay.man: sudoreplay.man.in +sudoreplay.man: $(srcdir)/sudoreplay.man.in $(SHELL) config.status --file=$@ -sudoers.cat: sudoers.man +$(srcdir)/sudoreplay.cat: varsub $(srcdir)/sudoreplay.man.in + sed -f varsub $(srcdir)/sudoreplay.man.in | $(NROFF) -man > $@ @DEV@HISTORY: history.pod @DEV@ pod2text -l -i0 $> > $@ diff --git a/configure b/configure index 7b230c0fc..9fb1a6592 100755 --- a/configure +++ b/configure @@ -2766,6 +2766,10 @@ $as_echo "$as_me: Configuring Sudo version $PACKAGE_VERSION" >&6;} +# +# Begin initial values for man page substitution +# +timedir=/var/run/sudo timeout=5 password_timeout=5 sudo_umask=0022 @@ -2781,8 +2785,8 @@ mail_no_user=on mail_no_host=off mail_no_perms=off mailto=root -mailsub='*** SECURITY information for %h ***' -badpass_message='Sorry, try again.' +mailsub="*** SECURITY information for %h ***" +badpass_message="Sorry, try again." fqdn=off runas_default=root env_editor=off @@ -2791,7 +2795,15 @@ tty_tickets=off insults=off root_sudo=on path_info=on +ldap_conf=/etc/ldap.conf +ldap_secret=/etc/ldap.secret +netsvc_conf=/etc/netsvc.conf +noexec_file=/usr/local/libexec/sudo_noexec.so +nsswitch_conf=/etc/nsswitch.conf secure_path="not set" +# +# End initial values for man page substitution +# INSTALL_NOEXEC= devdir='$(srcdir)' PROGS="sudo visudo" @@ -4089,11 +4101,11 @@ if test "${with_ldap_conf_file+set}" = set; then : withval=$with_ldap_conf_file; fi +test -n "$with_ldap_conf_file" && ldap_conf="$with_ldap_conf_file" cat >>confdefs.h <>confdefs.h < conftest.$ac_ext - (eval echo "\"\$as_me:6530: $ac_compile\"" >&5) + (eval echo "\"\$as_me:6542: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:6533: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:6545: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:6536: output\"" >&5) + (eval echo "\"\$as_me:6548: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -7738,7 +7750,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 7741 "configure"' > conftest.$ac_ext + echo '#line 7753 "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -9131,11 +9143,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:9134: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9146: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:9138: \$? = $ac_status" >&5 + echo "$as_me:9150: \$? = $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. @@ -9470,11 +9482,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:9473: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9485: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:9477: \$? = $ac_status" >&5 + echo "$as_me:9489: \$? = $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. @@ -9575,11 +9587,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:9578: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9590: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:9582: \$? = $ac_status" >&5 + echo "$as_me:9594: \$? = $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 @@ -9630,11 +9642,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:9633: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9645: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:9637: \$? = $ac_status" >&5 + echo "$as_me:9649: \$? = $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 @@ -11997,7 +12009,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12000 "configure" +#line 12012 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12093,7 +12105,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12096 "configure" +#line 12108 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -15896,8 +15908,6 @@ fi done -netsvc_conf='/etc/netsvc.conf' -nsswitch_conf='/etc/nsswitch.conf' if test ${with_netsvc-"no"} != "no"; then cat >>confdefs.h <