New version at-3.1.10

This commit is contained in:
Marcela Mašláňová 2006-10-24 12:50:09 +00:00
parent f59a0f08c1
commit bf7489f54d
5 changed files with 206 additions and 248 deletions

View File

@ -1 +1,2 @@
at_3.1.8-11.tar.gz
at-3.1.10.tar.gz

View File

@ -1,15 +1,26 @@
--- at-3.1.7/atd.c.tyop Wed Mar 1 14:32:47 2000
+++ at-3.1.7/atd.c Wed Mar 1 14:34:52 2000
@@ -247,7 +247,7 @@
"aborting", jobno, filename);
--- 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)",
filename);
jobno, filename);
}
if ((fflags = fcntl(fd_in, F_GETFD)) < 0)
@@ -493,6 +493,7 @@
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));
@ -17,16 +28,16 @@
lock_name[0] = '=';
unlink(lock_name);
next_job = now;
@@ -500,7 +501,7 @@
continue;
}
@@ -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) {
@@ -518,6 +519,7 @@
@@ -883,6 +884,7 @@
run_batch++;
if (strcmp(batch_name, dirent->d_name) > 0) {
strncpy(batch_name, dirent->d_name, sizeof(batch_name));
@ -34,7 +45,7 @@
batch_uid = buf.st_uid;
batch_gid = buf.st_gid;
batch_queue = queue;
@@ -553,7 +555,7 @@
@@ -925,7 +927,7 @@
int
main(int argc, char *argv[])
{

View File

@ -1,41 +1,6 @@
--- at-3.1.8/at.1.in-t_option 2004-08-03 17:27:23.458423000 -0400
+++ at-3.1.8/at.1.in 2004-08-03 17:27:43.923938000 -0400
@@ -12,6 +12,16 @@
.RB [ -mldbv ]
.B TIME
.br
+.B at
+.RB [ -V ]
+.RB [ -q
+.IR queue ]
+.RB [ -f
+.IR file ]
+.RB [ -mldbv ]
+.RB -t
+.IR time_arg
+.br
.B "at -c"
.I job
.RI [ job... ]
@@ -235,6 +245,15 @@
.B
\-c
cats the jobs listed on the command line to standard output.
+.TP
+.BI \-t " time_arg"
+Submit the job to be run at the time specified by the
+.BI time_arg
+option argument, which must have the same format as specified for the
+.BR touch(1)
+utility's
+.B -t
+time option argument ([[CC]YY]MMDDhhmm).
.SH FILES
.I @ATJBD@
.br
--- at-3.1.8/at.c-t_option 2004-08-03 17:27:24.036844000 -0400
+++ at-3.1.8/at.c 2004-08-03 17:27:24.246634000 -0400
@@ -688,6 +688,100 @@
--- at-3.1.10/at.c.t_ 2006-09-12 10:15:56.000000000 +0200
+++ at-3.1.10/at.c 2006-09-12 10:30:17.000000000 +0200
@@ -750,6 +750,101 @@
return p;
}
@ -47,159 +12,128 @@
+time_t
+t_option(char *s)
+{
+ time_t t=time(0L);
+ struct tm tm, tm_now=*localtime(&t);
+ int l;
+ time_t t=time(0L);
+ struct tm tm, tm_now=*localtime(&t);
+ int l;
+
+ if((s == 0L) || (*s == '\0'))
+ {
+ return 0L;
+ };
+ memset(&tm,'\0',sizeof(tm));
+ l = strnlen(s,15);
+ switch(l)
+ {
+ case 15:
+ /* CCYYMMDDhhmm.ss */
+ sscanf(s, "%4d%2d%2d%2d%2d.%2d",
+ &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min, &tm.tm_sec
+ );
+ if(tm.tm_year)
+ tm.tm_year -= 1900 ;
+
+ break;
+
+ case 13:
+ /* YYMMDDhhmm.ss */
+ sscanf(s, "%2d%2d%2d%2d%2d.%2d",
+ &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min, &tm.tm_sec
+ );
+ if(tm.tm_year)
+ tm.tm_year += 100 ; /* Y2.1K+ bug! */
+
+ break;
+
+ case 11:
+ /* MMDDhhmm.ss */
+ sscanf(s, "%2d%2d%2d%2d.%2d",
+ &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min, &tm.tm_sec
+ );
+
+ tm.tm_year = tm_now.tm_year;
+
+ if(tm.tm_mon)
+ tm.tm_mon -= 1;
+ break;
+
+ case 12:
+ /* CCYYMMDDhhmm */
+ sscanf(s, "%4d%2d%2d%2d%2d",
+ &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min
+ );
+ if(tm.tm_year)
+ tm.tm_year -= 1900 ;
+ break;
+
+ case 10:
+ /* YYMMDDhhmm */
+ sscanf(s, "%2d%2d%2d%2d%2d",
+ &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min
+ );
+ if(tm.tm_year)
+ tm.tm_year += 100 ; /* Y2.1K+ bug! */
+ break;
+
+ case 8:
+ /* MMDDhhmm */
+ sscanf(s, "%2d%2d%2d%2d",
+ &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min
+ );
+ if( tm.tm_mday )
+ tm.tm_year = tm_now.tm_year;
+ break;
+
+ default:
+ break;
+ }
+
+ if( tm.tm_mon )
+ tm.tm_mon -= 1;
+
+ if( tm.tm_mday )
+ {
+ tm.tm_isdst = tm_now.tm_isdst;
+ return mktime(&tm);
+ }else
+ return 0L;
+ if((s == 0L) || (*s == '\0'))
+ {
+ return 0L;
+ };
+ memset(&tm,'\0',sizeof(tm));
+ l = strnlen(s,15);
+ switch(l)
+ {
+ case 15:
+ /* CCYYMMDDhhmm.ss */
+ sscanf(s, "%4d%2d%2d%2d%2d.%2d",
+ &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min, &tm.tm_sec
+ );
+ if(tm.tm_year)
+ tm.tm_year -= 1900 ;
+
+ break;
+
+ case 13:
+ /* YYMMDDhhmm.ss */
+ sscanf(s, "%2d%2d%2d%2d%2d.%2d",
+ &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min, &tm.tm_sec
+ );
+ if(tm.tm_year)
+ tm.tm_year += 100 ; /* Y2.1K+ bug! */
+
+ break;
+
+ case 11:
+ /* MMDDhhmm.ss */
+ sscanf(s, "%2d%2d%2d%2d.%2d",
+ &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min, &tm.tm_sec
+ );
+
+ tm.tm_year = tm_now.tm_year;
+
+ if(tm.tm_mon)
+ tm.tm_mon -= 1;
+ break;
+
+ case 12:
+ /* CCYYMMDDhhmm */
+ sscanf(s, "%4d%2d%2d%2d%2d",
+ &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min
+ );
+ if(tm.tm_year)
+ tm.tm_year -= 1900 ;
+ break;
+
+ case 10:
+ /* YYMMDDhhmm */
+ sscanf(s, "%2d%2d%2d%2d%2d",
+ &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min
+ );
+ if(tm.tm_year)
+ tm.tm_year += 100 ; /* Y2.1K+ bug! */
+ break;
+
+ case 8:
+ /* MMDDhhmm */
+ sscanf(s, "%2d%2d%2d%2d",
+ &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min
+ );
+ if( tm.tm_mday )
+ tm.tm_year = tm_now.tm_year;
+ break;
+ default:
+ break;
+ }
+
+ if( tm.tm_mon )
+ tm.tm_mon -= 1;
+
+ if( tm.tm_mday )
+ {
+ tm.tm_isdst = tm_now.tm_isdst;
+ return mktime(&tm);
+ } else
+ return 0L;
+}
+
+
+
+
int
main(int argc, char **argv)
{
@@ -697,9 +791,9 @@
char *pgm;
int program = AT; /* our default program */
- char *options = "q:f:MmvldhVc"; /* default options for at */
+ char *options = "q:f:MmvldhVct:"; /* default options for at */
int disp_version = 0;
- time_t timer;
+ time_t timer=0L;
struct passwd *pwe;
struct group *ge;
@@ -802,6 +896,10 @@
options = "";
break;
+ case 't':
+ timer = t_option(optarg);
+ break;
+
default:
usage();
break;
@@ -838,10 +936,13 @@
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) {
@@ -870,16 +971,20 @@
queue = toupper(queue);
else
queue = DEFAULT_BATCH_QUEUE;
-
- if (argc > optind)
- timer = parsetime(argc, argv);
- else
- timer = time(NULL);
+
+ if( timer == 0L )
+ {
+ if (argc > optind)
+ timer = parsetime(argc, argv);
+ else
+ timer = time(NULL);
+ }
if (atverify) {
struct tm *tm = localtime(&timer);
fprintf(stderr, "%s\n", asctime(tm));
}
+
writefile(timer, queue);
break;
--- at-3.1.10/at.1.in.t_option 2006-09-12 12:48:04.000000000 +0200
+++ at-3.1.10/at.1.in 2006-09-12 12:45:40.000000000 +0200
@@ -12,6 +12,16 @@
.RB [ -mldbv ]
.B TIME
.br
+.B at
+.RB [ -V ]
+.RB [ -q
+.IR queue ]
+.RB [ -f
+.IR file ]
+.RB [ -mldbv ]
+.RB -t
+.IR time_arg
+.br
.B "at -c"
.I job
.RI [ job... ]
@@ -227,6 +237,15 @@
.B
\-c
cats the jobs listed on the command line to standard output.
+.TP
+.BI \-t " time_arg"
+Submit the job to be run at the time specified by the
+.BI time_arg
+option argument, which must have the same format as specified for the
+.BR touch(1)
+utility's
+.B -t
+time option argument ([[CC]YY]MMDDhhmm).
.SH FILES
.I @ATJBD@
.br

103
at.spec
View File

@ -1,45 +1,51 @@
%define major_ver 3.1.10
%if %{?WITH_PAM:0}%{!?WITH_PAM:1}
%define WITH_PAM 1
%endif
Summary: Job spooling tools.
Name: at
Version: 3.1.8
Release: 82%{?dist}
Version: 3.1.10
Release: 2%{?dist}
License: GPL
Group: System Environment/Daemons
Source: http://ftp.debian.org/debian/pool/main/a/at/at_3.1.8-11.tar.gz
Source: http://ftp.debian.org/debian/pool/main/a/at/at-%{major_ver}.tar.gz
Source1: test.pl
Source2: atd.init
Patch0: at-3.1.7-lockfile.patch
Patch1: at-3.1.7-noon.patch
Patch2: at-3.1.8-man-timespec-path.patch
#Patch1: at-3.1.7-noon.patch
Patch2: at-3.1.10-man-timespec-path.patch
Patch3: at-3.1.7-sigchld.patch
Patch4: at-noroot.patch
Patch5: at-3.1.7-typo.patch
Patch7: at-3.1.8-buflen.patch
Patch10: at-3.1.8-batch.patch
Patch11: at-3.1.8-11-lexer-parser.diff
#Patch4: at-3.1.10-noroot.patch
Patch5: at-3.1.10-typo.patch
#Patch7: at-3.1.8-buflen.patch
#Patch10: at-3.1.8-batch.patch
Patch11: at-3.1.10-lexer-parser.patch
Patch13: at-3.1.8-test.patch
Patch15: at-3.1.8-env-tng.patch
#Patch15: at-3.1.8-env-tng.patch
#Patch16: at-3.1.8-lsbdoc.patch
Patch18: at-3.1.8-perr.patch
Patch19: at-3.1.8-instinet.patch
Patch20: at-3.1.8-SHELL-111386.patch
Patch21: at-3.1.8-atrun.8-typo-97697.patch
Patch22: at-selinux.patch
Patch23: at-3.1.8-pie.patch
Patch24: at-3.1.8-t_option.patch
Patch25: at-3.1.8-usage.patch
Patch26: at-3.1.8-fix_no_export.patch
Patch27: at-3.1.8-pam.patch
Patch28: at-3.1.8-pam_perms.patch
Patch29: at-3.1.8-pam_fail_close_session.patch
Patch30: at-3.1.8-pam_delete_cred.patch
Patch31: at-3.1.8-r_option.patch
Patch32: at-3.1.8-pam_loginuid.patch
Patch33: at-3.1.8-getseuserbyname.patch
Patch34: at-3.1.8-install_no_chown.patch
Patch35: at-3.1.8-dontfork.patch
Patch19: at-3.1.10-instinet.patch
Patch20: at-3.1.10-shell.patch
#Patch21: at-3.1.8-atrun.8-typo-97697.patch
#Patch22: at-selinux.patch
#Patch22: at-3.1.10-selinux.patch
Patch23: at-3.1.10-pie.patch
Patch24: at-3.1.8-t_opti.patch
Patch25: at-3.1.10-usage.patch
Patch26: at-3.1.10-fix_no_export.patch
#Patch27: at-3.1.8-pam.patch
#Patch28: at-3.1.8-pam_perms.patch
#Patch29: at-3.1.8-pam_fail_close_session.patch
#Patch30: at-3.1.8-pam_delete_cred.patch
#Patch31: at-3.1.8-r_option.patch
#Patch32: at-3.1.8-pam_loginuid.patch
#Patch33: at-3.1.8-getseuserbyname.patch
#Patch34: at-3.1.8-install_no_chown.patch
Patch35: at-3.1.10-dont_fork.patch
Patch36: at-3.1.10-pam.patch
Patch37: at-3.1.10-makefile.patch
Prereq: fileutils chkconfig /etc/init.d
BuildPrereq: flex bison autoconf
BuildPrereq: libselinux-devel >= 1.27.9
@ -75,38 +81,40 @@ cp %{SOURCE1} .
# The next path is a brute-force fix that will have to be updated
# when new versions of at are released.
%patch2 -p1 -b .paths
%patch3 -p1 -b .sigchld
#%%patch6 -p1 -b .debian
%patch4 -p1 -b .noroot
%patch5 -p1 -b .tyop
%patch7 -p1 -b .buflen
%patch10 -p1 -b .batch
#%patch4 -p1 -b .noroot
%patch5 -p1 -b .typo
#%patch7 -p1 -b .buflen
#%patch10 -p1 -b .batch
%patch11 -p1 -b .lexer
#%%patch12 -p1 -b .dst
%patch13 -p1 -b .test
#%%patch14 -p1 -b .test-fix
%patch15 -p1 -b .env
#%patch15 -p1 -b .env
#%%patch16 -p1 -b .lsbdoc
#%%patch17 -p1 -b .o_excl
%patch18 -p1 -b .perr
%patch19 -p1 -b .instinet
%patch20 -p1 -b .SHELL
%patch21 -p1 -b .typo
%patch22 -p1 -b .selinux
%patch20 -p1 -b .shell
#%patch21 -p1 -b .typo97
#%patch22 -p1 -b .selinux
#replace PAMLIB with SELINUXLIB in Makefile.in -> replaced by #36
%patch23 -p1 -b .pie
%patch24 -p1 -b -t_option
%patch25 -p1 -b .usage
%patch26 -p1 -b .fix_no_export
%patch27 -p1 -b .pam
%patch28 -p1 -b .pam_perms
%patch29 -p1 -b .pam_fail_close_session
%patch30 -p1 -b .pam_delete_cred
%patch31 -p1 -b .-r_option
%patch32 -p1 -b .pam_loginuid
%patch33 -p1 -b .getseuserbyname
%patch34 -p1 -b .install_no_chown
%patch35 -p1 -b .dontfork
#%patch27 -p1 -b .pam -> pam.patch
#%patch28 -p1 -b .pam_perms
#%patch29 -p1 -b .pam_fail_close_session
#%patch30 -p1 -b .pam_delete_cred
#%patch31 -p1 -b .-r_option -> added from upstream
#%patch32 -p1 -b .pam_loginuid -> in pam.patch
#%patch33 -p1 -b .getseuserbyname -> pam.patch
#%patch34 -p1 -b .install_no_chown -> makefile.patch
%patch35 -p1 -b .dont_fork
%patch36 -p1 -b .pam
%patch37 -p1 -b .makefile
%build
# patch10 touches configure.in
@ -193,6 +201,9 @@ fi
%attr(4755,root,root) %{_bindir}/at
%changelog
* Thu Sep 07 2006 Marcela Maslanova <mmaslano@redhat.com> - 3.1.10-1.fc6
- new version from upstream 3.1.10
* Thu Aug 23 2006 Marcela Maslanova <mmaslano@redhat.com> - 3.1.8-82.fc6
- #176486 don't fork option added (patch from Enrico Scholz)

View File

@ -1 +1,2 @@
81dbae5162aaa8a398a81424d6631c77 at_3.1.8-11.tar.gz
a020a2ec32e1d629c0eef91e5728efad at-3.1.10.tar.gz