Browse Source

This changes real uid id to effective uid id.

master
freesource 24 years ago
parent
commit
cfa9689f91
  1. 4
      BootRoot/Yard.pm
  2. 19
      gbootroot

4
BootRoot/Yard.pm

@ -1097,7 +1097,7 @@ sub copy_strip_file {
## non-root users will experience problems here so this is ## non-root users will experience problems here so this is
## skipped. --freesource ## skipped. --freesource
if ( $< == 0 ) { if ( $> == 0 ) {
my($mode, $uid, $gid); my($mode, $uid, $gid);
(undef, undef, $mode, undef, $uid, $gid) = stat $from; (undef, undef, $mode, undef, $uid, $gid) = stat $from;
my $from_base = basename($from); my $from_base = basename($from);
@ -1589,7 +1589,7 @@ sub mount_device {
$options = ""; $options = "";
} }
if ( $< == 0 ) { if ( $> == 0 ) {
errmk(sys("mount $options -t ext2 $device $mount_point")); errmk(sys("mount $options -t ext2 $device $mount_point"));
} }
else { else {

19
gbootroot

@ -528,13 +528,22 @@ if ( $< == 0 ) {
} }
else { else {
# Hopefully only one user at a time. # The Administrator just needs to add a line like this to the fstab for
if (!-d "$tmp1/gboot_non_root") { # each non-root user who wants to be able to create root_fs.
$tmp = "$tmp1/gboot_non_root" if err_custom_perl( # Ofcourse the user is locked into the ext2 fs in this example
"mkdir $tmp1/gboot_non_root", #
# /tmp/gboot_non_root_`id -u`/root_fs \
# /tmp/gboot_non_root_`id -u`/loopback \
# ext2 defaults,noauto,user,loop 0 0
my $user = $>;
if (!-d "$tmp1/gboot_non_root_" . $user) {
$tmp = "$tmp1/gboot_non_root" . $user if err_custom_perl(
"mkdir $tmp1/gboot_non_root" . $user,
"gBootRoot: ERROR: Could not make temporary directory") != 2; "gBootRoot: ERROR: Could not make temporary directory") != 2;
} }
$tmp = "$tmp1/gboot_non_root"; $tmp = "$tmp1/gboot_non_root" . $user;
if (!-d "$tmp1/gbootroot_mnt$time") { if (!-d "$tmp1/gbootroot_mnt$time") {
$mnt = "$tmp1/gbootroot_mnt$time" if err_custom_perl( $mnt = "$tmp1/gbootroot_mnt$time" if err_custom_perl(

Loading…
Cancel
Save