Ignore:
Timestamp:
Nov 27, 2012, 4:43:17 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.0

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/source3/modules/vfs_afsacl.c

    r414 r745  
    1919
    2020#include "includes.h"
     21#include "system/filesys.h"
     22#include "smbd/smbd.h"
     23#include "../librpc/gen_ndr/lsa.h"
     24#include "../libcli/security/security.h"
     25#include "../libcli/security/dom_sid.h"
     26#include "passdb.h"
    2127
    2228#undef DBGC_CLASS
     
    3137#define MAXSIZE 2048
    3238
    33 extern const DOM_SID global_sid_World;
    34 extern const DOM_SID global_sid_Builtin_Administrators;
    35 extern const DOM_SID global_sid_Builtin_Backup_Operators;
    36 extern const DOM_SID global_sid_Authenticated_Users;
    37 extern const DOM_SID global_sid_NULL;
     39extern const struct dom_sid global_sid_World;
     40extern const struct dom_sid global_sid_Builtin_Administrators;
     41extern const struct dom_sid global_sid_Builtin_Backup_Operators;
     42extern const struct dom_sid global_sid_Authenticated_Users;
     43extern const struct dom_sid global_sid_NULL;
    3844
    3945static char space_replacement = '%';
     
    4753        bool positive;
    4854        char *name;
    49         DOM_SID sid;
     55        struct dom_sid sid;
    5056        enum lsa_SidType type;
    5157        uint32 rights;
     
    109115                                   const char *name, uint32 rights)
    110116{
    111         DOM_SID sid;
     117        struct dom_sid sid;
    112118        enum lsa_SidType type;
    113119        struct afs_ace *result;
     
    418424{
    419425        return ( (x->positive == y->positive) &&
    420                  (sid_compare(&x->sid, &y->sid) == 0) );
     426                 (dom_sid_compare(&x->sid, &y->sid) == 0) );
    421427}
    422428
     
    515521        /* FULL inherit only -- counterpart to previous one */
    516522        { 0, SEC_ACE_FLAG_OBJECT_INHERIT|SEC_ACE_FLAG_CONTAINER_INHERIT|SEC_ACE_FLAG_INHERIT_ONLY,
    517           PERMS_FULL | GENERIC_RIGHT_WRITE_ACCESS, 127 /* rlidwka */ },
     523          PERMS_FULL | SEC_GENERIC_WRITE, 127 /* rlidwka */ },
    518524
    519525        /* CHANGE without inheritance -- in all cases here we also get
     
    523529        /* CHANGE inherit only -- counterpart to previous one */
    524530        { 0, SEC_ACE_FLAG_OBJECT_INHERIT|SEC_ACE_FLAG_CONTAINER_INHERIT|SEC_ACE_FLAG_INHERIT_ONLY,
    525           PERMS_CHANGE | GENERIC_RIGHT_WRITE_ACCESS, 63 /* rlidwk */ },
     531          PERMS_CHANGE | SEC_GENERIC_WRITE, 63 /* rlidwk */ },
    526532
    527533        /* End marker, hopefully there's no afs right 9999 :-) */
     
    529535};
    530536
    531 static uint32 nt_to_afs_dir_rights(const char *filename, const SEC_ACE *ace)
     537static uint32 nt_to_afs_dir_rights(const char *filename, const struct security_ace *ace)
    532538{
    533539        uint32 result = 0;
     
    570576}
    571577
    572 static uint32 nt_to_afs_file_rights(const char *filename, const SEC_ACE *ace)
     578static uint32 nt_to_afs_file_rights(const char *filename, const struct security_ace *ace)
    573579{
    574580        uint32 result = 0;
     
    591597                                   struct security_descriptor **ppdesc)
    592598{
    593         SEC_ACE *nt_ace_list;
    594         DOM_SID owner_sid, group_sid;
    595         SEC_ACL *psa = NULL;
     599        struct security_ace *nt_ace_list;
     600        struct dom_sid owner_sid, group_sid;
     601        struct security_acl *psa = NULL;
    596602        int good_aces;
    597603        size_t sd_size;
     
    604610
    605611        if (afs_acl->num_aces) {
    606                 nt_ace_list = TALLOC_ARRAY(mem_ctx, SEC_ACE, afs_acl->num_aces);
     612                nt_ace_list = TALLOC_ARRAY(mem_ctx, struct security_ace, afs_acl->num_aces);
    607613
    608614                if (nt_ace_list == NULL)
     
    643649                return 0;
    644650
    645         *ppdesc = make_sec_desc(mem_ctx, SEC_DESC_REVISION,
     651        *ppdesc = make_sec_desc(mem_ctx, SD_REVISION,
    646652                                SEC_DESC_SELF_RELATIVE,
    647                                 (security_info & OWNER_SECURITY_INFORMATION)
     653                                (security_info & SECINFO_OWNER)
    648654                                ? &owner_sid : NULL,
    649                                 (security_info & GROUP_SECURITY_INFORMATION)
     655                                (security_info & SECINFO_GROUP)
    650656                                ? &group_sid : NULL,
    651657                                NULL, psa, &sd_size);
     
    683689        SMB_STRUCT_STAT sbuf;
    684690
    685         if (fsp->is_directory || fsp->fh->fd == -1) {
     691        if (fsp->fh->fd == -1) {
    686692                /* Get the stat struct for the owner info. */
    687693                return afs_to_nt_acl(afs_acl, fsp->conn, fsp->fsp_name,
     
    696702}
    697703
    698 static bool mappable_sid(const DOM_SID *sid)
    699 {
    700         DOM_SID domain_sid;
     704static bool mappable_sid(const struct dom_sid *sid)
     705{
     706        struct dom_sid domain_sid;
    701707       
    702         if (sid_compare(sid, &global_sid_Builtin_Administrators) == 0)
     708        if (dom_sid_compare(sid, &global_sid_Builtin_Administrators) == 0)
    703709                return True;
    704710
    705         if (sid_compare(sid, &global_sid_World) == 0)
     711        if (dom_sid_compare(sid, &global_sid_World) == 0)
    706712                return True;
    707713
    708         if (sid_compare(sid, &global_sid_Authenticated_Users) == 0)
     714        if (dom_sid_compare(sid, &global_sid_Authenticated_Users) == 0)
    709715                return True;
    710716
    711         if (sid_compare(sid, &global_sid_Builtin_Backup_Operators) == 0)
     717        if (dom_sid_compare(sid, &global_sid_Builtin_Backup_Operators) == 0)
    712718                return True;
    713719
     
    724730                          const struct security_descriptor *psd,
    725731                          uint32 (*nt_to_afs_rights)(const char *filename,
    726                                                      const SEC_ACE *ace),
     732                                                     const struct security_ace *ace),
    727733                          struct afs_acl *afs_acl)
    728734{
    729         const SEC_ACL *dacl;
     735        const struct security_acl *dacl;
    730736        int i;
    731737
    732738        /* Currently we *only* look at the dacl */
    733739
    734         if (((security_info_sent & DACL_SECURITY_INFORMATION) == 0) ||
     740        if (((security_info_sent & SECINFO_DACL) == 0) ||
    735741            (psd->dacl == NULL))
    736742                return True;
     
    742748
    743749        for (i = 0; i < dacl->num_aces; i++) {
    744                 const SEC_ACE *ace = &(dacl->aces[i]);
     750                const struct security_ace *ace = &(dacl->aces[i]);
    745751                const char *dom_name, *name;
    746752                enum lsa_SidType name_type;
     
    758764                }
    759765
    760                 if (sid_compare(&ace->trustee,
     766                if (dom_sid_compare(&ace->trustee,
    761767                                &global_sid_Builtin_Administrators) == 0) {
    762768
    763769                        name = "system:administrators";
    764770
    765                 } else if (sid_compare(&ace->trustee,
     771                } else if (dom_sid_compare(&ace->trustee,
    766772                                       &global_sid_World) == 0) {
    767773
    768774                        name = "system:anyuser";
    769775
    770                 } else if (sid_compare(&ace->trustee,
     776                } else if (dom_sid_compare(&ace->trustee,
    771777                                       &global_sid_Authenticated_Users) == 0) {
    772778
    773779                        name = "system:authuser";
    774780
    775                 } else if (sid_compare(&ace->trustee,
     781                } else if (dom_sid_compare(&ace->trustee,
    776782                                       &global_sid_Builtin_Backup_Operators)
    777783                           == 0) {
     
    10571063                         files_struct *fsp,
    10581064                         uint32 security_info_sent,
    1059                          const SEC_DESC *psd)
     1065                         const struct security_descriptor *psd)
    10601066{
    10611067        return afs_set_nt_acl(handle, fsp, security_info_sent, psd);
Note: See TracChangeset for help on using the changeset viewer.