| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: at.c,v 1.31 2016/03/13 00:32:09 dholland Exp $ */ | | 1 | /* $NetBSD: at.c,v 1.32 2021/04/02 06:31:53 simonb Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * at.c : Put file into atrun queue | | 4 | * at.c : Put file into atrun queue |
5 | * Copyright (C) 1993, 1994 Thomas Koenig | | 5 | * Copyright (C) 1993, 1994 Thomas Koenig |
6 | * | | 6 | * |
7 | * Atrun & Atq modifications | | 7 | * Atrun & Atq modifications |
8 | * Copyright (C) 1993 David Parsons | | 8 | * Copyright (C) 1993 David Parsons |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -43,45 +43,45 @@ | | | @@ -43,45 +43,45 @@ |
43 | #include <signal.h> | | 43 | #include <signal.h> |
44 | #include <stdbool.h> | | 44 | #include <stdbool.h> |
45 | #include <stddef.h> | | 45 | #include <stddef.h> |
46 | #include <stdio.h> | | 46 | #include <stdio.h> |
47 | #include <stdlib.h> | | 47 | #include <stdlib.h> |
48 | #include <string.h> | | 48 | #include <string.h> |
49 | #include <time.h> | | 49 | #include <time.h> |
50 | #include <unistd.h> | | 50 | #include <unistd.h> |
51 | #include <util.h> | | 51 | #include <util.h> |
52 | | | 52 | |
53 | /* Local headers */ | | 53 | /* Local headers */ |
54 | #include "at.h" | | 54 | #include "at.h" |
55 | #include "panic.h" | | 55 | #include "panic.h" |
56 | #include "parsetime.h" | | 56 | #include "parsetime.h" /* XXX should use parsedate(3) in <util.h> */ |
57 | #include "perm.h" | | 57 | #include "perm.h" |
58 | #include "pathnames.h" | | 58 | #include "pathnames.h" |
59 | #include "stime.h" | | 59 | #include "stime.h" |
60 | #include "privs.h" | | 60 | #include "privs.h" |
61 | | | 61 | |
62 | /* Macros */ | | 62 | /* Macros */ |
63 | #define ALARMC 10 /* Number of seconds to wait for timeout */ | | 63 | #define ALARMC 10 /* Number of seconds to wait for timeout */ |
64 | | | 64 | |
65 | #define TIMESIZE 50 | | 65 | #define TIMESIZE 50 |
66 | | | 66 | |
67 | enum { ATQ, ATRM, AT, BATCH, CAT }; /* what program we want to run */ | | 67 | enum { ATQ, ATRM, AT, BATCH, CAT }; /* what program we want to run */ |
68 | | | 68 | |
69 | /* File scope variables */ | | 69 | /* File scope variables */ |
70 | #ifndef lint | | 70 | #ifndef lint |
71 | #if 0 | | 71 | #if 0 |
72 | static char rcsid[] = "$OpenBSD: at.c,v 1.15 1998/06/03 16:20:26 deraadt Exp $"; | | 72 | static char rcsid[] = "$OpenBSD: at.c,v 1.15 1998/06/03 16:20:26 deraadt Exp $"; |
73 | #else | | 73 | #else |
74 | __RCSID("$NetBSD: at.c,v 1.31 2016/03/13 00:32:09 dholland Exp $"); | | 74 | __RCSID("$NetBSD: at.c,v 1.32 2021/04/02 06:31:53 simonb Exp $"); |
75 | #endif | | 75 | #endif |
76 | #endif | | 76 | #endif |
77 | | | 77 | |
78 | const char *no_export[] = {"TERM", "TERMCAP", "DISPLAY", "_"}; | | 78 | const char *no_export[] = {"TERM", "TERMCAP", "DISPLAY", "_"}; |
79 | static int send_mail = 0; | | 79 | static int send_mail = 0; |
80 | | | 80 | |
81 | /* External variables */ | | 81 | /* External variables */ |
82 | | | 82 | |
83 | extern char **environ; | | 83 | extern char **environ; |
84 | bool fcreated = false; | | 84 | bool fcreated = false; |
85 | char atfile[FILENAME_MAX]; | | 85 | char atfile[FILENAME_MAX]; |
86 | | | 86 | |
87 | char *atinput = NULL; /* where to get input from */ | | 87 | char *atinput = NULL; /* where to get input from */ |