Now a non-root user can make a root_fs, the administrator has to add an entry

for each user to the fstab, right now there is just a generic location for all
users.  Special files aren't copied over if permissions don't allow it, but
devfs more than solves that problem!
This commit is contained in:
freesource
2001-10-17 05:19:19 +00:00
parent 41df0e88aa
commit fef993baf9
2 changed files with 61 additions and 21 deletions
+22 -10
View File
@@ -1094,15 +1094,21 @@ sub copy_strip_file {
}
# Copy file perms and owner
my($mode, $uid, $gid);
(undef, undef, $mode, undef, $uid, $gid) = stat $from;
my $from_base = basename($from);
chown($uid, $gid, $to) or ($error =
error("chown: $! \($from_base\)\n"));
return "ERROR"if $error && $error eq "ERROR";
chmod($mode, $to) or ($error =
error("chmod: $! \($from_base\)\n"));
return "ERROR"if $error && $error eq "ERROR";
## non-root users will experience problems here so this is
## skipped. --freesource
if ( $< == 0 ) {
my($mode, $uid, $gid);
(undef, undef, $mode, undef, $uid, $gid) = stat $from;
my $from_base = basename($from);
chown($uid, $gid, $to) or ($error =
error("chown: $! \($from_base\)\n"));
return "ERROR"if $error && $error eq "ERROR";
chmod($mode, $to) or ($error =
error("chmod: $! \($from_base\)\n"));
return "ERROR"if $error && $error eq "ERROR";
}
}
else {
# Normal copy, no strip
@@ -1583,7 +1589,13 @@ sub mount_device {
$options = "";
}
errmk(sys("mount $options -t ext2 $device $mount_point"));
if ( $< == 0 ) {
errmk(sys("mount $options -t ext2 $device $mount_point"));
}
else {
errmk(sys("mount $mount_point"));
}
}