fai: fcopy does not resolve uid/gid
Michael Tautschnig
michael.tautschnig at zt-consulting.com
Mon May 23 20:36:40 CEST 2005
Hi Steffen,
if you're still interested in that problem - could you give the following patch
a try? IMHO the problem is, that logcheck does not exist within your nfsroot, it
only exists on the future client. Thus I'd chroot before doing
getpwnam/getgrnam.
diff -rN -u old-MT_FAI/scripts/fcopy new-MT_FAI/scripts/fcopy
--- old-MT_FAI/scripts/fcopy 2005-05-17 15:01:06.000000000 +0200
+++ new-MT_FAI/scripts/fcopy 2005-05-23 20:33:40.000000000 +0200
@@ -178,8 +178,8 @@
# convert names to numeric uid, gid
my ($user,$group) = @_;
- my $uid = ($user =~ /^\d+$/) ? $user : getpwnam $user;
- my $gid = ($group =~ /^\d+$/) ? $group : getgrnam $group;
+ my $uid = ($user =~ /^\d+$/) ? $user : `$ENV{ROOTCMD} perl -e '\$uid = getpwnam $user; print \$uid'`;
+ my $gid = ($group =~ /^\d+$/) ? $group : `$ENV{ROOTCMD} perl -e '\$gid = getgrnam $group; print \$gid'`;
warn "name2id $user = $uid ; $group = $gid\n" if $debug;
return ($uid,$gid);
}
Thanks in advance,
Michael
More information about the linux-fai
mailing list