Hello community,

here is the log from the commit of package at for openSUSE:Factory checked in 
at 2014-10-09 12:52:11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/at (Old)
 and      /work/SRC/openSUSE:Factory/.at.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "at"

Changes:
--------
--- /work/SRC/openSUSE:Factory/at/at.changes    2014-10-05 20:30:33.000000000 
+0200
+++ /work/SRC/openSUSE:Factory/.at.new/at.changes       2014-10-09 
12:52:19.000000000 +0200
@@ -1,0 +2,14 @@
+Mon Oct  6 20:32:38 UTC 2014 - [email protected]
+
+- Replace at-sane-envkeys.diff by at-3.1.15-sane-envkeys.patch,
+  a simpler fix from upstream [bsc#899160]
+
+-------------------------------------------------------------------
+Fri Oct  3 15:00:43 UTC 2014 - [email protected]
+
+- at-3.1.14-usePOSIXtimers.patch (from Fedora) 
+  Use Posix timers, this 
+  avoid the need of horrible suspend/resume hacks like at.sleep 
+  with pm-utils/systemd 
+
+-------------------------------------------------------------------

Old:
----
  at-sane-envkeys.diff
  at.sleep

New:
----
  at-3.1.14-usePOSIXtimers.patch
  at-3.1.15-sane-envkeys.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ at.spec ++++++
--- /var/tmp/diff_new_pack.6Gs1eK/_old  2014-10-09 12:52:20.000000000 +0200
+++ /var/tmp/diff_new_pack.6Gs1eK/_new  2014-10-09 12:52:20.000000000 +0200
@@ -27,7 +27,6 @@
 Source:         
ftp://ftp.debian.org/debian/pool/main/a/at/%{name}_%{version}.orig.tar.gz
 Source2:        atd.pamd
 Source3:        sysconfig.atd
-Source4:        at.sleep
 Source5:        atd.service
 
 Patch0:         at-3.1.14.patch
@@ -60,8 +59,10 @@
 Patch24:        at-backport-old-privs.patch
 #PATCH-FEATURE-UPSTREAM introduce -o <timeformat> argument for atq (bnc#879402)
 Patch25:        at-atq-timeformat.patch
-Patch26:        at-sane-envkeys.diff
-
+#PATCH-FIX-UPSTREAM sanitize environment variables (bnc#899160)
+Patch26:        at-3.1.15-sane-envkeys.patch
+#PATCH-FIX-OPENSUSE use posix timers to avoid the need of suspend/resume hacks.
+Patch27:        at-3.1.14-usePOSIXtimers.patch
 BuildRequires:  autoconf >= 2.69
 BuildRequires:  automake
 BuildRequires:  bison
@@ -107,7 +108,7 @@
 %patch24 -p1
 %patch25
 %patch26 -p1
-
+%patch27 -p1
 %build
 rm -fv y.tab.c y.tab.h lex.yy.c lex.yy.o y.tab.o
 autoreconf -fiv
@@ -137,7 +138,6 @@
 mv %{buildroot}/%{_prefix}/doc/at/* docs/
 
 %{__install} -D -m 0644 %{S:5} %{buildroot}%{_unitdir}/atd.service
-%{__install} -D -m 0755 %{S:4} 
%{buildroot}%{_prefix}/lib/systemd/system-sleep/atd.sh
 %{__ln_s} -f %{_sbindir}/service %{buildroot}%{_sbindir}/rcatd
 
 %{__install} -m644 %SOURCE2 %{buildroot}%{_sysconfdir}/pam.d/atd
@@ -180,6 +180,5 @@
 %attr(600,at,at) %{_localstatedir}/spool/atjobs/.SEQ
 %{_localstatedir}/adm/fillup-templates/sysconfig.atd
 %{_unitdir}/atd.service
-%{_prefix}/lib/systemd/system-sleep/atd.sh
 
 %changelog

++++++ at-3.1.14-usePOSIXtimers.patch ++++++
--- at-3.1.15.orig/atd.c
+++ at-3.1.15/atd.c
@@ -919,6 +919,54 @@ run_loop()
     return next_job;
 }
 
+#ifdef HAVE_CLOCK_GETTIME
+timer_t timer;
+struct itimerspec timeout;
+
+void timer_setup()
+{
+    struct sigevent sev;
+
+    sev.sigev_notify = SIGEV_SIGNAL;
+    sev.sigev_signo = SIGHUP;
+    sev.sigev_value.sival_ptr = &timer;
+
+    memset(&timeout, 0, sizeof(timeout));
+
+    if (timer_create(CLOCK_REALTIME, &sev, &timer) < 0)
+           pabort("unable to create timer");
+}
+
+time_t atd_gettime()
+{
+    struct timespec curtime;
+
+    clock_gettime(CLOCK_REALTIME, &curtime);
+
+    return curtime.tv_sec;
+}
+
+void atd_setalarm(time_t next)
+{
+    timeout.it_value.tv_sec = next;
+    timer_settime(timer, TIMER_ABSTIME, &timeout, NULL);
+    pause();
+}
+#else
+void timer_setup()
+{
+}
+
+time_t atd_gettime()
+{
+    return time(NULL);
+}
+
+void atd_setalarm(time_t next)
+{
+    sleep(next - atd_gettime());
+}
+#endif
 /* Global functions */
 
 int
@@ -1032,7 +1080,7 @@ main(int argc, char *argv[])
     sigaction(SIGCHLD, &act, NULL);
 
     if (!run_as_daemon) {
-       now = time(NULL);
+       now = atd_gettime();
        run_loop();
        exit(EXIT_SUCCESS);
     }
@@ -1055,13 +1103,14 @@ main(int argc, char *argv[])
     act.sa_handler = set_term;
     sigaction(SIGINT, &act, NULL);
 
+    timer_setup();
     daemon_setup();
 
     do {
-       now = time(NULL);
+       now = atd_gettime();
        next_invocation = run_loop();
        if ((next_invocation > now) && (!hupped)) {
-           sleep(next_invocation - now);
+            atd_setalarm(next_invocation);
        }
        hupped = 0;
     } while (!term_signal);
--- at-3.1.15.orig/config.h.in
+++ at-3.1.15/config.h.in
@@ -38,6 +38,9 @@
 /* Define to 1 if you have the `getloadavg' function. */
 #undef HAVE_GETLOADAVG
 
+/* Define to 1 if you have the `clock_gettime' function. */
+#undef HAVE_TIMER_CREATE
+
 /* Define to 1 if you have the <getopt.h> header file. */
 #undef HAVE_GETOPT_H
 
--- at-3.1.15.orig/configure.ac
+++ at-3.1.15/configure.ac
@@ -254,6 +254,12 @@ AC_ARG_WITH(daemon_username,
 )
 AC_SUBST(DAEMON_USERNAME)
 
+dnl check for POSIX timer functions
+AC_SEARCH_LIBS([timer_create],[rt])
+AC_CHECK_FUNCS([timer_create])
+AC_SEARCH_LIBS([clock_gettime],[rt])
+AC_CHECK_FUNCS([clock_gettime])
+
 AC_MSG_CHECKING(groupname to run under)
 AC_ARG_WITH(daemon_groupname,
 [ --with-daemon_groupname=DAEMON_GROUPNAME     Groupname to run under (default 
daemon) ],
++++++ at-3.1.15-sane-envkeys.patch ++++++
commit 482f5962d9584d6110b940f0f51ab5919a6eb8a0
Author: Ansgar Burchardt <[email protected]>
Date:   Sun Sep 28 17:06:12 2014 +0200

    at: only retain variables whose name consists of alphanumerics and 
underscores
    
    Since a recent security update[1] bash might export variables named
    BASH_FUNC_*() to the environment which the serialization code in at
    cannot handle properly.
    
      [1] <https://www.debian.org/security/2014/dsa-3035>

Index: at-3.1.15/at.c
===================================================================
--- at-3.1.15.orig/at.c
+++ at-3.1.15/at.c
@@ -390,6 +390,22 @@ writefile(time_t runtimer, char queue)
        int export = 1;
        char *eqp;
 
+        /* Only accept alphanumerics and underscore in variable names.
+         * Also require the name to not start with a digit.
+         * Some shells don't like other variable names.
+         */
+        {
+            char *p = *atenv;
+            if (isdigit(*p))
+                export = 0;
+            for (; *p != '=' && *p != '\0'; ++p) {
+                if (!isalnum(*p) && *p != '_') {
+                    export = 0;
+                    break;
+                }
+            }
+        }
+
        eqp = strchr(*atenv, '=');
        if (ap == NULL)
            eqp = *atenv;
-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to