tag 289633 patch
done

Perhaps I should have quoted the next sentence:

    If a script requires non-POSIX features from the shell interpreter,
    the appropriate shell must be specified in the first line of the
    script (e.g., #!/bin/bash) and the package must depend on the
    package providing the shell (unless the shell package is marked
    "Essential", as in the case of bash).

> Will dash only write "-e" to the log? Or will it simply write -e
> followed by the message, just without interpreting of the escape
> characters?

dash's echo always behaves like bash's echo with -e passed, so the
result is that /etc/logrotate.d/atftpd contains:

    -e /var/log/atftpd.log {
       daily
       rotate 5
       compress
       copytruncate
       missingok
     }

This is invalid syntax, and causes logrotate to error out:

    /etc/cron.daily/logrotate:
    error: atftpd:1 lines must begin with a keyword or a filename (possibly in 
double quotes)
    error: atftpd:7 unxpected }
    run-parts: /etc/cron.daily/logrotate exited with return code 1

This breaks log rotation for every package on the system, not just
atftpd. (critical severity?)

I'm attaching a patch that fixes this bug.
--
mithrandi, i Ainil en-Balandor, a faer Ambar
--- /var/lib/dpkg/info/atftpd.postinst  2004-12-29 15:12:05.000000000 +0200
+++ atftpd.postinst     2005-01-11 13:18:51.000000000 +0200
@@ -95,13 +95,15 @@
                chmod 640 $RET
            fi
            # modify the logrotate file
-           echo -e "$RET {\n" \
-                   "  daily\n" \
-                   "  rotate 5\n" \
-                   "  compress\n" \
-                   "  copytruncate\n" \
-                   "  missingok\n" \
-                   "}" > /etc/logrotate.d/atftpd
+           cat >/etc/logrotate.d/atftpd <<EOF
+$RET {
+    daily
+    rotate 5
+    compress
+    copytruncate
+    missingok
+}
+EOF
        fi
     else
        LOGFILE=""

Reply via email to