[linux-cifs-client] CIFS mounting problems (twilight zone :)

Vanja Hrustic vanja at pobox.com
Thu Jun 16 15:31:48 GMT 2005


I've used smbfs before, but wanted to try cifs - as suggested in many
places.

I've spent almost 2 days now trying to get this work, but I started
losing my mind.

The scenario is fairly simple - there is a server (CentOS4, running
Samba 3.0.10), and a client (CentOS4, running Samba 3.0.10).

modinfo for cifs module gives:

filename:       /lib/modules/2.6.9-11.EL/kernel/fs/cifs/cifs.ko
<snip>
version:        1.20 BD05AA287A833DA8A57BDC6

Server exports some directories. For example:

[repository]
  path = /shares/repository
  public = no
  valid users = vanja
  writable = yes
  directory mask = 0775
  create mask = 0775
  force group = smb

[company]
  path = /shares/company
  public = no
  valid users = vanja
  writable = yes
  directory mask = 0775
  create mask = 0775
  force group = company

Unix extensions are enabled.

There is user 'vanja' on both machines. 'vanja' is a member of both
groups (smb, company) on Samba server machine.

For a day, I was trying all possible combinations of smb.conf and /etc/
fstab entries (and manual mount.smbfs commands) in order to make client
machine able to actually write to remote shares. Shares (on the server)
are group writable, and in many cases subdirs are owned by user
'vanja'. I failed miserably, and would always get "Permission denied".
In logs on the Samba server, I could see things like (snort snippet):

[2005/06/16 17:06:05, 3] smbd/trans2.c:call_trans2qfilepathinfo(2367)
  call_trans2qfilepathinfo: SMB_VFS_LSTAT of
opasdfspdofkpsdofkpsdokspdofk failed (No such file or directory)
[2005/06/16 17:06:05, 3] smbd/error.c:error_packet(105) error string =
No such file or directory [2005/06/16 17:06:05, 3] smbd/
error.c:error_packet(129) error packet at smbd/trans2.c(2240) cmd=50
(SMBtrans2) NT_STATUS_OBJECT_NAME_NOT_FOUND

Basically, I would get "Permission denied" on the client machine, and
"No such file or directory" in the server logs. No idea if that's how
things should work.

Then, out of misery, I rebooted. CIFS fs ("repository" at that
time,since I was testing w/ 1 share only) got mounted on the next boot,
and suddenly, I was able to write to it without any problems. I would
expect this to work on Windows, but never expected something to start
working after I reboot Linux workstation.

Anyway - happy as I was, I added another share ("company") to the
smb.conf, and expected things to work.

Tough luck - no matter what I do, I always get "Permission denied" on
the client side, although the directory structure is pretty similar,
and there are many dirs owned by 'vanja' to which I can't write. The
only difference is the group name, but 'vanja' is the member of that
group in the same manner as is the member of 'smb' group which works on
"repository".

Added 3rd share, where there are few dirs completely owned by me, and I
couldn't even cd to them.

Rebooted 2 times already, hoping that some magic would kick in and
things would start working, but I stil only can write to "repository"
and nothing else.

Basically, I've tried just about any possible combination of options
in /etc/fstab (uid/gid/ip/domain/credentials/username/password and
probably more, but can't recall everything now) and smb.conf, but it
just won't let me write to other shares. And as I've mentioned before,
"repository" also wouldn't work until I rebooted.

If I su to vanja on server box, I can write to all those dirs without
any problem. Not to mention that everything works just fine using
smbclient, for example.

So, since I am desperate, I really wonder if there is a logical
explanation for these problems? I mean, how does UID/GID "mapping" with
"unix extensions" enabled really work - is it enough to have same
usernames on both machines? Do UIDs need to match? If so, why does then
"repository" allow me to write to it, and other shares do not (and yet,
setup is the same)?

>From what I've seen in the logs, the "mapping" of username I use to
authenticate seems to work ok, since debug logs mentions groups in
which user 'vanja' is (vanja, smb, company).

I could probably write a book with details of what I've tried and paste
megabytes of logs, but I simply need to know if this is supposed to
work and I am doing something stupid, or there are bugs in cifs which
make things work in 'unexpected' ways.

Any help is much appreciated :)

Vanja


More information about the linux-cifs-client mailing list