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.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.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 - 3.1.10-13 +- Resolves: rhbz#243064 + * Tue Jul 3 2007 Marcela Maslanova - 3.1.10-12 - crashing atd - work only for root, still broken some functions