home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
c
/
cops_104.zip
/
cops_104
/
extra_src
/
uucp_quick.chk
< prev
Wrap
Text File
|
1992-03-10
|
935b
|
33 lines
#!/bin/sh
#
# By wietse@wzv.win.tue.nl (Wietse Venema). This will be folded into
# the rest of cops and the uucp stuff, when I get a breath to take.
#
#
# This script does almost nothing if there is no UUCP account.
# On some systems, even local users can uucp files from selected
# directories only. Often, these are also UUCP login directories,
# and often they are world-writable. Use /tmp as a final resort.
for i in /usr/spool/uucppublic /usr/spool/uucp /tmp
do
if touch $i/XX.$$ 2>/dev/null
then
cd $i
break;
fi
done
# I forgot how COPS deals with the presence or absence of NIS...
(cat /etc/passwd ; ypcat passwd) 2>/dev/null |
awk -F: '/uucp/ { print $1,$(NF-1) }' | while read user home
do
uucp XX.$$ !$home/YY.$$ 2>/dev/null &&
echo uucp copies files to home directory $home of account $user
done
# Clean up; too bad we cannot unlink the files we may have installed...
rm -f XX.$$ $home/YY.$$