write permissions on samba

Hello
I have set up a samba server which has been working fine for several years, I can log in, open, write, save from windoze shares without a problem.
I recently installed suse 11.1 on my laptop, i set my username the same as for my windoze machines, also password the same so acessing samba would be easy - i was wrong.
I have mounted the samba share on the laptop using (in fstab):
//192.168.0.99/data /home/rob/data/ -o username=rob,password=********,rw,noperm,file_mode=0777,dir_mode=0777

i can browse the share using kde filenamager and load / read files but if i try to save the (update) file i get a write permission error, if i save the file to a new name it saves correctly but if i then try to open the new file and save it i get the write permission error.
The permissions are set to owner read/write, group and other read only.
I don’t have any problems from windoze machines, It appears that my linux client is not accessing the files with the correct username, but I can’t see why, if i view the permissions in konqueror it shows up as owner rob, with read/write which is correct.
The permissions for the mount are all set to read write for owner(rob/users), readonly for others in the group and others.
One strange thing is if i open up a console window and use vi (as user rob) I can edit the file and save it as I would expect to, it appears that kde is having a problem with username for some reason.
Can anyone suggest what might be going on here - it’s driving me up the wall!

thanks
rob carter

I can’t quite figure out what’s happening Rob. So I need to ask some questions:

  1. Please paste here the stanza from smb.conf on the Server that governs the share //192.168.0.99/data and also the [global] stanza from smb.conf on the server (or the whole file smb.conf would be easier I suppose)
  2. What are the underlying permissions and ownership on the Linux directory that is shared as “data” on the network? (you might have said something about this but I couldn’t sort out the server from the client in what you said).
  3. Which user/s if any have been added to the Samba user database on the Linux server? You can check that with he console command: sudo pdbetid -L
  4. What operating system and version is running on the Linux server?
  5. Check that the RPM cifs is installed on the Linux client

PS if I had to make some guesses about the server I would use this line in fstab, but success depends on the guesses:
//192.168.0.99/data /home/rob/data/ cifs username=rob,password=********,_netdev,uid=rob,gid=users 0 0

PS: And if you’re editing ms office or OpenOffice files, you’d need the extra option: nobrl

Hi

thanks for the reply, my smb.conf from the server is below
The server machine is running linux 10.2, the /data share is on the same hard disk as the operating system and has permissions 0755 (owner rob, group users.
On the client I have set up a user rob, with the same password as on the server (basically the same as on the windoze machines)

On the client (suse 11) I can browse all the shares and open files (as previously stated) but cannot write.
Interestingly I can read and write shares using my eeepc, the difference appears to be that the eeepc offers the facility to mount shares from the file manager, and when i do this it ask me for a username and password, which kde does not.
Therfore I believe that this is maybe kde problem

pdbedit -L gives:
rob:1000:robert carter
caroline:1001:caroline
helen:1003:helen carter
harry:1004:harry carter
root:0:root

cifs is installed on the client, i also notice that if i set the share permissions to 0775 I can write which tends to suggest to me that it is a password problem maybe?

any help/suggestions appreciated, smb.conf follows

Samba config file created using SWAT

from 192.168.0.2 (192.168.0.2)

Date: 2009/03/20 08:37:16

[global]
workgroup = KARTER
server string = Server
map to guest = Bad User
log level = 3
printcap name = cups
add machine script = /usr/sbin/useradd -c Machine -d /var/lib/nobody -s /bin/false %m$
logon path = \%L\profiles.msprofile
logon drive = P:
logon home = \%L%U.9xprofile
domain master = No
ldap ssl = no
usershare allow guests = Yes
write list = rob, root, admin, caroline, helen, harry
printer admin = @ntadmin, root
cups options = raw
include = /etc/samba/dhcp.conf

[homes]
comment = Home Directories
valid users = %S, %D%w%S
read only = No
inherit acls = Yes
browseable = No

[profiles]
comment = Network Profiles Service
path = %H
read only = No
create mask = 0600
directory mask = 0700
store dos attributes = Yes

[users]
comment = All users
path = /home
read only = No
inherit acls = Yes
veto files = /aquota.user/groups/shares/

[printers]
comment = All Printers
path = /var/tmp
create mask = 0600
guest ok = Yes
printable = Yes
browseable = No

[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = @ntadmin, root
guest ok = Yes

[data]
comment = work data
path = /data
write list =
read only = No
guest ok = Yes

[multimedia]
path = /multimedia
read only = No
guest ok = Yes

[laserjet5mp]
comment = Hewlett-Packard HP LaserJet 5MP
path = /var/tmp
read only = No
create mask = 0600
guest ok = Yes
printable = Yes
printer name = laserjet5mp
oplocks = No
share modes = No

On the client side:
The Linux owner of /data is rob:users with permissions drwxr-xr-x
rob is a member of the write list because that’s defined in [global] so all is well except perhaps to set it up like this:

[data]
comment = work data
path = /data
force user = rob
read only = No
guest ok = Yes

The force user parameter makes all files in the directory, no matter who creates or edits them over the network, guests or whoever, to behave as if created or manipulated by rob:users, which is necessary because you’ve set the folder to be rob:users with drwxr-xr-x.

So the thing to do is to add the line: force user = rob

On the server side, you’ve got incorrect syntax in the mount entry in fstab. Make it like this:

//192.168.0.99/data /home/rob/data/ cifs username=rob,password=robs_password,_netdev,uid=rob,gid =users 0 0

That should create a mount that shows the files from the server in the client folder /home/rob/data. They should behave and be able to be manipulated as if the user is rob and all should be well.

PS
[If you want to mount it in Linux clients so anyone, not just rob, can get access then the setup and mount commands would be slightly different.

For example if you made the permissions on the shared folder on the server to be drwxrwxrwx, then wherever you mounted it in a client, the perms would be magically drwxrwxrwx – and so on.]

Unless you’ve unearthed a real KDE bug – we’ll see soon.

Hi

thanks for the help, I regret I still can’t write using KDE!
I mount the share manually (as superuser) thus:
mount //192.168.0.99/data /home/rob/data/ -t cifs -o username=rob,password=ivorcarter,_netdev,uid=rob,gid=users

now change to the data share: cd/home/rob/data
vi main.c - no problems can save ok
kwrite main.c - cannot save an error message appears, if I do a saveas that works fine but then if i try to save again i get a permissions or disk space error message!

Now if i unmount the share and then browse to it using the dolphin file manager i can edit and save the files in kwrite - provided they are op/dataened from the file manager browsing the share.

This is most confusing, does anyone have any idea what is going on, is this a kde bug, for the record i’m using kde 4.1.3 release 4.9

regards
rob carter

If you can edit and save with vi but not with kwrite, there’s a good chance it’s a kwrite/kde4 bug IMHO. I suggest try kate, gedit and leafpad, all easily installed, and then if that proves it’s a kwrite bug in KDE4, make a bug report.

Hello

I can save ok with vi, vim and emacs, kwrite, joe and kate give a similar error.
I presume this is a kde bug maybe?

regards
rob carter

Looks like