]> git.donarmstrong.com Git - debhelper.git/commitdiff
r132: Initial Import
authorjoey <joey>
Tue, 17 Aug 1999 05:02:56 +0000 (05:02 +0000)
committerjoey <joey>
Tue, 17 Aug 1999 05:02:56 +0000 (05:02 +0000)
Dh_Lib.pm
debian/changelog
dh_installemacsen
dh_installmenu
dh_installwm
dh_md5sums
dh_suidregister
dh_suidregister.1

index 2b80ce455b8e0069e26f6c2f45c6c7a01abd0b81..61d807afc06fb798df705fef285c95d116d7b1d3 100644 (file)
--- a/Dh_Lib.pm
+++ b/Dh_Lib.pm
@@ -230,19 +230,18 @@ sub pkgext { my $package=shift;
 # 2: script to add to
 # 3: filename of snippet
 # 4: sed to run on the snippet. Ie, s/#PACKAGE#/$PACKAGE/
-sub autoscript { my $package=shift; my $script=shift; my $filename=shift; my $sed=shift;
-       error "autoscript() not yet implemented (lazy, lazy!)";
-
+sub autoscript { my $package=shift; my $script=shift; my $filename=shift; my $sed=shift || "";
        # This is the file we will append to.
        my $outfile="debian/".pkgext($package)."$script.debhelper";
 
        # Figure out what shell script snippet to use.
        my $infile;
-       if ( -e "$main::ENV{DH_AUTOSCRIPTDIR}/$filename" ) {
-               $infile="$main::ENV{DH_AUTOSCRIPTDIR}/$filename";
+       if (defined($ENV{DH_AUTOSCRIPTDIR}) && 
+           -e "$ENV{DH_AUTOSCRIPTDIR}/$filename") {
+               $infile="$ENV{DH_AUTOSCRIPTDIR}/$filename";
        }
        else {
-               if ( -e "/usr/lib/debhelper/autoscripts/$filename" ) {
+               if (-e "/usr/lib/debhelper/autoscripts/$filename") {
                        $infile="/usr/lib/debhelper/autoscripts/$filename";
                }
                else {
@@ -251,7 +250,7 @@ sub autoscript { my $package=shift; my $script=shift; my $filename=shift; my $se
        }
 
        # TODO: do this in perl, perhaps?
-       complex_doit("echo \"# Automatically added by ".basename($0).">> $outfile");
+       complex_doit("echo \"# Automatically added by ".basename($0)."\">> $outfile");
        complex_doit("sed \"$sed\" $infile >> $outfile");
        complex_doit("echo '# End automatically added section' >> $outfile");
 }
index 4826b630d516ce53c5eb1a8b4ae1ab57fb00fa98..fb3aaa58cfe642fcac9155ce53b8825ab5ca1a09 100644 (file)
@@ -1,3 +1,13 @@
+debhelper (1.1.24) unstable; urgency=low
+
+  * dh_suidregister: remove suid/sgid bits from all files registered. The
+    reason is this: if you're using suidmanager, and you want a file that
+    ships suid to never be suid on your system, shipping it suid in the .deb
+    will create a window where it is suid before suidmanager fixes it's
+    permissions. This change should be transparent to users and developers.
+
+ -- Joey Hess <joeyh@master.debian.org>  Tue, 27 Oct 1998 18:19:48 -0800
+
 debhelper (1.1.23) unstable; urgency=low
 
   * dh_clean: At the suggestion of James Troup <james@nocrew.org> now deletes
index 008d95311cd857d341254ce9c3485f5e0cb621cd..79c7dda93769fd9b4b4fdfeb11919a282e244705 100755 (executable)
@@ -1,36 +1,37 @@
-#!/bin/sh -e
+#!/usr/bin/perl -w
 #
 # Registration with emacsen-common.
 
-PATH=debian:$PATH:/usr/lib/debhelper
-. dh_lib
+BEGIN { push @INC, "debian", "/usr/lib/debhelper" }
+use Dh_Lib;
+init();
 
-for PACKAGE in $DH_DOPACKAGES; do
-       TMP=`tmpdir $PACKAGE`
+foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
+       $TMP=tmpdir($PACKAGE);
 
-       emacsen_install=`pkgfile $PACKAGE emacsen-install`
-       emacsen_remove=`pkgfile $PACKAGE emacsen-remove`
+       $emacsen_install=pkgfile($PACKAGE,"emacsen-install");
+       $emacsen_remove=pkgfile($PACKAGE,"emacsen-remove");
 
-       if [ "$emacsen_install" ]; then
-               if [ ! -d "$TMP/usr/lib/emacsen-common/packages/install" ]; then
-                       doit "install -d $TMP/usr/lib/emacsen-common/packages/install"
-               fi
-               doit "install $emacsen_install $TMP/usr/lib/emacsen-common/packages/install/$PACKAGE"
-       fi
+       if ($emacsen_install ne '') {
+               if (! -d "$TMP/usr/lib/emacsen-common/packages/install") {
+                       doit("install","-d","$TMP/usr/lib/emacsen-common/packages/install");
+               }
+               doit("install",$emacsen_install,"$TMP/usr/lib/emacsen-common/packages/install/$PACKAGE");
+       }
 
-       if [ "$emacsen_remove" ]; then
-               if [ ! -d "$TMP/usr/lib/emacsen-common/packages/remove" ]; then
-                       doit "install -d $TMP/usr/lib/emacsen-common/packages/remove"
-               fi
-               doit "install $emacsen_remove $TMP/usr/lib/emacsen-common/packages/remove/$PACKAGE"
-       fi
+       if ($emacsen_remove ne '') {
+               if (! -d "$TMP/usr/lib/emacsen-common/packages/remove") {
+                       doit("install","-d","$TMP/usr/lib/emacsen-common/packages/remove");
+               }
+               doit("install","$emacsen_remove","$TMP/usr/lib/emacsen-common/packages/remove/$PACKAGE");
+       }
 
-       if [ "$emacsen_install" -o "$emacsen_remove" ]; then
-               if [ ! "$DH_NOSCRIPTS" ]; then
-                       autoscript "postinst" "postinst-emacsen" \
-                               "s/#PACKAGE#/$PACKAGE/"
-                       autoscript "prerm" "prerm-emacsen" \
-                               "s/#PACKAGE#/$PACKAGE/"
-               fi
-       fi      
-done
+       if ($emacsen_install ne '' || $emacsen_remove ne '') {
+               if (! $dh{NOSCRIPTS}) {
+                       autoscript($PACKAGE,"postinst","postinst-emacsen",
+                               "s/#PACKAGE#/$PACKAGE/");
+                       autoscript($PACKAGE,"prerm","prerm-emacsen",
+                               "s/#PACKAGE#/$PACKAGE/");
+               }
+       }
+}
index 9fbbfb215c61d0d5927ff67cf1c02557b0beea95..2db1660346672c2aec958fd130819034cfade1a9 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!/usr/bin/perl -w
 #
 # Integration with debian menu system:
 #
@@ -8,37 +8,38 @@
 #
 # Also, add to postinst and postrm.
 
-PATH=debian:$PATH:/usr/lib/debhelper
-. dh_lib
-
-for PACKAGE in $DH_DOPACKAGES; do
-       TMP=`tmpdir $PACKAGE`
-       menu=`pkgfile $PACKAGE menu`
-       menu_method=`pkgfile $PACKAGE menu-method`
-
-       if [ "$menu" ]; then
-               if [ ! -d $TMP/usr/lib/menu ]; then
-                       doit "install -d $TMP/usr/lib/menu"
-               fi
-               doit "install -p -m644 $menu $TMP/usr/lib/menu/$PACKAGE"
+BEGIN { push @INC, "debian", "/usr/lib/debhelper" }
+use Dh_Lib;
+init();
 
+foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
+       $TMP=tmpdir($PACKAGE);
+       $menu=pkgfile($PACKAGE,"menu");
+       $menu_method=pkgfile($PACKAGE,"menu-method");
+       
+       if ($menu ne '') {
+               if (! -d "$TMP/usr/lib/menu") {
+                       doit("install","-d","$TMP/usr/lib/menu");
+               }
+               doit("install","-p","-m644",$menu,"$TMP/usr/lib/menu/$PACKAGE");
+               
                # Add the scripts if a menu-method file doesn't exist.
                # The scripts for menu-method handle everything these do, too.
-               if [ ! "$menu_method" -a ! "$DH_NOSCRIPTS" ]; then
-                       autoscript "postinst" "postinst-menu"
-                       autoscript "postrm" "postrm-menu"
-               fi
-       fi
+               if ($menu_method eq "" && ! $dh{NOSCRIPTS}) {
+                       autoscript($PACKAGE,"postinst","postinst-menu");
+                       autoscript($PACKAGE,"postrm","postrm-menu")
+               }
+       }
 
-       if [ "$menu_method" ]; then
-               if [ ! -d $TMP/etc/menu-methods ]; then
-                       doit "install -d $TMP/etc/menu-methods"
-               fi
-               doit "install -p $menu_method $TMP/etc/menu-methods/$PACKAGE"
+       if ($menu_method ne '') {
+               if (!-d "$TMP/etc/menu-methods") {
+                       doit("install","-d","$TMP/etc/menu-methods");
+               }
+               doit("install","-p",$menu_method,"$TMP/etc/menu-methods/$PACKAGE");
 
-               if [ ! "$DH_NOSCRIPTS" ]; then
-                       autoscript "postinst" "postinst-menu-method" "s/#PACKAGE#/$PACKAGE/"
-                       autoscript "postrm" "postrm-menu-method" "s/#PACKAGE#/$PACKAGE/"
-               fi
-       fi
-done
+               if (! $dh{NOSCRIPTS}) {
+                       autoscript($PACKAGE,"postinst","postinst-menu-method","s/#PACKAGE#/$PACKAGE/");
+                       autoscript($PACKAGE,"postrm","postrm-menu-method","s/#PACKAGE#/$PACKAGE/");
+               }
+       }
+}
index be3a1373627cad96def230a9d488a77a7974c656..0cae9147208719d81259075e0b2aa18f18aa008f 100755 (executable)
@@ -1,21 +1,22 @@
-#!/bin/sh -e
+#!/usr/bin/perl -w
 #
 # Add to postinst and postrm to register a window manager.
 
-PATH=debian:$PATH:/usr/lib/debhelper
-. dh_lib
+BEGIN { push @INC, "debian", "/usr/lib/debhelper" }
+use Dh_Lib;
+init();
 
-wm=$1
+$wm=shift;
 
-if [ -z "$wm" ]; then
-       error "No window manager was specified."
-fi
+if ($wm eq '') {
+       error("No window manager filename was specified.");
+}
 
-for PACKAGE in $DH_DOPACKAGES; do
-       TMP=`tmpdir $PACKAGE`
-       
-       if [ ! "$DH_NOSCRIPTS" ]; then
-               autoscript "postinst" "postinst-wm" "s/#WM#/$wm/"
-               autoscript "postrm" "postrm-wm" "s/#WM#/$wm/"
-       fi
-done
+foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
+#      $TMP=tmpdir($PACKAGE);
+
+       if (! $dh{NOSCRIPTS}) {
+               autoscript($PACKAGE,"postinst","postinst-wm","s/#WM#/$wm/");
+               autoscript($PACKAGE,"postrm","postrm-wm","s/#WM#/$wm/");
+       }
+}
index 9c47a90b46dd6b6e47a2685676c8d7cdffebed5e..4ab9041ab4319cc39f9a3ae5a19fe04e1e7ef093 100755 (executable)
@@ -1,27 +1,35 @@
-#!/bin/sh -e
+#!/usr/bin/perl -w
 #
 # Generate a DEBIAN/md5sums file, that lists the md5sums of all files in the
 # package.
 
-PATH=debian:$PATH:/usr/lib/debhelper
-. dh_lib
+use Cwd;
+BEGIN { push @INC, "debian", "/usr/lib/debhelper" }
+use Dh_Lib;
+init();
 
-for PACKAGE in $DH_DOPACKAGES; do
-       TMP=`tmpdir $PACKAGE`
+foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
+       $TMP=tmpdir($PACKAGE);
 
-       if [ ! -d "$TMP/DEBIAN" ]; then
-               doit "install -d $TMP/DEBIAN"
-       fi
+       if (! -d "$TMP/DEBIAN") {
+               doit("install","-d","$TMP/DEBIAN");
+       }
 
        # Check if we should exclude conffiles.
-       if [ ! "$DH_INCLUDE" -a -r $TMP/DEBIAN/conffiles ]; then
-               # Generate exclude regexp. Using perl here may be overkill,
-               # but it does insure conffiles with spaces in them work.
-               exclude=`perl -ne 'chomp; s/^\///; print "! -path \"$_\" "' $TMP/DEBIAN/conffiles`
-       fi
+       my $exclude="";
+       if (! $dh{INCLUDE} && -r "$TMP/DEBIAN/conffiles") {
+               # Generate exclude regexp.
+               open (CONFF,"$TMP/DEBIAN/conffiles");
+               while (<CONFF>) {
+                       chomp;
+                       s/^\///;
+                       $exclude.="! -path \"$_\" ";
+               }
+               close CONFF;
+       }
 
-       olddir=`pwd`
-       complex_doit "cd $TMP ; find * -type f $exclude ! -regex '^DEBIAN/.*' -print0 | xargs -0 md5sum > DEBIAN/md5sums ; cd $olddir"
-       doit "chmod 644 $TMP/DEBIAN/md5sums"
-       doit "chown root.root $TMP/DEBIAN/md5sums"
-done
+       $olddir=getcwd();
+       complex_doit("cd $TMP ; find * -type f $exclude ! -regex '^DEBIAN/.*' -print0 | xargs -0 md5sum > DEBIAN/md5sums ; cd $olddir");
+       doit("chmod",644,"$TMP/DEBIAN/md5sums");
+       doit("chown","root.root","$TMP/DEBIAN/md5sums");
+}
index bc8aa5f26a92294991f088cb293d8427f459aadd..f6d02bc18500571bf5f2cf7383dac0c66a41899f 100755 (executable)
@@ -54,6 +54,10 @@ for PACKAGE in $DH_DOPACKAGES; do
                        
                        autoscript "postinst" "postinst-suid" "$sedstr"
                        autoscript "postrm" "postrm-suid" "$sedstr"
+                       
+                       if [ -e "$TMP/$file" ]; then
+                               doit "chmod a-s $TMP/$file"
+                       fi
                done
        fi
 done
index edce61d05560d13e6b665b8307fa5293a7aa58ee..ee804aff999f9c80b61e4188e3c08a90cb87cc7e 100644 (file)
@@ -26,6 +26,10 @@ will automatically register all files it finds.
 Note that this program modifies your postinst and postrm files. See
 .BR dh_installdeb (1)
 for an explanation of how this works.
+.P
+Also note that all files registered by this program will *not* be suid in the
+resulting .deb file. The postinst of the package will set their permissions
+(even if the user doesn't have suidmanager installed).
 .SH OPTIONS
 .TP
 .B debhelper options