]> granicus.if.org Git - sudo/commitdiff
Install sudoedit and the sudoedit manual as symbolic links, not
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 31 May 2012 19:50:16 +0000 (15:50 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 31 May 2012 19:50:16 +0000 (15:50 -0400)
hard links and package them as such.

doc/Makefile.in
src/Makefile.in
sudo.pp

index e624cbcc662c3f29d39828546b05c9f5d3233a63..592f2830cce75a767f617fba122ba7bf8bee77ec 100644 (file)
@@ -251,10 +251,10 @@ install-doc: install-dirs
                fi; \
            done; \
            rm -f $(DESTDIR)$(mandirsu)/sudoedit.$(mansectsu)$(MANCOMPRESSEXT); \
-           ln $(DESTDIR)$(mandirsu)/sudo.$(mansectsu)$(MANCOMPRESSEXT) $(DESTDIR)$(mandirsu)/sudoedit.$(mansectsu)$(MANCOMPRESSEXT); \
+           ln -s sudo.$(mansectsu)$(MANCOMPRESSEXT) $(DESTDIR)$(mandirsu)/sudoedit.$(mansectsu)$(MANCOMPRESSEXT); \
        else \
            rm -f $(DESTDIR)$(mandirsu)/sudoedit.$(mansectsu); \
-           ln $(DESTDIR)$(mandirsu)/sudo.$(mansectsu) $(DESTDIR)$(mandirsu)/sudoedit.$(mansectsu); \
+           ln -s sudo.$(mansectsu) $(DESTDIR)$(mandirsu)/sudoedit.$(mansectsu); \
        fi
 
 install-plugin:
index 601b57fd0f8dbd1ef63915d572cf6cb9c4724aa9..ebb53783e10c4687d9ec4bba2d8d2890f5d5263c 100644 (file)
@@ -113,7 +113,7 @@ install-dirs:
 install-binaries: install-dirs $(PROGS)
        $(INSTALL) -b~ -O $(install_uid) -G $(install_gid) -M 04111 sudo $(DESTDIR)$(bindir)/sudo
        rm -f $(DESTDIR)$(bindir)/sudoedit
-       ln $(DESTDIR)$(bindir)/sudo $(DESTDIR)$(bindir)/sudoedit
+       ln -s sudo $(DESTDIR)$(bindir)/sudoedit
        if [ -f sesh ]; then $(INSTALL) -b~ -O $(install_uid) -G $(install_gid) -M 0111 sesh $(DESTDIR)$(libexecdir)/sesh; fi
 
 install-doc:
diff --git a/sudo.pp b/sudo.pp
index 957cb52e8854808d7822b845090c06b3a3d9e699..83d7b5ef61b1b977e17f9b5f757d9cbc88125f67 100644 (file)
--- a/sudo.pp
+++ b/sudo.pp
@@ -14,6 +14,8 @@ still allow people to get their work done."
        vendor="Todd C. Miller"
        copyright="(c) 1993-1996,1998-2012 Todd C. Miller"
        shmode=0644
+       sudoedit_man=`echo $mandir/*/sudoedit.*|sed 's:^${pp_destdir}::'`
+       sudoedit_man_target=`basename $sudoedit_man | sed 's/edit//'`
 
 %if [aix]
        # AIX package summary is limited to 40 characters
@@ -71,16 +73,14 @@ still allow people to get their work done."
        # Create lintian override file
        mkdir -p ${pp_wrkdir}/${name}/usr/share/lintian/overrides
        cat >${pp_wrkdir}/${name}/usr/share/lintian/overrides/${name} <<-EOF
-       # The sudo binary must be setuid root (sudoedit is a link to sudo)
+       # The sudo binary must be setuid root
        $name: setuid-binary usr/bin/sudo 4755 root/root
-       $name: setuid-binary usr/bin/sudoedit 4755 root/root
        # Sudo configuration and data dirs must not be world-readable
        $name: non-standard-file-perm etc/sudoers 0440 != 0644
        $name: non-standard-dir-perm etc/sudoers.d/ 0750 != 0755
        $name: non-standard-dir-perm var/lib/sudo/ 0700 != 0755
        # Sudo ships with debugging symbols
        $name: unstripped-binary-or-object ./usr/bin/sudo
-       $name: unstripped-binary-or-object ./usr/bin/sudoedit
        $name: unstripped-binary-or-object ./usr/bin/sudoreplay
        $name: unstripped-binary-or-object ./usr/lib/sudo/sudo_noexec.so
        $name: unstripped-binary-or-object ./usr/lib/sudo/sudoers.so
@@ -236,7 +236,7 @@ still allow people to get their work done."
 %files
        $osdirs                 -
        $bindir/sudo            4755 root:
-       $bindir/sudoedit        4755 root:
+       $bindir/sudoedit        4755 root: symlink sudo
        $sbindir/visudo         0755
        $bindir/sudoreplay      0755
        $includedir/sudo_plugin.h 0644
@@ -260,12 +260,14 @@ still allow people to get their work done."
 %endif
 
 %files [!aix]
-       $mandir/man*/* 0644
+       $sudoedit_man           0644 symlink,ignore-others $sudoedit_man_target
+       $mandir/man*/*          0644
 
 %files [aix]
        # Some versions use catpages, some use manpages.
-       $mandir/cat*/* optional 0644
-       $mandir/man*/* optional 0644
+       $sudoedit_man           0644 symlink,ignore-others $sudoedit_man_target
+       $mandir/cat*/*          0644 optional
+       $mandir/man*/*          0644 optional
 
 %post [!rpm,deb]
        # Don't overwrite an existing sudoers file