summaryrefslogtreecommitdiffstats
path: root/move
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-10-31 12:03:28 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-10-31 12:03:28 +0000
commitf7f35c59cb1b56965da1031dedae180bf28667fb (patch)
treea8c1418b518674a65130837f9f42f4ddc6ccad05 /move
parent76d3d95775674636aa96aecb19cd428a9da9f9c4 (diff)
downloaddrakx-f7f35c59cb1b56965da1031dedae180bf28667fb.tar
drakx-f7f35c59cb1b56965da1031dedae180bf28667fb.tar.gz
drakx-f7f35c59cb1b56965da1031dedae180bf28667fb.tar.bz2
drakx-f7f35c59cb1b56965da1031dedae180bf28667fb.tar.xz
drakx-f7f35c59cb1b56965da1031dedae180bf28667fb.zip
- add /etc/sudoers
- don't use "su" for the moment, it doesn't allow startkde to exit nicely (why??)
Diffstat (limited to 'move')
-rw-r--r--move/move.pm11
1 files changed, 9 insertions, 2 deletions
diff --git a/move/move.pm b/move/move.pm
index f21a27498..6320cbea5 100644
--- a/move/move.pm
+++ b/move/move.pm
@@ -38,7 +38,8 @@ sub init {
foreach qw(encodings.dir app-defaults applnk fs lbxproxy proxymngr rstart wmsession.d xinit.d xinit xkb xserver xsm);
#- to be able to adduser, one need to have /etc/passwd and /etc/group writable
- system("cp /image/etc/{passwd,group} /etc");
+ #- sudoers must a file, not a symlink
+ system("cp /image/etc/{passwd,group,sudoers} /etc");
#- free up stage1 memory
fs::umount($_) foreach qw(/stage1/proc /stage1);
@@ -102,7 +103,13 @@ Continue at your own risk."), formatError($@) ]) if $@;
if (fork()) {
sleep 1;
log::l("DrakX waves bye-bye");
- exec 'su', 'mdk', 'startkde';
+
+ (undef, undef, my $uid, my $gid, undef, undef, undef, my $home) = getpwnam('mdk');
+ $( = $) = "$gid $gid";
+ $< = $> = $uid;
+ $ENV{LOGNAME} = $ENV{USER} = 'mdk';
+ $ENV{HOME} = $home;
+ exec 'startkde';
} else {
exec 'xwait' or c::_exit(0);
}