Bug#573571: Potential fix for cwd bug

Jesse Smith jsmith at resonatingmedia.com
Sun Dec 16 16:35:12 GMT 2018


I did some poking around and believe I've found the issue with isserv
jumping out whenever the current working directory (cwd) is not accessible.

Basically, in the pushd() function there are two checks - one to see if
we can save the cwd, and another check to see if we can change to
/etc/init.d. If either of these checks failed, insserv would bail out.
The only important check is the second one (moving to /etc/init.d), but
both were treated as the same, fatal error and resulted in the same
error message being printed.

The attached patch fixes this situation so the two errors are handled
separately. The first check (saving cwd) will fail gracefully with an
error to stderr. The second check, moving to /etc/init.d, will fail with
a fatal error.

This patch also addresses some potential segfault issues in popd().
These probably would not happen in any practical environment, but the
extra checks should avoid crashes in the future if a directory gets
removed while insserv is running.

This fix will appear in upstream version 1.19.0 in the new year. This
patch should address the issue in 1.18.0 and earlier releases.

Jesse
-------------- next part --------------
A non-text attachment was scrubbed...
Name: insserv-cwd.patch
Type: text/x-patch
Size: 1861 bytes
Desc: not available
URL: <http://www.chiark.greenend.org.uk/pipermail/debian-init-diversity/attachments/20181216/374f511e/attachment.bin>


More information about the Debian-init-diversity mailing list