CC: | David Serrano <david.serrano [...] qindel.com> |
Subject: | App::Daemon sets too restrictive umask |
Date: | Wed, 22 Feb 2012 17:09:59 +0100 |
To: | bug-App-Daemon [...] rt.cpan.org |
From: | David Serrano <david.serrano [...] qindel.com> |
Currently the function detach sets the process umask to 0133 so that "newly
created files have rw-r--r-- permissions by default" (sic). This precludes the
process from creating readily usable directories:
$ perl
use warnings;
use strict;
use App::Daemon 'daemonize';
daemonize;
mkdir '/tmp/foobar';
__END__
$ ls -ld /tmp/foobar
drw-r--r-- 2 hue hue 4096 20120222:170458+0100 /tmp/foobar/
$ cd /tmp/foobar
bash: cd: /tmp/foobar: Permission denied
$ _
By manually resetting the process' umask, all is well again:
$ perl
use warnings;
use strict;
use App::Daemon 'daemonize';
daemonize; umask 0022;
mkdir '/tmp/foobar';
__END__
$ ls -ld /tmp/foobar
drwxr-xr-x 2 hue hue 4096 20120222:170820+0100 /tmp/foobar/
$ cd /tmp/foobar
$ _
This happens with App::Daemon 0.13, although I can see that 0.14 is affected as
well by browsing the code at cpan.org.
--
David Serrano
GnuPG id: 280A01F9
- GRAVITY SUCKS!
Legal boilerplate:
**AVISO LEGAL**
Este mensaje se dirige exclusivamente a su destinatario y puede contener
información privilegiada o confidencial. Si no es usted el destinatario
indicado, queda notificado que la utilización, divulgación y/o copia sin
autorización está prohibida en virtud de la legislación vigente. Si ha
recibido este mensaje por error, le rogamos que nos lo comunique
inmediatamente por esta misma vía y proceda a su destrucción.
--
Sent from my employer's Dell Vostro 3500
Message body not shown because it is not plain text.