Commit a0c3aaf4 authored by Russ Fish's avatar Russ Fish

Use Ops/FS as the Samba server. More tweaks.

parent 3c1a5bad
......@@ -171,7 +171,7 @@ sub doboot()
# server. All that's left is to CygWin mount the //fs directory paths.
if (WINDOWS()) {
while (($remote, $local) = each %mounts) {
my $host = "fs.bsd-fs.testbed.emulab.net"; ###"fs";
my $host = "fs";
print "Mount $local from //$host\n";
os_samba_mount($local, $host, 0);
}
......
......@@ -138,14 +138,23 @@ sub os_account_cleanup()
os_accounts_sync();
}
# Clean out the user /sshkeys directories.
$cmd = "$CHOWN -R root /sshkeys";
if (system($cmd) != 0) {
warning("Failed ($cmd): $!");
}
$cmd = "$RM -rf /sshkeys";
if (system($cmd) != 0) {
warning("Failed ($cmd): $!");
# Clean out the user /sshkeys directories, leaving /sshkeys/root alone.
if (opendir(DIRHANDLE, "/sshkeys")) {
while ($name = readdir(DIRHANDLE)) {
if ($name =~ m/^\.+/ || $name =~ m/^root$/) {
next;
}
$cmd = "$CHOWN -R root /sshkeys/$name";
if (system($cmd) != 0) {
warning("Failed ($cmd): $!");
}
$cmd = "$RM -rf /sshkeys/$name";
if (system($cmd) != 0) {
warning("Failed ($cmd): $!");
}
}
closedir(DIRHANDLE);
}
# Clean out the /proj directories.
......@@ -280,8 +289,9 @@ sub os_accounts_start()
return -1;
}
if (! open(USERSHELLS, "> $usershellsfile")) {
warning("os_accounts_start: Cannot create $usershellsfile .\n");
# Don't wipe out previous user shell preferences, just add new ones.
if (! open(USERSHELLS, ">> $usershellsfile")) {
warning("os_accounts_start: Cannot create or append to $usershellsfile .\n");
return -1;
}
......@@ -578,6 +588,10 @@ sub os_samba_mount($$$)
{
my ($local, $host, $verbose) = @_;
# Unmount each one first, ignore errors.
$cmd = "$UMOUNT $local";
system($cmd);
# Make the CygWin mount from the Samba path to the local mount point directory.
my $sambapath = $local;
$sambapath =~ s|.*/(.*)|//$host/$1|;
......@@ -598,7 +612,7 @@ sub os_samba_mount($$$)
# mount: defaulting to '--no-executable' flag for speed since native path
# references a remote share. Use '-f' option to override.
# Even with -E, exe's and scripts still work properly, so put it in.
$cmd = "$MOUNT -E $sambapath $local";
$cmd = "$MOUNT -f -E $sambapath $local";
if (system($cmd) != 0) {
warning("os_samba_mount: Failed, $cmd.\n");
}
......
......@@ -18,11 +18,6 @@ uname -r > $iscygwin
chmod g+w $iscygwin
chmod -f g-w /etc/emulab
# Set up to run rc.cygwinxp-user as part of all logins.
regtool -s set \
/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Run/EmulabLogin \
'C:\cygwin\bin\bash /usr/local/etc/emulab/rc/rc.cygwinxp-user'
# Make sure the computer name is right, reboots to change it if necessary.
nodeid=`$tmcc nodeid`
hostname=`/bin/hostname`
......
......@@ -15,8 +15,7 @@ PATH=/usr/local/etc/emulab:/bin:$PATH
export PATH
# Samba server.
###host=fs
host=fs.bsd-fs.testbed.emulab.net
host=fs
# Explanation: Shares are local to the Win32 login session context.
# We must process a user name and password for the first one to be opened, and it
......@@ -31,6 +30,10 @@ fi
# Get the password for the user.
user=`id -un`
# Root isn't a real login, use the swapper's login instead.
if [ $user == root ]; then
user=`tmcc creator | sed 's|.*SWAPPER=\([^ ]*\).*|\1|'`
fi
pswd=`tmcc accounts | awk '/^ADDUSER LOGIN='$user' /{print substr($0,index($0," PSWD=")+9,8)}'`
if [ -z "$pswd" ]; then
echo "No account for user $user, so no remote file access."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment