summaryrefslogtreecommitdiff
path: root/dh_suidregister
diff options
context:
space:
mode:
authorjoey <joey>2001-01-10 22:21:55 +0000
committerjoey <joey>2001-01-10 22:21:55 +0000
commit0f67d07da233d81970617f552f5c83176b048fd2 (patch)
tree8f3a718ef38cdabeef2c784fb90e5270eff62d71 /dh_suidregister
parente4b1e959c35acf5b49f4c4950c33cdb71f4f8613 (diff)
r407: * suidmanager is obsolete now, and so is dh_suidmanager. Instead,
packages that contain suid binaries should include the binaries suid in the .deb, and dpkg-statoverride can override this. If this is done to a program that previously used suidmanager, though, you need to conflict with suidmanager (<< 0.50). * Made dh_suidmanager check to see if it would have done anything before. If so, it states that it is obsolete, and refer users to the man page, which now explains the situation, and then aborts the build. If it would have done nothing before, it just outputs a warning that it is an obsolete program.
Diffstat (limited to 'dh_suidregister')
-rwxr-xr-xdh_suidregister66
1 files changed, 13 insertions, 53 deletions
diff --git a/dh_suidregister b/dh_suidregister
index 08cc3248..bbadddf8 100755
--- a/dh_suidregister
+++ b/dh_suidregister
@@ -1,18 +1,19 @@
#!/usr/bin/perl -w
#
-# If no parameters are given, and no debian/suid files exists, scan for
-# suid/sgid files and suidregister them.
-#
-# If there are parameters, or there is a debian/suid, register the files
-# listed there.
+# Obsolete.
use Debian::Debhelper::Dh_Lib;
init();
+my $notused=1;
+
foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
$TMP=tmpdir($PACKAGE);
$suid=pkgfile($PACKAGE,"suid");
+ # All this code is here just to see if we would have done something
+ # before..
+
@files=();
if ($suid) {
@files=filearray($suid, $TMP);
@@ -26,56 +27,15 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
# No files specified (and no empty debian/suid file), so
# guess what files to process.
@files=split(/\n/,`find $TMP -type f -perm +6000`);
-
- # We will strip the debian working directory off of the
- # filenames.
- $tostrip="$TMP/";
- }
- else {
- # We will strip leading /'s, so the user can feed this
- # program either absolute filenames, or relative filenames,
- # and it will do the right thing either way.
- $tostrip="/";
}
- # Register files with suidregister.
- foreach $file (@files) {
- # Strip leading $tostrip from $file.
- $file=~s/^$tostrip//;
-
- if (! -e "$TMP/$file") {
- error("\"$TMP/$file\" does not exist.");
- }
-
- # Create the sed string that will be used to
- # fill in the blanks in the autoscript files.
- # Fill with the owner, group, and perms of the file.
- (undef,undef,$mode,undef,$uid,$gid,undef) = stat("$TMP/$file");
- # Now come up with the user and group names for the uid and gid.
- $user=getpwuid($uid);
- if (! defined $user) {
- warning("$file has odd uid $uid, not in /etc/passwd");
- $user=$uid;
- }
- $group=getgrgid($gid);
- if (! defined $group) {
- warning("$file has odd gid $gid not in /etc/group");
- $group=$gid;
- }
- # Note that I have to print mode in ocal, stripping file type.
- $sedstr=sprintf("s:#FILE#:$file:;s/#PACKAGE#/$PACKAGE/;s/#OWNER#/$user/;s/#GROUP#/$group/;s/#PERMS#/%#o/",
- $mode & 07777);
-
- autoscript($PACKAGE,"postinst","postinst-suid",$sedstr);
- autoscript($PACKAGE,"postrm","postrm-suid","$sedstr");
+ if (@files) {
+ # So we would have registered some files before.
+ error("This program should no longer be used. Please read the dh_suidregister(1) man page.");
}
+}
- # Remove suid bits from files. This is delayed to this point, because
- # of a situation with hard linked files if it is done earlier.
- # See changelog for 2.0.77.
- foreach $file (@files) {
- if ( -e "$TMP/$file") {
- doit("chmod","a-s","$TMP/$file");
- }
- }
+# Although they called it, it's not going to do anything.
+if ($notused) {
+ warning("This program is obsolete and may be safely removed from your rules file.");
}