From owner-freebsd-database Tue Oct 27 14:52:52 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id OAA05383 for freebsd-database-outgoing; Tue, 27 Oct 1998 14:52:52 -0800 (PST) (envelope-from owner-freebsd-database@FreeBSD.ORG) Received: from mail.clearsail.net (mail.clearsail.net [207.252.227.3]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id OAA05377 for ; Tue, 27 Oct 1998 14:52:50 -0800 (PST) (envelope-from jase@clearsail.net) Received: from clearsail.net (pirate.clearsail.net [207.252.222.75]) by mail.clearsail.net (8.9.1/8.8.8) with ESMTP id QAA15280 for ; Tue, 27 Oct 1998 16:38:04 -0600 (CST) Message-ID: <36364E98.404E0329@clearsail.net> Date: Tue, 27 Oct 1998 16:52:08 -0600 From: Jason McNew X-Mailer: Mozilla 4.5 [en] (Win98; I) X-Accept-Language: en MIME-Version: 1.0 To: database@FreeBSD.ORG Subject: [Fwd: can't open a db file as 'nobody' despite 0666] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-database@FreeBSD.ORG Precedence: bulk (Forgot to CC the list, whoops!) Jason McNew wrote: > Ah, I found the problem. The particular directory was not world readable, > and had the group set to wheel. The accounts I used to test were all in the > wheel group. So I couldn't read it as nobody because that was the only one > of those that was not in the wheel group. It was pilot error! I changed > the dir a+rX and it works fine now. Thanks, and sorry for the noise. :) > > Steven Yang wrote: > > > Have you tried to chown the databse file to nobody? > > > > Steven > > > > > -----Original Message----- > > > From: Jason McNew [SMTP:jase@clearsail.net] > > > Sent: Tuesday, October 27, 1998 5:01 PM > > > To: database@FreeBSD.ORG > > > Subject: can't open a db file as 'nobody' despite 0666 > > > > > > I'm using DB_File.pm which is a wrapper for db(3), and for some reason > > > I > > > can't open any database files if I'm the user 'nobody'. If I run it > > > as > > > a normal user (not owner or group member of the file in question), my > > > program works fine. But, if I su over to 'nobody', it's instantly > > > broken. I checked the db(3) manpage, but I diden't see anything about > > > it in there. I also read DB_File.pm's POD docs and still no luck. > > > The > > > error I'm getting is "permission denied." > > > > > > Here is the simplest program I could write that duplicates the > > > problem: > > > > > > #!/usr/local/bin/perl > > > use DB_File; > > > $db = '/home/jase/test.db'; > > > tie %urldb, 'DB_File', $db, O_RDONLY, 0666, $DB_BTREE or > > > die("coulden't open $db: $!"); > > > > > > whereas /home/jase/test.db is -rw-rw-rw- > > > > > > When I try to do this from a cgi script (apache runs as nobody) it > > > spits > > > out: > > > > > > coulden't open /home/jase/test.db: Permission denied at test.pl line > > > 4. > > > > > > But the same scirpt runs just fine even when I run it as a user in a > > > different group... except when I su to nobody.. > > > > > > %/usr/local/bin/perl -v > > > > > > This is perl, version 5.005_51 built for i386-freebsd > > > > > > > > > I can work around this by making apache run as a different user, but > > > I'd > > > still like to know why this brakes, and better still, where it needs > > > to > > > be documented (provided it's not pilot error!) :) > > > > > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > > > with "unsubscribe freebsd-database" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-database" in the body of the message