dhelp cronjob creates an inaccesible by web server documents index when root umask is not the default

Bug #615944 reported by gzarkadas on 2010-08-10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dhelp (Ubuntu)

Bug Description

Binary package hint: dhelp

The /etc/cron.weekly/dhelp cron job is used by the dhelp package to rebuild the debian help index (file /var/lib/dhelp/documents.index) by deleting it and re-creating it.

However, if the umask of user root is more restrictive than the default 022, then the file may end-up being non-readable by the web server user account (www-data) and thus the search does not work any more (shows no results). This was the case in my system where the default umask was set to 077.

ubuntu version: 9.10
dhelp version: 0.6.17ubuntu1

Until this is get fixed upstream (change to ruby code to invoke a chmod call), the following patch in the cron job can fix this issue. It launches a sub-shell (to protect from an unwanted pertaining umask change in case of a script error) where it changes the umask and calls the rebuild method as usual:

--- dhelp~ 2009-05-05 16:35:00.000000000 +0300
+++ dhelp 2010-08-10 15:37:54.715465947 +0300
@@ -22 +22 @@
- ruby1.8 -rdhelp -e "Dhelp::DhelpDocumentPool.new.rebuild"
+ (umask 022 && ruby1.8 -rdhelp -e "Dhelp::DhelpDocumentPool.new.rebuild")

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers