8 opendir(DIR, $config{'at_dir'});
9 while($f = readdir(DIR)) {
10 local $p = "$config{'at_dir'}/$f";
11 if ($f =~ /^(\d+)\.a$/) {
13 local $job = { 'id' => $f,
15 'user' => scalar(getpwuid($st[4])),
16 'created' => $st[9] };
22 $job->{'realcmd'} = $job->{'cmd'};
23 $job->{'realcmd'} =~ s/^[\000-\177]+#ident.*\ncd\s+\S+\numask\s+\S+\n//;
24 $job->{'realcmd'} =~ s/^ulimit\s+\S+\n//;
32 # create_atjob(user, time, commands, directory, send-email)
35 local @tm = localtime($_[1]);
36 local $date = strftime "%H:%M %b %d", @tm;
37 local $mailflag = $_[4] ? "-m" : "";
38 local $cmd = "cd ".quotemeta($_[3])." ; at $mailflag $date";
39 local @uinfo = getpwnam($_[0]);
40 if ($uinfo[2] != $<) {
41 # Only SU if we are not already the user
42 $cmd = &command_as_user($_[0], 0, $cmd);
44 &open_execute_command(AT, "$cmd >/dev/null 2>&1", 0);
47 &additional_log('exec', undef, $cmd);
53 &system_logged("atrm ".quotemeta($_[0]));