Bug 7638 - "inherit owner" does not work due to fail for "change_dir_owner_to_parent"
Summary: "inherit owner" does not work due to fail for "change_dir_owner_to_parent"
Status: RESOLVED DUPLICATE of bug 8211
Alias: None
Product: Samba 3.5
Classification: Unclassified
Component: File services (show other bugs)
Version: 3.5.4
Hardware: x86 Linux
: P3 normal
Target Milestone: ---
Assignee: Volker Lendecke
QA Contact: Samba QA Contact
URL:
Keywords:
: 6507 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-08-22 02:20 UTC by TAKAHASHI Motonobu
Modified: 2018-03-31 14:14 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description TAKAHASHI Motonobu 2010-08-22 02:20:36 UTC
"inherit owner" does not work, if both inherit acls and inherit permissions are yes and the default ACLfor owner is not set for "rwx".

Here is a reproduce setting:

smb.conf
-----
[share]
  path = /some/where/share
  writeable = yes
  inherit owner = yes
  inherit acls = yes
  inherit permissions = yes

ACL setting:
------------
# getfacl share/
# file: share/
# owner: root
# group: root
user::rwx
group::r-x
group:group1:rwx
mask::rwx
other::r-x
default:user::r-x <--- set other than "rwx"
default:group::---
default:group:group1:---
default:mask::rwx
default:other::---

Permission setting:
-------------------
# ls -l
total 8
drwxrwxr-x+ 40 root   root   4096 Aug 21 16:52 share

And access as an USER who belongs to "group1" group.

If we create any directory under share, the owner of the directory set to the USER, not to "root".

log.smbd shows:
-----
[2010/08/21 16:29:56.868131,  0] smbd/open.c:315(change_dir_owner_to_parent)
  change_dir_owner_to_parent: device/inode/mode on directory New Folder (17). Refusing to chown !
-----

This means the mode of the directory is not same: 

To examine, I modify the source code:

-----
        /* Ensure we're pointing at the same place. */
        if (smb_fname_cwd->st.st_ex_dev != psbuf->st_ex_dev ||
            smb_fname_cwd->st.st_ex_ino != psbuf->st_ex_ino ||
            smb_fname_cwd->st.st_ex_mode != psbuf->st_ex_mode ) {
                DEBUG(0,("change_dir_owner_to_parent: "
                         "device/inode/mode on directory %s changed %o:%o. "
                         "Refusing to chown !\n", fname, smb_fname_cwd->st.st_ex
_mode, psbuf->st_ex_mode ));
-----

And the log.smbd shows:
-----
[2010/08/21 16:46:42.164735,  0] smbd/open.c:315(change_dir_owner_to_parent)
  change_dir_owner_to_parent: device/inode/mode on directory New Folder (29)
 changed 40775:40570. Refusing to chown !
-----

#6507 may be the same problem.
Comment 1 TAKAHASHI Motonobu 2011-06-15 16:05:30 UTC
I tried to reproduce against Samba 3.5.9 and found this issue was fixed. Maybe this issue is same as BUG#8211.

BUG#6507 is also duplicated?
Comment 2 Björn Jacke 2011-06-15 21:19:42 UTC

*** This bug has been marked as a duplicate of bug 8211 ***
Comment 3 Björn Jacke 2018-03-31 14:14:08 UTC
*** Bug 6507 has been marked as a duplicate of this bug. ***