CGI, and linux file permissions

Derek Basch dbasch at
Tue Jan 11 18:16:53 EST 2005


I have a CGI script which uses to create a DBM. However I get this

 /usr/lib/python2.3/bsddb/ 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, db.DB_HASH, flags, mode)
  193     return _DBWithCursor(d)
d = <DB object>, = <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/'>, db.DB_HASH = 2, flags = 65, mode =

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

The permissions on the CGI script (/usr/lib/cgi-bin/ are:

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

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! 

More information about the Python-list mailing list