Skip Menu |
 

This queue is for tickets about the forks-BerkeleyDB CPAN distribution.

Report information
The Basics
Id: 29306
Status: resolved
Priority: 0/
Queue: forks-BerkeleyDB

People
Owner: RYBSKEJ [...] cpan.org
Requestors: jackowski.piotr [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)

Attachments


Subject: Multiuser problem
Date: Tue, 11 Sep 2007 15:56:58 -0700
To: bug-forks-BerkeleyDB [...] rt.cpan.org
From: "Piotr Jackowski" <jackowski.piotr [...] gmail.com>
Download (untitled) / with headers
text/plain 955b
Hi, At the begging I would like to thank you for that superb modules forks and forks::BerkeleyDB. They are very useful for me. I'm using them in productive environment. But on my development environment many users use that module, and there is a problem with privileges. forks:: BerkeleyDB saves by default in /tmp/pelrforks/ENV_SUBPATH subdirectory shared variables. ENV_SUBPATH is defined in forks::BerkeleyDB::Config.pm with: use constant ENV_SUBPATH => int(ENV_PID / 100).'/'.ENV_PID.'/bdb'; where ENV_PID => $$ When one user will use forks::BerkeleyDB with for example with $$ == 30001 then module will create /tmp/perlforks/300/30001 directory But when another user with $$ == 30002, module will try to crate /tmp/perlforks/300/30002 that will crash with unable to create 30002 subdirectory and program dies:( So workerund for this is for example use constant ENV_SUBPATH => int(ENV_PID * 100).'/'.ENV_PID.'/bdb'; Regards, Peter
From: RYBSKEJ [...] yahoo.com
Download (untitled) / with headers
text/plain 1.2k
Peter, Sounds likely that the user's umask is affecting the default permissions that mkdir users. Try the attached patch on a clean forks::BerkeleyDB 0.51 distribution. -Eric On Tue Sep 11 20:46:41 2007, jackowski.piotr@gmail.com wrote: Show quoted text
> Hi, > > At the begging I would like to thank you for that superb modules forks and > forks::BerkeleyDB. They are very useful for me. I'm using them in
productive Show quoted text
> environment. > > But on my development environment many users use that module, and there > is a problem with privileges. > forks:: BerkeleyDB saves by default in /tmp/pelrforks/ENV_SUBPATH > subdirectory shared variables. > ENV_SUBPATH is defined in forks::BerkeleyDB::Config.pm with: > use constant ENV_SUBPATH => int(ENV_PID / 100).'/'.ENV_PID.'/bdb'; > where ENV_PID => $$ > > When one user will use forks::BerkeleyDB with for example with $$ ==
30001 Show quoted text
> then module will create /tmp/perlforks/300/30001 directory > > But when another user with $$ == 30002, module will try to crate > /tmp/perlforks/300/30002 that will crash with unable to create > 30002 subdirectory and program dies:( > > So workerund for this is for example > use constant ENV_SUBPATH => int(ENV_PID * 100).'/'.ENV_PID.'/bdb'; > > > Regards, > Peter
--- forks.pm.0.51 2007-09-21 23:28:57.953125000 -0400 +++ forks.pm.0.51.patched 2007-09-21 23:33:52.968750000 -0400 @@ -102,9 +102,11 @@ my $curpath = ''; foreach (split(/\//o, ENV_PATH)) { $curpath .= $_ eq '' ? '/' : "$_/"; - next if -d $curpath; - my $status = mkdir $curpath, 0777; - _croak( "Can't create directory ".ENV_ROOT ) unless $status; + unless (-d $curpath) { + my $status = mkdir $curpath, 0777; + _croak( "Can't create directory ".ENV_ROOT.': '.$! ) unless $status || -d $curpath; + } + chmod 0777, $curpath; } }
Download (untitled) / with headers
text/plain 124b
Issue has been addressed in forks::BerkeleyDB 0.052. Temp directories are now no longer restricted by user's default umask.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

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