henry j. mason
2005-Oct-12 17:02 UTC
[Samba] permissions error: /var/run/samba/gencache.tdb
i've been integrating a Samba server into a mixed
windows 2000/2003 authentication environment for
use as a NAS device. i finally have things working
for the most part, but in the process of debugging
authentication i noticed an error when performing
the following command:
hmason@mpinas1:~$ smbclient -L localhost
the error shows up when loglevel = 5 in smb.conf:
Netbios name list:-
my_netbios_names[0]="MPINAS1"
Client started (version 3.0.14a-Debian).
Opening cache file at /var/run/samba/gencache.tdb
tdb(unnamed): tdb_open_ex: could not open file /var/run/samba/gencache.tdb:
Permission denied
Attempt to open gencache.tdb has failed.
resolve_hosts: Attempting host lookup for name localhost<0x20>
Opening cache file at /var/run/samba/gencache.tdb
tdb(unnamed): tdb_open_ex: could not open file /var/run/samba/gencache.tdb:
Permission denied
Attempt to open gencache.tdb has failed.
Connecting to 127.0.0.1 at port 445
these are the permissions on my /var/run/samba:
hmason@mpinas1:~$ ls -l /var/run/samba/
total 76
-rw-r--r-- 1 root root 696 2005-10-12 11:22 brlock.tdb
-rw-r--r-- 1 root root 8192 2005-10-12 11:22 connections.tdb
-rw-r--r-- 1 root root 8192 2005-10-12 10:31 gencache.tdb
-rw-r--r-- 1 root root 696 2005-10-12 11:22 locking.tdb
-rw------- 1 root root 696 2005-10-12 11:21 messages.tdb
-rw-r--r-- 1 root root 5 2005-10-12 11:21 nmbd.pid
-rw-r--r-- 1 root root 24576 2005-10-12 11:22 sessionid.tdb
-rw-r--r-- 1 root root 5 2005-10-12 11:22 smbd.pid
-rw-r--r-- 1 root root 8192 2005-10-12 11:22 unexpected.tdb
-rw-r--r-- 1 root root 5 2005-10-12 11:21 winbindd.pid
drwxr-x--- 2 root root 4096 2005-10-12 11:21 winbindd_privileged
if i change to this:
hmason@mpinas1:~$ ls -l /var/run/samba/
total 76
-rw-r--r-- 1 root root 696 2005-10-12 11:22 brlock.tdb
-rw-r--r-- 1 root root 8192 2005-10-12 11:22 connections.tdb
-rw-rw-rw- 1 root root 8192 2005-10-12 10:31 gencache.tdb
-rw-r--r-- 1 root root 696 2005-10-12 11:22 locking.tdb
-rw------- 1 root root 696 2005-10-12 11:21 messages.tdb
-rw-r--r-- 1 root root 5 2005-10-12 11:21 nmbd.pid
-rw-r--r-- 1 root root 24576 2005-10-12 11:22 sessionid.tdb
-rw-r--r-- 1 root root 5 2005-10-12 11:22 smbd.pid
-rw-r--r-- 1 root root 8192 2005-10-12 11:22 unexpected.tdb
-rw-r--r-- 1 root root 5 2005-10-12 11:21 winbindd.pid
drwxr-x--- 2 root root 4096 2005-10-12 11:21 winbindd_privileged
the relevant lines (i haven't included all the output of
the command, change to log level 5 and run the command to
see why) change to this:
Netbios name list:-
my_netbios_names[0]="MPINAS1"
Client started (version 3.0.14a-Debian).
Opening cache file at /var/run/samba/gencache.tdb
no entry for localhost#20 found.
resolve_hosts: Attempting host lookup for name localhost<0x20>
namecache_store: storing 1 address for localhost#20: 127.0.0.1:0
Connecting to 127.0.0.1 at port 445
are these appropriate permissions for this file? why is
this even an issue? samba appears to be running as root.
note that this does not appear to affect authentication.
should i leave the permissions insecure, or change them
back and ignore the error?
relevant information --->
operating system: debian 3.1, stable, kernel 2.6.13.3
samba: 3.0.14a-3 (installed using aptitude, of course)
and, here is my smb.conf:
# Samba config file created using SWAT
# from hmason2.dbsinet.local (192.168.100.68)
# Date: 2005/10/12 11:22:43
# Global parameters
[global]
workgroup = DBSINET
realm = DBSINET.LOCAL
server string = %h server (Samba %v)
security = ADS
password server = supermanii.dbsinet.local
passdb backend = tdbsam, guest
passwd chat log level = 5
syslog = 0
log file = /var/log/samba/log.%m
max log size = 1000
name resolve order = host wins bcast
hostname lookups = Yes
preferred master = No
dns proxy = No
wins server = 192.168.100.16
ldap ssl = no
panic action = /usr/share/samba/panic-action %d
idmap uid = 10000-40000
idmap gid = 10000-40000
invalid users = root
create mask = 0664
directory mask = 0775
include = /etc/samba/dhcp.conf
[public]
comment = Public file storage
path = /srv/public
read only = No
guest ok = Yes
[printers]
comment = All Printers
path = /tmp
create mask = 0700
printable = Yes
browseable = No
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
---------------
that's it. anyone care to comment? this problem is reproducible
on other debian boxes i have with a similar configuration.
thanks in advance,
henry
Gerald (Jerry) Carter
2005-Oct-13 13:56 UTC
[Samba] permissions error: /var/run/samba/gencache.tdb
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 henry j. mason wrote: | i've been integrating a Samba server into a mixed | windows 2000/2003 authentication environment for | use as a NAS device. i finally have things working | for the most part, but in the process of debugging | authentication i noticed an error when performing | the following command: | | hmason@mpinas1:~$ smbclient -L localhost | | the error shows up when loglevel = 5 in smb.conf: | | Netbios name list:- | my_netbios_names[0]="MPINAS1" | Client started (version 3.0.14a-Debian). | Opening cache file at /var/run/samba/gencache.tdb | tdb(unnamed): tdb_open_ex: could not open file | /var/run/samba/gencache.tdb: Permission denied You should eb able to just ignore this. If the gencache tdb can't be opened, we just won't use any name resolution caching. But things should work as normal. cheers, jerry ====================================================================Alleviating the pain of Windows(tm) ------- http://www.samba.org GnuPG Key ----- http://www.plainjoe.org/gpg_public.asc "There's an anonymous coward in all of us." --anonymous -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFDTmetIR7qMdg1EfYRApMnAJ41sJg0EyzHQdoHkjXHqoAijAa9WwCfagTh 87h85942Mp0hZd6wfWSyi+k=JSs4 -----END PGP SIGNATURE-----