The third parameter to dbmopen is the permission mask for the file. (from 'man perlfunc')
use DB_File;
dbmopen(%NS_Hist, "$ENV{HOME}/.netscape/history.db",0666)
or die "Can't open netscape history file: $!";
This is the mode bits that are not set if it is created by the dbmopen. ie. All the mode bits are set to 1 except those listed here. Once set, either by the create or by you chmod-ing them, the permissions shouldn't change.Update nardo's bit mask explination is better than mine.
What you should probably consider doing is making the files owned by the user that the webserver runs as, which is usually nobody or httpd. That way you could make the files only readable / writable by the webserver (mode 0600).
If your code is creating the empty dbm files, then the directory that they are being created in must also be writable by the webserver. Personally, I'd make a directory somewhere (not under the CGI, or HTML tree) that was owned and only accessable by the webserver to put your dbms in.
/\/\averick
|