diff --git a/at-3.1.10-daylight.patch b/at-3.1.10-daylight.patch deleted file mode 100644 index 62b19f2..0000000 --- a/at-3.1.10-daylight.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- at-3.1.10/at.c.daylight 2007-03-31 00:03:47.000000000 +0200 -+++ at-3.1.10/at.c 2007-03-31 00:06:23.000000000 +0200 -@@ -840,8 +840,9 @@ - - if( tm.tm_mday ) - { -- tm.tm_isdst = tm_now.tm_isdst; -- return mktime(&tm); -+ tm.tm_isdst = -1; -+ t = mktime(&tm); -+ return t; - } else - return 0L; - } diff --git a/at-3.1.10-debug.patch b/at-3.1.10-debug.patch deleted file mode 100644 index 7cedfa0..0000000 --- a/at-3.1.10-debug.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- at-3.1.10/Makefile.in.debug 2007-03-06 11:35:28.000000000 +0100 -+++ at-3.1.10/Makefile.in 2007-03-06 14:50:07.000000000 +0100 -@@ -104,14 +104,14 @@ - chown $(DAEMON_USERNAME):$(DAEMON_GROUPNAME) $(IROOT)$(ATJOB_DIR) $(IROOT)$(ATSPOOL_DIR) - test -f $(IROOT)$(etcdir)/at.allow || test -f $(IROOT)$(etcdir)/at.deny || $(INSTALL) -m 600 at.deny $(IROOT)$(etcdir)/ - $(INSTALL) -o $(INSTALL_ROOT_USER) -g $(DAEMON_GROUPNAME) pam_atd $(IROOT)$(etcdir)/pam.d/atd -- $(INSTALL) -m 4755 -s at $(IROOT)$(bindir) -+ $(INSTALL) -m 4755 at $(IROOT)$(bindir) - $(LN_S) -f at $(IROOT)$(bindir)/atq - $(LN_S) -f at $(IROOT)$(bindir)/atrm - $(INSTALL) -m 755 batch $(IROOT)$(bindir) - $(INSTALL) -m 755 -d $(IROOT)$(man1dir) - $(INSTALL) -m 755 -d $(IROOT)$(man5dir) - $(INSTALL) -m 755 -d $(IROOT)$(man8dir) -- $(INSTALL) -m 755 -s atd $(IROOT)$(sbindir) -+ $(INSTALL) -m 755 atd $(IROOT)$(sbindir) - $(INSTALL) -m 755 atrun $(IROOT)$(sbindir) - $(INSTALL) -m 644 at.1 $(IROOT)$(man1dir)/ - cd $(IROOT)$(man1dir) && $(LN_S) -f at.1 atq.1 && $(LN_S) -f at.1 batch.1 && $(LN_S) -f at.1 atrm.1 diff --git a/at-3.1.10-instinet.patch b/at-3.1.10-instinet.patch deleted file mode 100644 index fc480cb..0000000 --- a/at-3.1.10-instinet.patch +++ /dev/null @@ -1,245 +0,0 @@ ---- at-3.1.10/atd.c.instinet 2006-09-12 11:01:10.000000000 +0200 -+++ at-3.1.10/atd.c 2006-09-12 11:24:49.000000000 +0200 -@@ -102,7 +102,7 @@ - static const char *svnid = "$Id$"; - static double load_avg = LOADAVG_MX; - static time_t now; --static time_t last_chg; -+//static time_t last_chg; - static int nothing_to_do; - unsigned int batch_interval; - static int run_as_daemon = 0; -@@ -197,7 +197,7 @@ - #endif - - static void --run_file(const char *filename, uid_t uid, gid_t gid) -+run_file(char *filename, uid_t uid, gid_t gid) - { - /* Run a file by by spawning off a process which redirects I/O, - * spawns a subshell, then waits for it to complete and sends -@@ -208,7 +208,7 @@ - char jobbuf[9]; - char *mailname = NULL; - int mailsize = 128; -- char *newname; -+ char newname[256]; - FILE *stream; - int send_mail = 0; - struct stat buf, lbuf; -@@ -242,11 +242,17 @@ - - sprintf(jobbuf, "%8lu", jobno); - -- if ((newname = malloc(strlen(filename) + 1)) == NULL) -- pabort("Job %8lu : out of virtual memory", jobno); -+ if( strlen( filename ) >= sizeof( newname ) - 1 ) -+ pabort("File name too long: %s", filename ); - - strcpy(newname, filename); - -+ newname[0] = '!'; -+ -+ if( rename( filename, newname ) < 0 ) -+ perr( "Error renaming job file." ); -+ -+ filename[0] = '!'; - newname[0] = '='; - - /* We try to make a hard link to lock the file. If we fail, then -@@ -264,14 +270,15 @@ - } - } - /* If something goes wrong between here and the unlink() call, -- * the job gets restarted as soon as the "=" entry is cleared -- * by the main atd loop. -- */ -+ * the job will remain in the "!" queue. -+ * no point in retrying, and need glaring proof that something went wrong -+ */ - - pid = fork(); -- if (pid == -1) -+ if (pid == -1) { -+ unlink(newname); - perr("Cannot fork"); -- -+ } - else if (pid != 0) { - free(mailname); - free(newname); -@@ -284,6 +291,7 @@ - - pentry = getpwuid(uid); - if (pentry == NULL) { -+ unlink(newname); - pabort("Userid %lu not found - aborting job %8lu (%.500s)", - (unsigned long) uid, jobno, filename); - } -@@ -293,35 +301,43 @@ - - PRIV_END - -- if (stream == NULL) -+ if (stream == NULL) { -+ unlink( newname ); - perr("Cannot open input file"); -- -- if ((fd_in = dup(fileno(stream))) < 0) -+ } -+ if ((fd_in = dup(fileno(stream))) < 0) { -+ unlink( newname ); - perr("Error duplicating input file descriptor"); -- -- if (fstat(fd_in, &buf) == -1) -+ } -+ if (fstat(fd_in, &buf) == -1) { -+ unlink( newname ); - perr("Error in fstat of input file descriptor"); -- -- if (lstat(filename, &lbuf) == -1) -+ } -+ if (lstat(filename, &lbuf) == -1) { -+ unlink( newname ); - perr("Error in fstat of input file"); -- -- if (S_ISLNK(lbuf.st_mode)) -+ } -+ if (S_ISLNK(lbuf.st_mode)) { -+ unlink( newname ); - perr("Symbolic link encountered in job %8lu (%.500s) - aborting", - jobno, filename); -- -+ } - if ((lbuf.st_dev != buf.st_dev) || (lbuf.st_ino != buf.st_ino) || - (lbuf.st_uid != buf.st_uid) || (lbuf.st_gid != buf.st_gid) || -- (lbuf.st_size != buf.st_size)) -+ (lbuf.st_size != buf.st_size)) { -+ unlink( newname ); - perr("Somebody changed files from under us for job %8lu (%.500s) - " - "aborting", jobno, filename); -- -+ } - if (buf.st_nlink > 2) { -+ unlink( newname ); - perr("Somebody is trying to run a linked script for job %8lu (%.500s)", - jobno, filename); - } -- if ((fflags = fcntl(fd_in, F_GETFD)) < 0) -+ if ((fflags = fcntl(fd_in, F_GETFD)) < 0) { -+ unlink( newname ); - perr("Error in fcntl"); -- -+ } - fcntl(fd_in, F_SETFD, fflags & ~FD_CLOEXEC); - - /* -@@ -335,28 +351,44 @@ - mailsize ); - - if (fscanf(stream, fmt, -- &nuid, &ngid, mailname, &send_mail) != 4) -+ &nuid, &ngid, mailname, &send_mail) != 4) { -+ unlink( newname ); - pabort("File %.500s is in wrong format - aborting", - filename); -+ } - -- if (mailname[0] == '-') -+ if (mailname[0] == '-') { -+ unlink( newname ); - pabort("illegal mail name %.300s in job %8lu (%.300s)", mailname, - jobno, filename); -- -- if (nuid != uid) -+ } -+ if (nuid != uid) { -+ unlink( newname ); - pabort("Job %8lu (%.500s) - userid %d does not match file uid %d", - jobno, filename, nuid, uid); -- -+ } -+ if (ngid != gid) { -+ unlink( newname ); -+ pabort("Job %8lu %.500s - groupid %d does not match file gid %d", -+ jobno, filename, ngid, gid); -+ } - /* We are now committed to executing this script. Unlink the - * original. - */ - - unlink(filename); - -+ /* If we bail out from now on, the job gets stuck in "=" -+ * The main loop should take care of that. -+ */ -+ - fclose(stream); -+ - if (chdir(ATSPOOL_DIR) < 0) - perr("Cannot chdir to " ATSPOOL_DIR); - -+ filename[0] = queue; -+ - /* Create a file to hold the output of the job we are about to run. - * Write the mail header. Complain in case - */ -@@ -466,19 +498,19 @@ - #endif - - /* Send mail. Unlink the output file after opening it, so it -- * doesn't hang around after the run. -+ * doesn't hang around after the run (if we are to send mail). - */ -- stat(filename, &buf); -- if (open(filename, O_RDONLY) != STDIN_FILENO) -- perr("Open of jobfile failed"); -- -- unlink(filename); -+ if( send_mail != -1 ) { -+ stat(filename, &buf); -+ if (open(filename, O_RDONLY) != STDIN_FILENO) -+ perr("Open of jobfile failed"); -+ unlink(filename); -+ } - - /* The job is now finished. We can delete its input file. - */ - chdir(ATJOB_DIR); - unlink(newname); -- free(newname); - - if (((send_mail != -1) && (buf.st_size != size)) || (send_mail == 1)) { - -@@ -508,6 +540,8 @@ - exit(EXIT_SUCCESS); - } - -+#define CHECK_INTERVAL_5MIN 300 -+ - static time_t - run_loop() - { -@@ -537,7 +571,7 @@ - * atrun. - */ - -- next_job = now + CHECK_INTERVAL; -+ next_job = now + CHECK_INTERVAL_5MIN; - if (next_batch == 0) - next_batch = now; - -@@ -548,11 +582,11 @@ - - if (stat(".", &buf) == -1) - perr("Cannot stat " ATJOB_DIR); -- -+/* - if (nothing_to_do && buf.st_mtime <= last_chg) - return next_job; - last_chg = buf.st_mtime; -- -+*/ - if ((spool = opendir(".")) == NULL) - perr("Cannot read " ATJOB_DIR); - diff --git a/at-3.1.10-lexer-parser.patch b/at-3.1.10-lexer-parser.patch deleted file mode 100644 index 9280a2e..0000000 --- a/at-3.1.10-lexer-parser.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- at-3.1.10/parsetime.y.parser 2005-08-05 05:31:04.000000000 +0200 -+++ at-3.1.10/parsetime.y 2006-09-07 12:47:45.000000000 +0200 -@@ -55,8 +55,10 @@ - %% - timespec : spec_base - | spec_base inc_or_dec -+ { -+ time_only = 0; -+ } - ; -- - spec_base : date - | time - { diff --git a/at-3.1.10-newpam.patch b/at-3.1.10-newpam.patch deleted file mode 100644 index e41ca06..0000000 --- a/at-3.1.10-newpam.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- at-3.1.10/pam_atd.newpam 2007-01-30 13:04:19.000000000 +0100 -+++ at-3.1.10/pam_atd 2007-01-30 13:02:09.000000000 +0100 -@@ -0,0 +1,13 @@ -+# The PAM configuration file for the at daemon -+# -+# -+auth sufficient pam_rootok.so -+auth include system-auth -+auth required pam_env.so -+account include system-auth -+session required pam_loginuid.so -+session include system-auth -+# Sets up user limits, please uncomment and read /etc/security/limits.conf -+# to enable this functionality. -+# session required pam_limits.so -+# diff --git a/at-3.1.10-perm.patch b/at-3.1.10-perm.patch index 27cd5a4..0df57f5 100644 --- a/at-3.1.10-perm.patch +++ b/at-3.1.10-perm.patch @@ -1,12 +1,11 @@ ---- at-3.1.10/at.c.perm 2007-07-02 15:40:35.000000000 +0200 -+++ at-3.1.10/at.c 2007-07-02 16:19:54.000000000 +0200 -@@ -314,10 +314,11 @@ +--- at-3.1.10/at.c.perm 2007-07-04 09:43:19.000000000 +0200 ++++ at-3.1.10/at.c 2007-07-04 10:04:47.000000000 +0200 +@@ -314,26 +314,19 @@ * bit. Yes, this is a kluge. */ cmask = umask(S_IRUSR | S_IWUSR | S_IXUSR); - seteuid(real_uid); -+ //seteuid(real_uid); -+ seteuid(effective_uid); ++ seteuid(effective_uid); if ((fd = open(atfile, O_CREAT | O_EXCL | O_TRUNC | O_WRONLY, S_IRUSR)) == -1) perr("Cannot create atjob file %.500s", atfile); - seteuid(effective_uid); @@ -14,3 +13,66 @@ if ((fd2 = dup(fd)) < 0) perr("Error in dup() of job file"); + +- /* + if (fchown(fd2, real_uid, real_gid) != 0) +- perr("Cannot give away file"); +- */ ++ perr("Cannot give real_uid and real_gid the file"); + + PRIV_END + +- /* We no longer need suid root; now we just need to be able to write +- * to the directory, if necessary. +- */ +- +- REDUCE_PRIV(daemon_uid, daemon_gid) + /* We've successfully created the file; let's set the flag so it + * gets removed in case of an interrupt or error. + */ +@@ -491,7 +484,7 @@ + */ + + if (fchmod(fd2, S_IRUSR | S_IWUSR | S_IXUSR) < 0) +- perr("Cannot give away file"); ++ perr("Cannot change the mode of the file"); + + close(fd2); + +@@ -656,7 +649,7 @@ + We need the unprivileged uid here since the file is owned by the real + (not effective) uid. + */ +- setregid(real_gid, effective_gid); ++ PRIV_START + + if (queue == '=') { + fprintf(stderr, "Warning: deleting running job\n"); +@@ -665,8 +658,8 @@ + perr("Cannot unlink %.500s", dirent->d_name); + rc = EXIT_FAILURE; + } ++ PRIV_END + +- setregid(effective_gid, real_gid); + done = 1; + + break; +@@ -676,7 +669,7 @@ + FILE *fp; + int ch; + +- setregid(real_gid, effective_gid); ++ PRIV_START + fp = fopen(dirent->d_name, "r"); + + if (fp) { +@@ -689,7 +682,7 @@ + perr("Cannot open %.500s", dirent->d_name); + rc = EXIT_FAILURE; + } +- setregid(effective_gid, real_gid); ++ PRIV_END + } + break; + diff --git a/at-3.1.7-typo.patch b/at-3.1.7-typo.patch deleted file mode 100644 index 47b508c..0000000 --- a/at-3.1.7-typo.patch +++ /dev/null @@ -1,56 +0,0 @@ ---- at-3.1.10/atrun.8.in.typo 2005-08-29 10:08:41.000000000 +0200 -+++ at-3.1.10/atrun.8.in 2006-09-12 09:56:54.000000000 +0200 -@@ -11,7 +11,7 @@ - .B atrun - runs jobs queued by - .BR at(1) . --It is a shell script containing invoking -+It is a shell script invoking - .B @sbindir@/atd - with the - .I -s ---- at-3.1.10/atd.c.typo 2006-09-12 09:56:54.000000000 +0200 -+++ at-3.1.10/atd.c 2006-09-12 10:00:10.000000000 +0200 -@@ -363,7 +363,7 @@ - } - if (buf.st_nlink > 2) { - unlink( newname ); -- perr("Someboy is trying to run a linked script for job %8lu (%.500s)", -+ perr("Somebody is trying to run a linked script for job %8lu (%.500s)", - jobno, filename); - } - if ((fflags = fcntl(fd_in, F_GETFD)) < 0) { -@@ -849,6 +849,7 @@ - * Let's remove the lockfile and reschedule. - */ - strncpy(lock_name, dirent->d_name, sizeof(lock_name)); -+ lock_name[sizeof(lock_name)-1] = '\0'; - lock_name[0] = '='; - unlink(lock_name); - next_job = now; -@@ -865,7 +866,7 @@ - nothing_to_do = 0; - - /* There's a job for later. Note its execution time if it's -- * the earlierst so far. -+ * the earliest so far. - */ - if (run_time > now) { - if (next_job > run_time) { -@@ -883,6 +884,7 @@ - run_batch++; - if (strcmp(batch_name, dirent->d_name) > 0) { - strncpy(batch_name, dirent->d_name, sizeof(batch_name)); -+ batch_name[sizeof(batch_name)-1] = '\0'; - batch_uid = buf.st_uid; - batch_gid = buf.st_gid; - batch_queue = queue; -@@ -925,7 +927,7 @@ - int - main(int argc, char *argv[]) - { --/* Browse through ATJOB_DIR, checking all the jobfiles wether they should -+/* Browse through ATJOB_DIR, checking all the jobfiles whether they should - * be executed and or deleted. The queue is coded into the first byte of - * the job filename, the date (in minutes since Eon) as a hex number in the - * following eight bytes, followed by a dot and a serial number. A file diff --git a/at-3.1.8-SHELL-111386.patch b/at-3.1.8-SHELL-111386.patch deleted file mode 100644 index 74781c6..0000000 --- a/at-3.1.8-SHELL-111386.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff -u at-3.1.8/at.c.SHELL at-3.1.8/at.c ---- at-3.1.8/at.c.SHELL 2003-12-09 17:03:28.000000000 +1000 -+++ at-3.1.8/at.c 2003-12-09 17:03:28.000000000 +1000 -@@ -433,6 +433,8 @@ - fprintf(fp, " || {\n\t echo 'Execution directory " - "inaccessible' >&2\n\t exit 1\n}\n"); - -+ fprintf(fp, "${SHELL:-/bin/sh} << `(dd if=/dev/urandom count=200 bs=1 2>/dev/null|LC_ALL=C tr -d -c '[:alnum:]')`\n\n"); -+ - istty = isatty(fileno(stdin)); - if (istty) { - fprintf(stderr, "at> "); -@@ -854,10 +856,11 @@ - /* POSIX.2 allows the shell specified by the user's SHELL environment - variable, the login shell from the user's password database entry, - or /bin/sh to be the command interpreter that processes the at-job. -- It also alows a warning diagnostic to be printed. Because of the -+ It also allows a warning diagnostic to be printed. Because of the - possible variance, we always output the diagnostic. */ - -- fprintf(stderr, "warning: commands will be executed using /bin/sh\n"); -+/* fprintf(stderr, "warning: commands will be executed using /bin/sh\n"); -+ */ - - writefile(timer, queue); - break; diff --git a/at-3.1.8-fix_no_export.patch b/at-3.1.8-fix_no_export.patch deleted file mode 100644 index 91b9b7d..0000000 --- a/at-3.1.8-fix_no_export.patch +++ /dev/null @@ -1,95 +0,0 @@ ---- at-3.1.8/at.1.in.fix_no_export 2004-10-05 13:34:39.524060000 -0400 -+++ at-3.1.8/at.1.in 2004-10-05 13:36:12.930550000 -0400 -@@ -49,8 +49,7 @@ - and - .B batch - read commands from standard input or a specified file which are to --be executed at a later time, using --.BR /bin/sh . -+be executed at a later time . - .TP 8 - .BR at - executes commands at a specified time. -@@ -252,8 +251,56 @@ - option argument, which must have the same format as specified for the - .BR touch(1) - utility's --.B -t -+.B \-t - time option argument ([[CC]YY]MMDDhhmm). -+.SH ENVIRONMENT -+.P -+.TP 8 -+.B SHELL -+The value of the SHELL environment variable at the time of -+.B at -+invocation will determine which shell is used to execute the -+.B at -+job commands. If SHELL is unset when -+.B at -+is invoked, the user's login shell will be used; otherwise, -+if SHELL is set when -+.B at -+is invoked, it must contain the path of a shell interpreter -+executable that will be used to run the commands at the specified time. -+.P -+.B at -+will record the values of -+environment variables present at time of -+.B at -+invocation. When the commands are run at the specified time, -+.B at -+will restore these variables to their recorded values . -+These variables are excluded from this processing and are never -+set by -+.B at -+when the commands are run : -+.br -+.BI TERM, -+.BI DISPLAY, -+.BI SHELLOPTS, -+.BI _, -+.BI PPID, -+.BI BASH_VERSINFO, -+.BI EUID, -+.BI UID, -+.BI GROUPS. -+.br -+If the user submitting the -+.B at -+job is not the super-user, variables that alter the behaviour of the -+loader -+.BR ld.so(8), -+such as -+.B LD_LIBRARY_PATH -+, cannot be recorded and restored by -+.B at . -+.P - .SH FILES - .I @ATJBD@ - .br ---- at-3.1.8/at.c.fix_no_export 2004-10-05 13:34:39.538036000 -0400 -+++ at-3.1.8/at.c 2004-10-05 13:34:39.629944000 -0400 -@@ -358,8 +358,8 @@ - for (atenv = environ; *atenv != NULL; atenv++) { - int export = 1; - char *pch; -- char * eqp = *atenv; -- char * valp = *atenv; -+ char * eqp = *atenv; -+ char * valp = *atenv; - - if ((pch = strchr(*atenv, '=')) != 0) { - unsigned int i; -@@ -368,8 +368,9 @@ - valp = pch + 1; - for (i = 0; i < sizeof(no_export) / sizeof(no_export[0]); i++) { - export = export -- && (strncmp(*atenv, no_export[i], -- (size_t) (eqp - *atenv)) != 0); -+ && ( (((size_t) (eqp - *atenv)) != strlen(no_export[i])) -+ ||(strncmp(*atenv, no_export[i],(size_t) (eqp - *atenv)) != 0) -+ ); - } - } else { - continue; /* no '=', so bail on this one */ diff --git a/at-3.1.8-instinet.patch b/at-3.1.8-instinet.patch deleted file mode 100644 index f164106..0000000 --- a/at-3.1.8-instinet.patch +++ /dev/null @@ -1,248 +0,0 @@ ---- at-3.1.8.orig/atd.c Tue Jul 16 21:35:17 2002 -+++ at-3.1.8/atd.c Sat Jul 20 17:26:24 2002 -@@ -113,7 +113,7 @@ - static char rcsid[] = "$Id: atd.c,v 1.28 1997/05/06 08:31:09 ig25 Exp $"; - static double load_avg = LOADAVG_MX; - static time_t now; --static time_t last_chg; -+//static time_t last_chg; - static int nothing_to_do; - unsigned int batch_interval; - static int run_as_daemon = 0; -@@ -188,7 +188,7 @@ - #endif - - static void --run_file(const char *filename, uid_t uid, gid_t gid) -+run_file(char *filename, uid_t uid, gid_t gid) - { - /* Run a file by by spawning off a process which redirects I/O, - * spawns a subshell, then waits for it to complete and sends -@@ -198,7 +198,7 @@ - int fd_out, fd_in; - char mailbuf[256], jobbuf[9]; - char *mailname = NULL; -- char *newname; -+ char newname[256]; - FILE *stream; - int send_mail = 0; - struct stat buf, lbuf; -@@ -214,12 +214,18 @@ - - sprintf(jobbuf, "%8lu", jobno); - -- if ((newname = malloc(strlen(filename) + 1)) == NULL) -- pabort("Job %8lu : out of virtual memory", jobno); -+ if( strlen( filename ) >= sizeof( newname ) - 1 ) -+ pabort("File name too long: %s", filename ); - - strcpy(newname, filename); -+ -+ newname[0] = '!'; -+ -+ if( rename( filename, newname ) < 0 ) -+ perr( "Error renaming job file." ); - -- newname[0] = '='; -+ filename[0] = '!'; -+ newname[0] = '='; - - /* We try to make a hard link to lock the file. If we fail, then - * somebody else has already locked it (a second atd?); log the -@@ -234,13 +240,15 @@ - } - } - /* If something goes wrong between here and the unlink() call, -- * the job gets restarted as soon as the "=" entry is cleared -- * by the main atd loop. -- */ -+ * the job will remain in the "!" queue. -+ * no point in retrying, and need glaring proof that something went wrong -+ */ - - pid = fork(); -- if (pid == -1) -+ if (pid == -1) { -+ unlink( newname ); - perr("Cannot fork"); -+ } - - else if (pid != 0) { - return; -@@ -252,6 +260,7 @@ - - pentry = getpwuid(uid); - if (pentry == NULL) { -+ unlink( newname ); - pabort("Userid %lu not found - aborting job %8lu (%.500s)", - (unsigned long) uid, jobno, filename); - } -@@ -261,34 +270,49 @@ - - PRIV_END - -- if (stream == NULL) -+ if (stream == NULL) { -+ unlink( newname ); - perr("Cannot open input file"); -+ } - -- if ((fd_in = dup(fileno(stream))) < 0) -+ if ((fd_in = dup(fileno(stream))) < 0) { -+ unlink( newname ); - perr("Error duplicating input file descriptor"); -+ } - -- if (fstat(fd_in, &buf) == -1) -+ if (fstat(fd_in, &buf) == -1) { -+ unlink( newname ); - perr("Error in fstat of input file descriptor"); -+ } - -- if (lstat(filename, &lbuf) == -1) -+ if (lstat(filename, &lbuf) == -1) { -+ unlink( newname ); - perr("Error in fstat of input file"); -+ } - -- if (S_ISLNK(lbuf.st_mode)) -+ if (S_ISLNK(lbuf.st_mode)) { -+ unlink( newname ); - perr("Symbolic link encountered in job %8lu (%.500s) - aborting", - jobno, filename); -+ } - - if ((lbuf.st_dev != buf.st_dev) || (lbuf.st_ino != buf.st_ino) || - (lbuf.st_uid != buf.st_uid) || (lbuf.st_gid != buf.st_gid) || -- (lbuf.st_size != buf.st_size)) -+ (lbuf.st_size != buf.st_size)) { -+ unlink( newname ); - perr("Somebody changed files from under us for job %8lu (%.500s) - " - "aborting", jobno, filename); -+ } - - if (buf.st_nlink > 2) { -+ unlink( newname ); - perr("Somebody is trying to run a linked script for job %8lu (%.500s)", - filename); - } -- if ((fflags = fcntl(fd_in, F_GETFD)) < 0) -+ if ((fflags = fcntl(fd_in, F_GETFD)) < 0) { -+ unlink( newname ); - perr("Error in fcntl"); -+ } - - fcntl(fd_in, F_SETFD, fflags & ~FD_CLOEXEC); - -@@ -300,33 +324,47 @@ - * the bug is located. -Joey - */ - if (fscanf(stream, "#!/bin/sh\n# atrun uid=%d gid=%d\n# mail %255s %d", -- &nuid, &ngid, mailbuf, &send_mail) != 4) -+ &nuid, &ngid, mailbuf, &send_mail) != 4) { -+ unlink( newname ); - pabort("File %.500s is in wrong format - aborting", - filename); -+ } - mailbuf[255] = '\0'; - -- if (mailbuf[0] == '-') -+ if (mailbuf[0] == '-') { -+ unlink( newname ); - pabort("illegal mail name %.300s in job %8lu (%.300s)", mailbuf, - jobno, filename); -+ } - - mailname = mailbuf; -- if (nuid != uid) -+ if (nuid != uid) { -+ unlink( newname ); - pabort("Job %8lu (%.500s) - userid %d does not match file uid %d", - jobno, filename, nuid, uid); -+ } - -- if (ngid != gid) -+ if (ngid != gid) { -+ unlink( newname ); - pabort("Job %8lu %.500s - groupid %d does not match file gid %d", - jobno, filename, ngid, gid); -+ } - - /* We are now committed to executing this script. Unlink the - * original. - */ - - unlink(filename); -+ -+ /* If we bail out from now on, the job gets stuck in "=" -+ * The main loop should take care of that. -+ */ - - fclose(stream); - if (chdir(ATSPOOL_DIR) < 0) - perr("Cannot chdir to " ATSPOOL_DIR); -+ -+ filename[0] = queue; - - /* Create a file to hold the output of the job we are about to run. - * Write the mail header. Complain in case -@@ -417,19 +455,21 @@ - waitpid(pid, (int *) NULL, 0); - - /* Send mail. Unlink the output file after opening it, so it -- * doesn't hang around after the run. -+ * doesn't hang around after the run (if we are to send mail) - */ -- stat(filename, &buf); -- if (open(filename, O_RDONLY) != STDIN_FILENO) -- perr("Open of jobfile failed"); -+ -+ if( send_mail != -1 ) { -+ stat(filename, &buf); -+ if (open(filename, O_RDONLY) != STDIN_FILENO) -+ perr("Open of jobfile failed"); - -- unlink(filename); -+ unlink(filename); -+ } - - /* The job is now finished. We can delete its input file. - */ - chdir(ATJOB_DIR); - unlink(newname); -- free(newname); - - if (((send_mail != -1) && (buf.st_size != size)) || (send_mail == 1)) { - -@@ -462,6 +502,8 @@ - exit(EXIT_SUCCESS); - } - -+#define CHECK_INTERVAL_5MIN 300 -+ - static time_t - run_loop() - { -@@ -491,7 +533,7 @@ - * atrun. - */ - -- next_job = now + CHECK_INTERVAL; -+ next_job = now + CHECK_INTERVAL_5MIN; - if (next_batch == 0) - next_batch = now; - -@@ -502,11 +544,11 @@ - - if (stat(".", &buf) == -1) - perr("Cannot stat " ATJOB_DIR); -- -+/* - if (nothing_to_do && buf.st_mtime <= last_chg) - return next_job; - last_chg = buf.st_mtime; -- -+*/ - if ((spool = opendir(".")) == NULL) - perr("Cannot read " ATJOB_DIR); - diff --git a/at-3.1.8-man-timespec-path.patch b/at-3.1.8-man-timespec-path.patch deleted file mode 100644 index 0870b8a..0000000 --- a/at-3.1.8-man-timespec-path.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -u at-3.1.8/at.1.in~ at-3.1.8/at.1.in ---- at-3.1.8/at.1.in~ 2003-06-03 10:06:37.000000000 +0900 -+++ at-3.1.8/at.1.in 2003-06-03 10:06:37.000000000 +0900 -@@ -117,7 +117,7 @@ - .B at 1am tomorrow. - .PP - The exact definition of the time specification can be found in --.IR @prefix@/share/doc/at/timespec . -+.IR @prefix@/share/doc/at-@VERSION@/timespec . - .PP - For both - .BR at " and " batch , -@@ -240,7 +240,7 @@ - Times displayed will be in the format "1997-02-20 14:50" unless the - environment variable - .B POSIXLY_CORRECT --is set; then, it will be "Thu Feb 20 14:50:00 1996". -+is set; then, it will be "Thu Feb 20 14:50:00 1997". - .TP - .B - \-c diff --git a/at-3.1.8-pie.patch b/at-3.1.8-pie.patch deleted file mode 100644 index dddd699..0000000 --- a/at-3.1.8-pie.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- at-3.1.8/Makefile.in.pie 2004-05-12 11:11:07.690785433 +0200 -+++ at-3.1.8/Makefile.in 2004-05-12 11:23:10.367957697 +0200 -@@ -69,13 +69,13 @@ - all: at atd atrun - - at: $(ATOBJECTS) -- $(CC) $(CFLAGS) -o at $(ATOBJECTS) $(LIBS) $(LEXLIB) -+ $(CC) $(CFLAGS) -o at -pie $(ATOBJECTS) $(LIBS) $(LEXLIB) - rm -f $(CLONES) - $(LN_S) -f at atq - $(LN_S) -f at atrm - - atd: $(RUNOBJECTS) -- $(CC) $(CFLAGS) -o atd $(RUNOBJECTS) $(LIBS) $(SELINUXLIB) -+ $(CC) $(CFLAGS) -o atd -pie $(RUNOBJECTS) $(LIBS) $(SELINUXLIB) - - y.tab.c y.tab.h: parsetime.y - $(YACC) -d parsetime.y -@@ -87,7 +87,7 @@ - configure - - .c.o: -- $(CC) -c $(CFLAGS) $(DEFS) $*.c -+ $(CC) -c $(CFLAGS) -fpie $(DEFS) $*.c - - install: all - $(INSTALL) -m 755 -d $(IROOT)$(etcdir) diff --git a/at-3.1.8-r-man.patch b/at-3.1.8-r-man.patch deleted file mode 100644 index f3363eb..0000000 --- a/at-3.1.8-r-man.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- at-3.1.8/at.1.in.-r-man 2005-08-03 19:45:50.000000000 -0400 -+++ at-3.1.8/at.1.in 2005-09-02 12:17:44.435351000 -0400 -@@ -9,7 +9,7 @@ - .IR queue ] - .RB [ -f - .IR file ] --.RB [ -mldbv ] -+.RB [ -mldrbv ] - .B TIME - .br - .B at -@@ -18,7 +18,7 @@ - .IR queue ] - .RB [ -f - .IR file ] --.RB [ -mldbv ] -+.RB [ -mldrbv ] - .RB -t - .IR time_arg - .br -@@ -232,6 +232,9 @@ - Is an alias for - .B atrm. - .TP -+.B \-r -+Is an alias for -+.B atrm. - .TP - .B \-v - Shows the time the job will be executed. diff --git a/at-3.1.8-t_option.patch b/at-3.1.8-t_option.patch index 22f7ac5..89e604e 100644 --- a/at-3.1.8-t_option.patch +++ b/at-3.1.8-t_option.patch @@ -1,5 +1,5 @@ ---- at-3.1.10/at.c.t_option 2007-06-28 14:43:51.000000000 +0200 -+++ at-3.1.10/at.c 2007-06-28 14:54:04.000000000 +0200 +--- at-3.1.10/at.c.t_option 2007-07-04 11:12:10.000000000 +0200 ++++ at-3.1.10/at.c 2007-07-04 11:13:19.000000000 +0200 @@ -396,8 +396,9 @@ unsigned int i; for (i = 0; i < sizeof(no_export) / sizeof(no_export[0]); i++) { @@ -138,7 +138,24 @@ default: usage(); break; -@@ -955,10 +1054,12 @@ +@@ -923,10 +1022,12 @@ + break; + + case AT: +- if (argc > optind) { +- timer = parsetime(argc - optind, argv + optind); +- } else { +- timer = 0; ++ if (timer == 0) { ++ if (argc > optind) { ++ timer = parsetime(argc - optind, argv + optind); ++ } else { ++ timer = 0; ++ } + } + + if (timer == 0) { +@@ -955,10 +1056,12 @@ else queue = DEFAULT_BATCH_QUEUE; @@ -155,8 +172,8 @@ if (atverify) { struct tm *tm = localtime(&timer); ---- at-3.1.10/at.1.in.t_option 2007-06-28 14:43:51.000000000 +0200 -+++ at-3.1.10/at.1.in 2007-06-28 14:43:51.000000000 +0200 +--- at-3.1.10/at.1.in.t_option 2007-07-04 11:12:10.000000000 +0200 ++++ at-3.1.10/at.1.in 2007-07-04 11:12:10.000000000 +0200 @@ -12,6 +12,16 @@ .RB [ -mldbv ] .B TIME diff --git a/at-3.1.8-test.patch b/at-3.1.8-test.patch deleted file mode 100644 index f5bc2b8..0000000 --- a/at-3.1.8-test.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -u at-3.1.8/Makefile.in.orig at-3.1.8/Makefile.in ---- at-3.1.8/Makefile.in.orig Wed Feb 14 13:59:09 2001 -+++ at-3.1.8/Makefile.in Mon Feb 19 14:48:42 2001 -@@ -51,6 +51,8 @@ - - OTHERS = parsetime.l parsetime.y - -+TEST_VERBOSE = 0 -+ - DOCS = Problems Copyright README ChangeLog timespec - - MISC = COPYING Makefile.in configure acconfig.h install-sh \ -@@ -150,6 +152,9 @@ - - parsetest: lex.yy.c y.tab.c - $(CC) -o parsetest $(CFLAGS) $(DEFS) -DTEST_PARSER -DNEED_YYWRAP lex.yy.c y.tab.c -+ -+test: parsetest -+ PERL_DL_NONLAZY=1 perl -e 'use Test::Harness qw(&runtests $$verbose); $$verbose=$(TEST_VERBOSE); runtests @ARGV;' test.pl - - .depend: $(CSRCS) - gcc $(CFLAGS) $(DEFS) -MM $(CSRCS) > .depend -diff -u at-3.1.8/test.pl.orig at-3.1.8/test.pl diff --git a/at-3.1.8-usage.patch b/at-3.1.8-usage.patch deleted file mode 100644 index ffec26d..0000000 --- a/at-3.1.8-usage.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- at-3.1.8/panic.c.usage 2002-01-17 23:15:27.000000000 -0500 -+++ at-3.1.8/panic.c 2004-08-03 17:23:22.628494000 -0400 -@@ -92,6 +92,8 @@ - /* Print usage and exit. - */ - fprintf(stderr, "Usage: at [-V] [-q x] [-f file] [-m] time\n" -+ " at [-V] [-q x] [-f file] [-m] -t [[CC]YY]MMDDhhmm\n" -+ " at -c job [job...]\n" - " atq [-V] [-q x]\n" - " atrm [-V] [-q x] job ...\n" - " batch [-V] [-f file] [-m]\n"); diff --git a/at.spec b/at.spec index e2ebd25..80f1689 100644 --- a/at.spec +++ b/at.spec @@ -6,7 +6,7 @@ Summary: Job spooling tools Name: at Version: 3.1.10 -Release: 12%{?dist} +Release: 13%{?dist} License: GPL Group: System Environment/Daemons URL: http://ftp.debian.org/debian/pool/main/a/at @@ -18,13 +18,12 @@ Patch1: at-3.1.10-makefile.patch Patch2: at-3.1.10-man-timespec-path.patch Patch3: at-3.1.7-sigchld.patch Patch4: at-3.1.10-typo.patch -Patch7: at-3.1.8-perr.patch -#Patch8: at-3.1.8-instinet.patch -Patch9: at-3.1.10-shell.patch -Patch11: at-3.1.8-t_option.patch -Patch14: at-3.1.10-pam.patch -Patch15: at-3.1.10-dont_fork.patch -Patch21: at-3.1.10-perm.patch +Patch5: at-3.1.8-perr.patch +Patch6: at-3.1.10-shell.patch +Patch7: at-3.1.8-t_option.patch +Patch8: at-3.1.10-pam.patch +Patch9: at-3.1.10-dont_fork.patch +Patch10: at-3.1.10-perm.patch BuildRequires: fileutils chkconfig /etc/init.d BuildRequires: flex bison autoconf @@ -63,13 +62,12 @@ cp %{SOURCE1} . %patch2 -p1 -b .paths %patch3 -p1 -b .sigchld %patch4 -p1 -b .typo -%patch7 -p1 -b .perr -#%patch8 -p1 -b .instinet #unlink unsucessful jobs, removed -> atd crash -%patch9 -p1 -b .shell -%patch11 -p1 -b .t_option -%patch14 -p1 -b .pam -%patch15 -p1 -b .dont_fork -%patch21 -p1 -b .perm +%patch5 -p1 -b .perr +%patch6 -p1 -b .shell +%patch7 -p1 -b .t_option +%patch8 -p1 -b .pam +%patch9 -p1 -b .dont_fork +%patch10 -p1 -b .perm %build # patch10 touches configure.in @@ -167,6 +165,9 @@ fi %attr(4755,root,root) %{_bindir}/at %changelog +* Tue Jul 3 2007 Marcela Maslanova <mmaslano@redhat.com> - 3.1.10-13 +- Resolves: rhbz#243064 + * Tue Jul 3 2007 Marcela Maslanova <mmaslano@redhat.com> - 3.1.10-12 - crashing atd - work only for root, still broken some functions