473,513 Members | 2,454 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CGI, anydbm.open() and linux file permissions

Hello,

I have a CGI script which uses anydb.open() to create a DBM. However I get this
traceback:

/usr/lib/python2.3/bsddb/__init__.py in
hashopen(file='/var/www/bp/predictor/tools.dbm', flag='c', mode=438,
pgsize=None, ffactor=None, nelem=None, cachesize=None, lorder=None, hflags=0)
190 if ffactor is not None: d.set_h_ffactor(ffactor)
191 if nelem is not None: d.set_h_nelem(nelem)
192 d.open(file, db.DB_HASH, flags, mode)
193 return _DBWithCursor(d)
194
d = <DB object>, d.open = <built-in method open of DB object>, file =
'/var/www/bp/predictor/tools.dbm', global db = <module '_bsddb' from
'/usr/lib/python2.3/lib-dynload/_bsddb.so'>, db.DB_HASH = 2, flags = 65, mode =
438

DBAccessError: (13, 'Permission denied')
args = (13, 'Permission denied')

The permissions on the CGI script (/usr/lib/cgi-bin/evaluator.py) are:

-rwxr-xr-x 1 bpeters bpeters 2446 Jan 11 14:42 evaluator.py

and the permissions on the target DBM creation directory
(/var/www/bp/predictor/) are:

drwxr-xr-x 2 bpeters bpeters 4096 Jan 11 14:45 predictor

Can anyone tell me what I need to do to allow the CGI script to create the DBM
in the target directory? That is short of changing everything to root.

Thanks everyone,
Derek Basch

__________________________________
Do you Yahoo!?
Meet the all-new My Yahoo! - Try it today!
http://my.yahoo.com
Jul 18 '05 #1
1 3071
On Tue, 11 Jan 2005 15:16:53 -0800 (PST),
Derek Basch <db****@yahoo.com> wrote:
Hello,
I have a CGI script which uses anydb.open() to create a DBM. However I get this
traceback: /usr/lib/python2.3/bsddb/__init__.py in
hashopen(file='/var/www/bp/predictor/tools.dbm', flag='c', mode=438,
pgsize=None, ffactor=None, nelem=None, cachesize=None, lorder=None, hflags=0)
190 if ffactor is not None: d.set_h_ffactor(ffactor)
191 if nelem is not None: d.set_h_nelem(nelem)
192 d.open(file, db.DB_HASH, flags, mode)
193 return _DBWithCursor(d)
194
d = <DB object>, d.open = <built-in method open of DB object>, file =
'/var/www/bp/predictor/tools.dbm', global db = <module '_bsddb' from
'/usr/lib/python2.3/lib-dynload/_bsddb.so'>, db.DB_HASH = 2, flags = 65, mode =
438 DBAccessError: (13, 'Permission denied')
args = (13, 'Permission denied') The permissions on the CGI script (/usr/lib/cgi-bin/evaluator.py) are: -rwxr-xr-x 1 bpeters bpeters 2446 Jan 11 14:42 evaluator.py and the permissions on the target DBM creation directory
(/var/www/bp/predictor/) are: drwxr-xr-x 2 bpeters bpeters 4096 Jan 11 14:45 predictor Can anyone tell me what I need to do to allow the CGI script to create the DBM
in the target directory? That is short of changing everything to root.


Chances are that for security reasons your script probably runs as user
"nobody" or another special user ID set up specifically for running CGI
scripts (rather than your user id). Check your web server's
documentation, or render the output of sys.getuid, sys.geteuid,
sys.getgid, and sys.getedig. One solution is to open up the permissions
of /var/www/bp/predictor; a better solution is to change its owner to
whatever user ID runs your script.

HTH,
Dan

--
Dan Sommers
<http://www.tombstonezero.net/dan/>
Never play leapfrog with a unicorn.
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1567
by: Gary Richardson | last post by:
According to the Python Library Reference invoking anydbm.open() with flag value 'n' should always create a new empty database. However, the following code produces an error. I stumbled upon this...
1
2673
by: Alessandro Crugnola *sephiroth* | last post by:
Hi all I'm trying to compile a python app with py2exe (not the 0.5.0.. i think 0.4.1) which uses the anydbm module But when i launch the exe file created it raise this error:...
0
1181
by: Eric S. Johansson | last post by:
I have a preference for gdbm when building DBM based dictionaries but have found I cannot count on it being there all the time. Therefore, I have created this little tidbit which you call before...
16
2207
by: Gary Wessle | last post by:
Hi please help with this. std::fstream iofs( f.c_str(), std::ios::in|std::ios::out ); std::cout << f << '\n' << iofs.is_open() << std::endl; puts out...
24
5021
by: dancer | last post by:
Using ASP.net 1.1 and Microsoft Access. I received the following error message. Why? I have closed the Access file. I have another very small access file that opens with no trouble with the...
0
4952
by: Salad | last post by:
A97. Split database. Frontend DB1.MDB. Backend DB1BE.MDB. Tables are linked between DB1 and DB2. From my testing, if I open DB1 exclusively using /excl the backend DB1BE is not opened...
6
1578
by: davidj411 | last post by:
anydbm and dictionary{} seem like they both have a single key and key value. Can't you put more information into a DBM file or link tables? I just don't see the benefit except for the persistent...
0
1120
by: Torsten Bronger | last post by:
Hallöchen! A TurboGears process opens a DB file with anydbm and keeps it open. The the same time, this file is updated by another process. How can I tell the TurboGears process to fetch the new...
5
9080
by: tyakimov | last post by:
Hi guys I got a problem On my IIS server I changed the password for the Internet Guest Account 'IUSR_Machine' and suddenly the PHP part of the intranet stopped working. - '... failed to open...
0
7259
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7380
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7535
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7523
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5683
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3232
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1592
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.