|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T g
Length: 1776 (0x6f0)
Types: TextFile
Names: »get-cf«
└─⟦4f9d7c866⟧ Bits:30007245 EUUGD6: Sikkerheds distributionen
└─⟦3da311d67⟧ »./cops/1.04/cops_104.tar.Z«
└─⟦6a2577110⟧
└─⟦4f9d7c866⟧ Bits:30007245 EUUGD6: Sikkerheds distributionen
└─⟦6a2577110⟧ »./cops/1.04/cops_104.tar«
└─⟦this⟧ »cops_104/perl/get-cf«
#! /usr/local/bin/perl
@dot_files = (
".login", ".logout", ".cshrc", # csh, cshe or tcsh
".profile", # ksh, sh
".env", # ksh
".alias", ".aliases", # common for all shells
"user.ps", ".user.ps", "tools.ps", ".tools.ps",
"startup.ps", ".startup.ps", # NeWS
".mgrc", # MGR
".X11init", ".awmrc", ".twmrc", ".xinitrc", # X11
".emacs" # emacs
);
%seen = {};
open(HOST, "/bin/hostname |") || die "can't get the hostname";
chop($hostname=<HOST>);
close(HOST);
user_loop:
for (($name,$passwd,$uid,$gid,$quota,$comment,$gcos,$dir,$shell) = getpwent();
$name ne "";
($name,$passwd,$uid,$gid,$quota,$comment,$gcos,$dir,$shell) = getpwent()) {
#
# If the user has a home directory on this server, get the info
# about the directory, his CF's and so on.
#
if ($dir =~ m,^/n/$hostname/,) {
if (! -d $dir) {
printf(stderr "home directory '%s' for user '%s' doesn't exist.\n",
$dir,
$name);
next user_loop;
}
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
$atime,$mtime,$ctime,$blksize,$blocks)
= stat(_);
$mode = $mode & 07777;
&spit_it_out("d", $uid, $gid, $mode, $dir);
foreach $file (@dot_files) {
$path = "$dir/$file";
if (-f $path) {
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
$atime,$mtime,$ctime,$blksize,$blocks)
= stat(_);
$mode = $mode & 07777;
&spit_it_out("f", $uid, $gid, $mode, $dir);
}
}
}
}
sub spit_it_out {
local($type, $uid, $gid, $mode, $name) = @_;
if (defined($seen{$name})) {
return;
}
printf("%s %d %d 0%o %s\n", $type, $uid, $gid, $mode, $name);
$seen{$name} = 1;
}