View | Details | Raw Unified | Return to bug 38217 | Differences between
and this patch

Collapse All | Expand All

(-)/usr/share/pyshared/samba/ntacls.py.orig (-5 / +11 lines)
 Lines 117-126    Link Here 
117
                    sd2 = sd
117
                    sd2 = sd
118
                    sd2.owner_sid = administrator
118
                    sd2.owner_sid = administrator
119
119
120
                    smbd.set_nt_acl(file, security.SECINFO_OWNER |security.SECINFO_GROUP | security.SECINFO_DACL | security.SECINFO_SACL, sd2, service=service)
120
                    try:
121
121
                        smbd.set_nt_acl(file, security.SECINFO_OWNER |security.SECINFO_GROUP | security.SECINFO_DACL | security.SECINFO_SACL, sd2, service=service)
122
                    # and then set an NTVFS ACL (which does not set the posix ACL) to pretend the owner really was set
122
                    except Exception as exc:
123
                    use_ntvfs = True
123
                        print "set_nt_acl failed for %s: %s" % (file, exc)
124
                    else:
125
                        # and then set an NTVFS ACL (which does not set the posix ACL) to pretend the owner really was set
126
                        use_ntvfs = True
124
                else:
127
                else:
125
                    raise XattrBackendError("Unable to find UID for domain administrator %s, got id %d of type %d" % (administrator, admin_id, admin_type))
128
                    raise XattrBackendError("Unable to find UID for domain administrator %s, got id %d of type %d" % (administrator, admin_id, admin_type))
126
            else:
129
            else:
 Lines 151-157    Link Here 
151
            samba.xattr_native.wrap_setxattr(file, xattr.XATTR_NTACL_NAME,
154
            samba.xattr_native.wrap_setxattr(file, xattr.XATTR_NTACL_NAME,
152
                                             ndr_pack(ntacl))
155
                                             ndr_pack(ntacl))
153
    else:
156
    else:
154
        smbd.set_nt_acl(file, security.SECINFO_OWNER | security.SECINFO_GROUP | security.SECINFO_DACL | security.SECINFO_SACL, sd, service=service)
157
        try:
158
            smbd.set_nt_acl(file, security.SECINFO_OWNER | security.SECINFO_GROUP | security.SECINFO_DACL | security.SECINFO_SACL, sd, service=service)
159
        except Exception as exc:
160
            print "set_nt_acl failed for %s: %s" % (file, exc)
155
161
156
162
157
def ldapmask2filemask(ldm):
163
def ldapmask2filemask(ldm):

Return to bug 38217