From 41c0e2d114d9ed11dbf2a20c23bf8eeeb2339439 Mon Sep 17 00:00:00 2001 From: freesource Date: Tue, 23 Oct 2001 06:25:36 +0000 Subject: [PATCH] Checking for permissions, will need to make sure that Deb.pm is doing all its stuff in the personal tmp directory. --- swim | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/swim b/swim index da285a7..89051a3 100755 --- a/swim +++ b/swim @@ -793,7 +793,7 @@ sub command { initndb(\%commands); } elsif ($commands{"ndb"}) { - require SWIM::NDB_Init; + require SWIM::NDB_Init; SWIM::NDB_Init->import(qw(initndb)); initndb(\%commands); } @@ -805,23 +805,28 @@ sub command { my $dpkg_status = "$parent$library/status"; my $my_status = "$main::home$parent$library/status"; if (!-f $my_status) { + # If /tmp is executable good, but -p will still fail. if ( (!-x $tmp && !-w $tmp) || - !-x $tmp || + (-x $tmp && !-w $tmp) || - !-w $tmp + (!-x && -w $tmp) ) { print STDERR "swim: $tmp is not "; + print STDERR "readable" if !-r $tmp; + print STDERR "/" if !-r $tmp && !-w $tmp; print STDERR "writable" if !-w $tmp; - print STDERR "/" if !-w $tmp; + print STDERR "/" if !-w $tmp || !-r $tmp; print STDERR "executable" if !-x $tmp; print STDERR " by your effective uid/gid\n"; print STDERR "swim: set \$tmp to a directory "; + print STDERR "readable" if !-r $tmp; + print STDERR "/" if !-r $tmp && !-w $tmp; print STDERR "writable" if !-w $tmp; - print STDERR "/" if !-w $tmp; + print STDERR "/" if !-w $tmp || !-r $tmp; print STDERR "executable" if !-x $tmp; print STDERR " by your effective uid/gid " . "in $ENV{HOME}/.swimrc\n"; @@ -853,21 +858,25 @@ sub command { if ( $diff ) { if ( (!-x $tmp && !-w $tmp) || - - !-x $tmp || + + (-x $tmp && !-w $tmp) || - !-w $tmp + (!-x && -w $tmp) ) { print STDERR "swim: $tmp is not "; + print STDERR "readable" if !-r $tmp; + print STDERR "/" if !-r $tmp && !-w $tmp; print STDERR "writable" if !-w $tmp; - print STDERR "/" if !-w $tmp; + print STDERR "/" if !-w $tmp || !-r $tmp; print STDERR "executable" if !-x $tmp; print STDERR " by your effective uid/gid\n"; - + print STDERR "swim: set \$tmp to a directory "; + print STDERR "readable" if !-r $tmp; + print STDERR "/" if !-r $tmp && !-w $tmp; print STDERR "writable" if !-w $tmp; - print STDERR "/" if !-w $tmp; + print STDERR "/" if !-w $tmp || !-r $tmp; print STDERR "executable" if !-x $tmp; print STDERR " by your effective uid/gid " . "in $ENV{HOME}/.swimrc\n";