3 # helper script to regenerate missing SKEYs and GKEYs
5 use Digest::MD5 qw(md5_hex);
8 $spool = $pw[7].'/spool';
9 chdir $spool or die "$spool - $!";
11 foreach $suf (glob "*/\@SUBUSER") {
12 if (-f $suf and open $suf,$suf) {
22 $skey = md5_hex("$user:$from:$id");
23 unless (-f ".skeys/$skey") {
24 if (open $skey,">.skeys/$skey") {
25 warn "creating $spool/.skeys/$skey\n";
26 print {$skey} "from=$from\n";
27 print {$skey} "to=$to\n";
28 print {$skey} "id=$id\n";
38 foreach $guf (glob "*/\@GROUP/*") {
39 if (-f $guf and not -l $guf and open $guf,$guf) {
40 $group = $user = $guf;
49 $gkey = md5_hex("$user:$group:$from:$id");
50 unless (-f ".gkeys/$gkey") {
51 if (open $gkey,">.gkeys/$gkey") {
52 warn "creating $spool/.gkeys/$gkey\n";
53 print {$gkey} "from=$from\n";
54 print {$gkey} "to=\@$group\n";
55 print {$gkey} "user=$user\n";
56 print {$gkey} "id=$id\n";