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

Location:
branches/samba-3.5.x/source3/smbd
Files:
2 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++) {
  • branches/samba-3.5.x/source3/smbd/server.c

    r736 r739  
    561561        int i;
    562562        char *ports;
     563        char *tok;
     564        const char *ptr;
    563565        unsigned dns_port = 0;
    564566
     
    582584        }
    583585
     586        for (ptr = ports;
     587             next_token_talloc(talloc_tos(),&ptr, &tok, " \t,");) {
     588                unsigned port = atoi(tok);
     589
     590                if (port == 0 || port > 0xffff) {
     591                        exit_server_cleanly("Invalid port in the config or on "
     592                                            "the commandline specified!");
     593                }
     594        }
     595
    584596        if (lp_interfaces() && lp_bind_interfaces_only()) {
    585597                /* We have been given an interfaces line, and been
     
    593605                        const struct sockaddr_storage *ifss =
    594606                                        iface_n_sockaddr_storage(i);
    595                         char *tok;
    596                         const char *ptr;
    597607
    598608                        if (ifss == NULL) {
     
    606616                             next_token_talloc(talloc_tos(),&ptr, &tok, " \t,");) {
    607617                                unsigned port = atoi(tok);
    608                                 if (port == 0 || port > 0xffff) {
    609                                         continue;
    610                                 }
    611618
    612619                                /* Keep the first port for mDNS service
     
    626633                   from anywhere. */
    627634
    628                 char *tok;
    629                 const char *ptr;
    630635                const char *sock_addr = lp_socket_address();
    631636                char *sock_tok;
     
    645650                        for (ptr=ports; next_token_talloc(talloc_tos(), &ptr, &tok, " \t,"); ) {
    646651                                struct sockaddr_storage ss;
    647 
    648652                                unsigned port = atoi(tok);
    649                                 if (port == 0 || port > 0xffff) {
    650                                         continue;
    651                                 }
    652653
    653654                                /* Keep the first port for mDNS service
Note: See TracChangeset for help on using the changeset viewer.