Re: Move files do not change group as copying does.

2003-02-03 Thread Gerald (Jerry) Carter
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Fri, 31 Jan 2003, Ola Lundqvist wrote:

 The problem this time is that we have set up a permission structure
 for files in about the same way as windows do, using groups. 
 The problem is that in windows, the files inherit the group
 membership from the directory where the files (and subdirs) reside.
 
 This works fine now if the user copy the files from one place
 to the other. The problem is that if the files (and dirs) is moved
 an ordinary rename(a,b) command is used which means that the
 group membership is not changed. I use sgid on directorys to
 emulate windows behaviour but this do not help if moving files.
 
 I have looked at the code and see that there is a
 rename(a,b) emulation function, but that tries to emulate
 it truely so it gives the same problem.
 
 My suggestion is that a recursive chgrp is performed
 to the destination for all dirs and files that has the same
 group id as the source file or dir.
 
 What do you think about this?

I don't think this is the path of least surprise.  
If I move a file, it should keep the same ownership permission.
I think you might be referring to the Win2k inherit permissions
check box.  IMO this is not Samba's responsibility to emulate.
It would be more effeciently done by the file system itself.





cheers, jerry
 --
 Hewlett-Packard- http://www.hp.com
 SAMBA Team -- http://www.samba.org
 GnuPG Key   http://www.plainjoe.org/gpg_public.asc
 You can never go home again, Oatman, but I guess you can shop there.  
--John Cusack - Grosse Point Blank (1997)


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.0 (GNU/Linux)
Comment: For info see http://quantumlab.net/pine_privacy_guard/

iD8DBQE+P17TIR7qMdg1EfYRAk/OAKCSw3pKQulBvAap/Z7FIDC/uq0g+ACfS9Jp
et1Lzmmok8FagMCdYgy3n3g=
=P/yS
-END PGP SIGNATURE-




Move files do not change group as copying does.

2003-01-31 Thread Ola Lundqvist
Hello

(I'm not subscribed to please Cc: me).

I have a problem with movement of files:

The problem this time is that we have set up a permission structure
for files in about the same way as windows do, using groups.

The problem is that in windows, the files inherit the group
membership from the directory where the files (and subdirs) reside.

This works fine now if the user copy the files from one place
to the other. The problem is that if the files (and dirs) is moved
an ordinary rename(a,b) command is used which means that the
group membership is not changed. I use sgid on directorys to
emulate windows behaviour but this do not help if moving files.

I have looked at the code and see that there is a
rename(a,b) emulation function, but that tries to emulate
it truely so it gives the same problem.

My suggestion is that a recursive chgrp is performed
to the destination for all dirs and files that has the same
group id as the source file or dir.

What do you think about this?

The inherit acls = yes option do not seem to help here because,
first you need acl kernel support and second the same code for moving
files is used (but I can be mistaken).

I need to get some feedback where to patch the code and
if you are interested in it.

You can also see the debian bug:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=178800

From IRC (if that can be interesting):

debian-opal Is there anyone in here who can explain how the vfs_rename function is 
supposed to work? Exactly what arguments can you expect that it gets?
debian-opal I'm trying to create a emulation of windows group membership inheritance.
debian-opal It works ok if copying files but not if moving.
*SNIP*
abartlet debian-opal: I would be worried about the races with that proposal
debian-opal abartlet: Yes that can be a problem. The problem is that our customer 
needs to emulate that...
idra debian-opal: emulate what exactly?
abartlet you want to emulate racy windows code?
abartlet (I understand much of the ACL stuff races on WinNT too...)
debian-opal The problem is that we have set up a permission structure on a customer 
server. The permissions are based on the directory where things are located.
idra inheritance is just yet another demonstration of how good basis are converted 
in braindamaged implementations at MS ... :-(
debian-opal If you copy files the group get inherited because the sgid bit is set on 
the dir. The problem is with moving files.
idra debian-opal: so if you move files they retain the ownership ...
idra instead of inheriting the one set in the directory, right?
debian-opal Yes.
idra uhmmm
idra I think this is a bug for jeremy
idra have you written on [EMAIL PROTECTED] ?
debian-opal Nope. I wanted to ask here if someone knew, so I could patch it nice and 
quickly.
idra then write asap on the list, maube cc to jeremy directly
*SNIP*
idra debian-opal: you are using the proper smb.conf options for inheritance on that 
share?
debian-opal I think so. Are there any options that cause the rename thing not to be 
used?
debian-opal Do the dos inherit = yes really fix this?
debian-opal Sorry. inherit acls = yes. Don't I need acl support in the kernel?
idra yes you need ACL
idra but any kind of proper inheritance need ACLs
idra (Imho)
debian-opal Ok. The manual page is talking about creating a file/dir... not about 
moving.

Regards,

// Ola

-- 
 - Ola Lundqvist ---
/  [EMAIL PROTECTED] Annebergsslingan 37  \
|  [EMAIL PROTECTED] 654 65 KARLSTAD  |
|  +46 (0)54-10 14 30  +46 (0)70-332 1551   |
|  http://www.opal.dhs.org UIN/icq: 4912500 |
\  gpg/f.p.: 7090 A92B 18FE 7994 0C36  4FE4 18A1 B1CF 0FE5 3DD9 /
 ---