Index: smbd/posix_acls.c =================================================================== RCS file: /home/cvs/samba/source/smbd/posix_acls.c,v retrieving revision 1.61.2.29 diff -u -r1.61.2.29 posix_acls.c --- smbd/posix_acls.c 3 Nov 2003 14:34:24 -0000 1.61.2.29 +++ smbd/posix_acls.c 25 Nov 2003 18:34:30 -0000 @@ -3177,6 +3177,44 @@ return True; } +int fix_acl_group_bits( connection_struct *conn, char *fname, mode_t *mode ) +{ + int entry_id = SMB_ACL_FIRST_ENTRY; + SMB_ACL_ENTRY_T entry; + SMB_ACL_T posix_acl; + + posix_acl = SMB_VFS_SYS_ACL_GET_FILE(conn, fname, SMB_ACL_TYPE_ACCESS); + while (SMB_VFS_SYS_ACL_GET_ENTRY(conn, posix_acl, + entry_id, &entry) == 1) { + SMB_ACL_TAG_T tagtype; + SMB_ACL_PERMSET_T permset; + + /* get_next... */ + if (entry_id == SMB_ACL_FIRST_ENTRY) + entry_id = SMB_ACL_NEXT_ENTRY; + + if (SMB_VFS_SYS_ACL_GET_TAG_TYPE(conn, entry, &tagtype) ==-1) + return -1; + + if (tagtype == SMB_ACL_GROUP_OBJ) { + if (SMB_VFS_SYS_ACL_GET_PERMSET(conn, entry, + &permset) == -1) + return -1; + else { + *mode &= ~(S_IRGRP|S_IWGRP|S_IXGRP); + *mode |= (SMB_VFS_SYS_ACL_GET_PERM(conn, + permset, SMB_ACL_READ) ? S_IRGRP : 0); + *mode |= (SMB_VFS_SYS_ACL_GET_PERM(conn, + permset, SMB_ACL_WRITE) ? S_IWGRP : 0); + *mode |= (SMB_VFS_SYS_ACL_GET_PERM(conn, + permset, SMB_ACL_EXECUTE) ? S_IXGRP : 0); + return 0;; + } + } + } + return -1; +} + /**************************************************************************** Do a chmod by setting the ACL USER_OBJ, GROUP_OBJ and OTHER bits in an ACL and set the mask to rwx. Needed to preserve complex ACLs set by NT. Index: smbd/dosmode.c =================================================================== RCS file: /home/cvs/samba/source/smbd/dosmode.c,v retrieving revision 1.27.2.5 diff -u -r1.27.2.5 dosmode.c --- smbd/dosmode.c 14 Oct 2003 03:56:42 -0000 1.27.2.5 +++ smbd/dosmode.c 25 Nov 2003 18:34:30 -0000 @@ -197,6 +197,8 @@ return(-1); } + fix_acl_group_bits(conn, fname, &st->st_mode); + if (S_ISDIR(st->st_mode)) dosmode |= aDIR; else