mirror of
https://github.com/fspc/gbootroot.git
synced 2026-09-08 12:51:40 -04:00
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:
+22
-10
@@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user