This queue is for tickets about the App-Daemon CPAN distribution.

Report information
The Basics
Id:
75219
Status:
resolved
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
david.serrano [...] qindel.com
Cc:
AdminCc:

BugTracker
Severity:
(no value)
Broken in:
(no value)
Fixed in:
(no value)



From david.serrano@qindel.com Wed Feb 22 11: 10:17 2012
CC: David Serrano <david.serrano@qindel.com>
MIME-Version: 1.0
X-Spam-Status: No, score=-1.899 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9, SPF_FAIL=0.001] autolearn=no
Content-Disposition: inline
X-Spam-Flag: NO
X-Virus-Checked: Checked by ClamAV on 16.mx.develooper.com
Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NKoe5XOeduwbEQHU"
Message-ID: <20120222160959.GC24493@hue3>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Virus-Scanned: amavisd-new at
X-Copyrighted-Material: Please visit http://www.qindel.com/privacy.htm
X-Spam-Score: -1.899
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 455E324183F for <cpan-bug+App-Daemon@hipster.bestpractical.com>; Wed, 22 Feb 2012 11:10:17 -0500 (EST)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0NrpybIHN5N7 for <cpan-bug+App-Daemon@hipster.bestpractical.com>; Wed, 22 Feb 2012 11:10:13 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 913D524183D for <bug-App-Daemon@rt.cpan.org>; Wed, 22 Feb 2012 11:10:12 -0500 (EST)
Received: (qmail 18285 invoked by uid 103); 22 Feb 2012 16:10:11 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 22 Feb 2012 16:10:11 -0000
Received: from smtp.qindel.com (HELO thor.int.qindel.com) (62.97.67.18) by 16.mx.develooper.com (qpsmtpd/0.80/v0.80-19-gf52d165) with ESMTP; Wed, 22 Feb 2012 08:10:05 -0800
Received: from localhost (localhost [127.0.0.1]) by thor.int.qindel.com (Postfix) with ESMTP id 941F91A85C; Wed, 22 Feb 2012 17:06:16 +0100 (CET)
Received: from thor.int.qindel.com ([127.0.0.1]) by localhost (thor.int.qindel.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PU2DYdqMHmYr; Wed, 22 Feb 2012 17:06:16 +0100 (CET)
Received: by thor.int.qindel.com (Postfix, from userid 106) id ED6271A876; Wed, 22 Feb 2012 17:06:15 +0100 (CET)
Received: from hue3 (unknown [172.26.9.94]) by thor.int.qindel.com (Postfix) with ESMTPSA id DC3E91A85C; Wed, 22 Feb 2012 17:06:15 +0100 (CET)
Received: by hue3 (Postfix, from userid 1000) id 7EB66A20106; Wed, 22 Feb 2012 17:09:59 +0100 (CET)
Delivered-To: cpan-bug+App-Daemon@hipster.bestpractical.com
User-Agent: Mutt/1.5.20 (2009-06-14)
Subject: App::Daemon sets too restrictive umask
Return-Path: <david.serrano@qindel.com>
X-RT-Mail-Extension: app-daemon
X-Original-To: cpan-bug+App-Daemon@hipster.bestpractical.com
X-Spam-Check-BY: 16.mx.develooper.com
X-Old-Spam-Status: No, score=-4.342 tagged_above=-10 required=6.6 tests=[ALL_TRUSTED=-1.8, AWL=0.057, BAYES_00=-2.599] autolearn=ham
X-Old-Spam-Level:
Date: Wed, 22 Feb 2012 17:09:59 +0100
X-Old-Spam-Flag: NO
X-Spam-Level:
To: bug-App-Daemon@rt.cpan.org
From: David Serrano <david.serrano@qindel.com>
Content-Length: 0
content-type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
X-RT-Original-Encoding: iso-8859-1
Content-Length: 1420
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
Content-Description: Digital signature
content-type: application/pgp-signature; name="signature.asc"
Content-Disposition: inline
Content-Length: 836

Message body not shown because it is not plain text.

MIME-Version: 1.0
In-Reply-To: <20120222160959.GC24493@hue3>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
References: <20120222160959.GC24493@hue3>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-10808-1329929479-330.75219-0-0@rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 386
On Wed Feb 22 11:10:18 2012, david.serrano@qindel.com wrote:
Show quoted text
> Currently the function detach sets the process umask to 0133 so that > "newly > created files have rw-r--r-- permissions by default" (sic).
Note also that both perl "open" and C "fopen" request permissions 0666 for new files, so, in practice, both umask 0133 and umask 0022 create files with the same permissions (0644).
MIME-Version: 1.0
In-Reply-To: <20120222160959.GC24493@hue3>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
References: <20120222160959.GC24493@hue3>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-10813-1329980081-401.75219-0-0@rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 571
Hmm, interesting, I thought I had gotten rid of the umask in [rt #69561], but seems that I've fixed the pidfile permission without actually removing the umask call. So, according to http://en.wikipedia.org/wiki/Daemon_%28computing%29 which says "Changing the umask to 0 to allow open(), creat(), et al. operating system calls to provide their own permission masks and not to depend on the umask of the caller" I've changed the code to set the umask to 0: https://github.com/mschilli/app- daemon/commit/30deb73d86ad789ac820def113c403b48bec4a23 Looks good?


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.