Commit 07185b10 authored by Russ Fish's avatar Russ Fish

Remove some outdated Windows scripts

parent a900769b
...@@ -87,8 +87,6 @@ sysetc-remove: ...@@ -87,8 +87,6 @@ sysetc-remove:
script-install: dir-install $(SCRIPTS) script-install: dir-install $(SCRIPTS)
$(INSTALL) -m 755 $(SRCDIR)/liblocsetup.pm $(BINDIR)/liblocsetup.pm $(INSTALL) -m 755 $(SRCDIR)/liblocsetup.pm $(BINDIR)/liblocsetup.pm
$(INSTALL) -m 755 $(SRCDIR)/startsshd $(BINDIR)/startsshd
$(INSTALL) -m 755 $(SRCDIR)/stopsshd $(BINDIR)/stopsshd
$(INSTALL) -m 755 $(SRCDIR)/prepare $(BINDIR)/prepare $(INSTALL) -m 755 $(SRCDIR)/prepare $(BINDIR)/prepare
$(INSTALL) -m 755 $(SRCDIR)/tbshutdown $(BINDIR)/tbshutdown $(INSTALL) -m 755 $(SRCDIR)/tbshutdown $(BINDIR)/tbshutdown
$(INSTALL) -c -m 755 -o root -g wheel -d /sbin $(INSTALL) -c -m 755 -o root -g wheel -d /sbin
...@@ -100,8 +98,6 @@ script-install: dir-install $(SCRIPTS) ...@@ -100,8 +98,6 @@ script-install: dir-install $(SCRIPTS)
$(INSTALL) -m 755 $(SRCDIR)/sudo.dummy /bin/sudo $(INSTALL) -m 755 $(SRCDIR)/sudo.dummy /bin/sudo
$(INSTALL) -m 755 $(SRCDIR)/rc.firstboot $(BINDIR)/rc/rc.firstboot $(INSTALL) -m 755 $(SRCDIR)/rc.firstboot $(BINDIR)/rc/rc.firstboot
$(INSTALL) -m 755 $(SRCDIR)/rc.cygwinxp $(BINDIR)/rc/rc.cygwin $(INSTALL) -m 755 $(SRCDIR)/rc.cygwinxp $(BINDIR)/rc/rc.cygwin
# The following will fail if the user login script is still busy in a shell.
-$(INSTALL) -m 755 $(SRCDIR)/rc.cygwinxp-user $(BINDIR)/rc/rc.cygwinxp-user
sfs-install: sfs-install:
......
#!/bin/bash
#
# EMULAB-COPYRIGHT
# Copyright (c) 2004 University of Utah and the Flux Group.
# All rights reserved.
#
# CygWin user setup for each rdesktop login. This gets run from a Registry key:
# HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run\EmulabLogin
# with value:
# C:\cygwin\bin\bash /usr/local/etc/emulab/rc/rc.cygwinxp-user
#
# We also arrange for this to be run by login shells under ssh.
PATH=/usr/local/etc/emulab:/bin:`cygpath -u "$SYSTEMROOT/system32"`:$PATH
export PATH
# Samba server.
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
# has to go onto a drive letter. After that, we can use UNC //host paths freely.
# Nothing to do if the mount has already been done.
if (net use | grep -q Z:); then
##echo "Remote directories have already been enabled by a Z: mount."
##sleep 5
exit 0
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 windows | awk '/^ADDUSER LOGIN='$user' /{print substr($0,index($0," PSWD=")+6,8)}'`
if [ -z "$pswd" ]; then
echo "No account for user $user, so no remote file access."
sleep 5
exit 1
fi
echo "Connecting Z: to //$host as $user."
if ! net use Z: '\\'$host'\'$user "$pswd" /user:$host'\'$user /persistent:no; then
echo "Connection failed."
else
# Show network mount status.
net use
fi
sleep 5
exit 0
#!/bin/bash
#
# EMULAB-COPYRIGHT
# Copyright (c) 2004 University of Utah and the Flux Group.
# All rights reserved.
#
# Run the SSH daemon in the Win32 login session context, so ssh client sessions
# will see the same set of mounts when they come in AS THIS SAME USER.
#
# Other users need to come is as rdesktop first if they want ssh sessions with
# their remote homedirs mounted. Doing this disconnects the first rdesktop session
# after 20 seconds, but reconnecting as the original user gets it right back.
# Microsoft cripples Citrix/Hydra on XP to only allow one rdesktop session at a time.
#
# Do "ssh pcNNN qwinsta" (Query WINdows STAtion) to show the sessions remotely.
# Use "ssh pcNNN rwinsta ID" to kill a session by session ID.
# If you're logged in via rdesktop, see the Users tab in Task Manager.
pidfile=/var/run/sshd.pid
upidfile=$pidfile.user
running=
if [ -e $upidfile ]; then
# Check that the process ID actually refers to a running process.
pid=`cat $upidfile`
if ( kill -0 $pid >& /dev/null ); then
running=yes
fi
fi
if [ $running ]; then
if ( ps -u SYSTEM | grep -q "^ *$pid " ); then
echo "Ignoring SYSTEM sshd."
else
# Kill a previous copy of sshd, so we can run one as this user.
echo "Killing previous user sshd daemon."
ps -ef | awk '$2=='$pid'{print}'
kill $pid
fi
fi
# Set permissions on the key files needed for sshd to start up as this user.
# Can't steal permissions on the system ones, disables root@boss management via ssh.
# These copies were made as root after configuring sshd.
user=`id -un`
chown $user /etc/ssh*key.user
chmod o-r /etc/ssh*key.user
# Start sshd in the background, orphaned so it doesn't get SIGINT from here.
# The pidfile is updated by sshd itself.
# Don't use privilege separation here, because it requires taking ownership of
# /var/empty, which kills key exchange for the SYSTEM root sshd.
echo "Starting new sshd daemon as $user."
(CYGWIN="ntsec tty" /usr/sbin/sshd -p 2222 -o "UsePrivilegeSeparation no" \
-h /etc/ssh_host_key.user -h /etc/ssh_host_dsa_key.user &)
sleep 2
# Remember this one separately from the SYSTEM sshd.
chmod -f g+w $upidfile >& /dev/null
cp $pidfile $upidfile
chmod -f g+w $upidfile
#!/bin/bash
#
# EMULAB-COPYRIGHT
# Copyright (c) 2004 University of Utah and the Flux Group.
# All rights reserved.
#
# Stop the current the SSH daemon.
pidfile=/var/run/sshd.pid
upidfile=$pidfile.user
running=
if [ -e $upidfile ]; then
# Check that the process ID actually refers to a running process.
pid=`cat $upidfile`
if ( kill -0 $pid >& /dev/null ); then
running=yes
fi
fi
if [ $running ]; then
if ( ps -u SYSTEM | grep -q "^ *$pid " ); then
echo "Ignoring SYSTEM sshd."
else
echo "Killing sshd daemon."
ps -ef | awk '$2=='$pid'{print}'
kill $pid
fi
fi
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