Ignore:
Timestamp:
Nov 12, 2012, 7:37:04 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server 3.5: update branche to 3.5.19

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.5.x/source3/smbd/posix_acls.c

    r733 r739  
    13431343
    13441344static bool ensure_canon_entry_valid(canon_ace **pp_ace,
    1345                                      const struct share_params *params,
    1346                                      const bool is_directory,
    1347                                                         const DOM_SID *pfile_owner_sid,
    1348                                                         const DOM_SID *pfile_grp_sid,
    1349                                                         const SMB_STRUCT_STAT *pst,
    1350                                                         bool setting_acl)
     1345                                bool is_default_acl,
     1346                                const struct share_params *params,
     1347                                const bool is_directory,
     1348                                const DOM_SID *pfile_owner_sid,
     1349                                const DOM_SID *pfile_grp_sid,
     1350                                const SMB_STRUCT_STAT *pst,
     1351                                bool setting_acl)
    13511352{
    13521353        canon_ace *pace;
     
    13591360                if (pace->type == SMB_ACL_USER_OBJ) {
    13601361
    1361                         if (setting_acl)
     1362                        if (setting_acl && !is_default_acl) {
    13621363                                apply_default_perms(params, is_directory, pace, S_IRUSR);
     1364                        }
    13631365                        got_user = True;
    13641366
     
    13691371                         */
    13701372
    1371                         if (setting_acl)
     1373                        if (setting_acl && !is_default_acl) {
    13721374                                apply_default_perms(params, is_directory, pace, S_IRGRP);
     1375                        }
    13731376                        got_grp = True;
    13741377
     
    13791382                         */
    13801383
    1381                         if (setting_acl)
     1384                        if (setting_acl && !is_default_acl) {
    13821385                                apply_default_perms(params, is_directory, pace, S_IROTH);
     1386                        }
    13831387                        got_other = True;
    13841388                        pace_other = pace;
     1389
     1390                } else if (pace->type == SMB_ACL_USER || pace->type == SMB_ACL_GROUP) {
     1391
     1392                        /*
     1393                         * Ensure create mask/force create mode is respected on set.
     1394                         */
     1395
     1396                        if (setting_acl && !is_default_acl) {
     1397                                apply_default_perms(params, is_directory, pace, S_IRGRP);
     1398                        }
    13851399                }
    13861400        }
     
    14261440                        }
    14271441
    1428                         apply_default_perms(params, is_directory, pace, S_IRUSR);
     1442                        if (!is_default_acl) {
     1443                                apply_default_perms(params, is_directory, pace, S_IRUSR);
     1444                        }
    14291445                } else {
    14301446                        pace->perms = unix_perms_to_acl_perms(pst->st_ex_mode, S_IRUSR, S_IWUSR, S_IXUSR);
     
    14521468                        else
    14531469                                pace->perms = 0;
    1454                         apply_default_perms(params, is_directory, pace, S_IRGRP);
     1470                        if (!is_default_acl) {
     1471                                apply_default_perms(params, is_directory, pace, S_IRGRP);
     1472                        }
    14551473                } else {
    14561474                        pace->perms = unix_perms_to_acl_perms(pst->st_ex_mode, S_IRGRP, S_IWGRP, S_IXGRP);
     
    14741492                if (setting_acl) {
    14751493                        pace->perms = 0;
    1476                         apply_default_perms(params, is_directory, pace, S_IROTH);
     1494                        if (!is_default_acl) {
     1495                                apply_default_perms(params, is_directory, pace, S_IROTH);
     1496                        }
    14771497                } else
    14781498                        pace->perms = unix_perms_to_acl_perms(pst->st_ex_mode, S_IROTH, S_IWOTH, S_IXOTH);
     
    23192339        print_canon_ace_list( "file ace - before valid", file_ace);
    23202340
    2321         if (!ensure_canon_entry_valid(&file_ace, fsp->conn->params,
     2341        if (!ensure_canon_entry_valid(&file_ace, false, fsp->conn->params,
    23222342                        fsp->is_directory, pfile_owner_sid, pfile_grp_sid, pst, True)) {
    23232343                free_canon_ace_list(file_ace);
     
    23282348        print_canon_ace_list( "dir ace - before valid", dir_ace);
    23292349
    2330         if (dir_ace && !ensure_canon_entry_valid(&dir_ace, fsp->conn->params,
     2350        if (dir_ace && !ensure_canon_entry_valid(&dir_ace, true, fsp->conn->params,
    23312351                        fsp->is_directory, pfile_owner_sid, pfile_grp_sid, pst, True)) {
    23322352                free_canon_ace_list(file_ace);
     
    24172437        canon_ace *next_ace = NULL;
    24182438        int entry_id = SMB_ACL_FIRST_ENTRY;
     2439        bool is_default_acl = (the_acl_type == SMB_ACL_TYPE_DEFAULT);
    24192440        SMB_ACL_ENTRY_T entry;
    24202441        size_t ace_count;
     
    25042525                ace->unix_ug = unix_ug;
    25052526                ace->owner_type = owner_type;
    2506                 ace->ace_flags = get_pai_flags(pal, ace, (the_acl_type == SMB_ACL_TYPE_DEFAULT));
     2527                ace->ace_flags = get_pai_flags(pal, ace, is_default_acl);
    25072528
    25082529                DLIST_ADD(l_head, ace);
     
    25132534         */
    25142535
    2515         if (!ensure_canon_entry_valid(&l_head, conn->params,
     2536        if (!ensure_canon_entry_valid(&l_head, is_default_acl, conn->params,
    25162537                                      S_ISDIR(psbuf->st_ex_mode), powner, pgroup,
    25172538                                      psbuf, False))
     
    25232544         */
    25242545
    2525         DEBUG(10,("canonicalise_acl: %s ace entries before arrange :\n", the_acl_type == SMB_ACL_TYPE_ACCESS ? "Access" : "Default" ));
     2546        DEBUG(10,("canonicalise_acl: %s ace entries before arrange :\n", is_default_acl ?  "Default" : "Access"));
    25262547
    25272548        for ( ace_count = 0, ace = l_head; ace; ace = next_ace, ace_count++) {
Note: See TracChangeset for help on using the changeset viewer.