The following commit has been merged in the master branch:
commit 4ecd0ef5d2e2a65402f9a6d45f9d5b96d12516d0
Author: Guillem Jover <[email protected]>
Date:   Mon Mar 15 06:20:14 2010 +0100

    s-s-d: Do not allow a --retry schedule where forever is the last item
    
    The forever item needs something to repeat over, otherwise we just get
    an infinite loop doing nothing.
    
    Closes: #570938

diff --git a/debian/changelog b/debian/changelog
index dbf31c4..885dded 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,8 @@ dpkg (1.15.6.1) UNRELEASED; urgency=low
     avoid exposing the configure variable HAVE_C99 on installed headers.
   * Use __attribute__ keyword depending on compiler support, we avoid
     exposing the configure variable HAVE_C_ATTRIBUTE on installed headers.
+  * Do not allow a --retry schedule in start-stop-daemon where forever is
+    the last item, as it needs something to repeat over. Closes: #570938
 
   [ Raphaƫl Hertzog ]
   * Accept source packages without "Format" field for compatibility with very
diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c
index a30d84c..bcc0340 100644
--- a/utils/start-stop-daemon.c
+++ b/utils/start-stop-daemon.c
@@ -686,6 +686,9 @@ parse_schedule(const char *schedule_str)
                        }
                        count++;
                }
+               if (repeatat == count)
+                       badusage("invalid schedule: 'forever' appears last, "
+                                "nothing to repeat");
                if (repeatat >= 0) {
                        schedule[count].type = sched_goto;
                        schedule[count].value = repeatat;

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to