Ignore:
Timestamp:
Sep 24, 2009, 9:15:13 AM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Update 3.2 to 3.2.14 (final)

Location:
branches/samba-3.2.x/source
Files:
27 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.2.x/source/VERSION

    r282 r335  
    2626SAMBA_VERSION_MAJOR=3
    2727SAMBA_VERSION_MINOR=2
    28 SAMBA_VERSION_RELEASE=13
     28SAMBA_VERSION_RELEASE=14
    2929
    3030########################################################
  • branches/samba-3.2.x/source/include/version.h

    r282 r335  
    22#define SAMBA_VERSION_MAJOR 3
    33#define SAMBA_VERSION_MINOR 2
    4 #define SAMBA_VERSION_RELEASE 13
    5 #define SAMBA_VERSION_OFFICIAL_STRING "3.2.13"
     4#define SAMBA_VERSION_RELEASE 14
     5#define SAMBA_VERSION_OFFICIAL_STRING "3.2.14"
    66#define SAMBA_VERSION_STRING samba_version_string()
  • branches/samba-3.2.x/source/lib/netapi/joindomain.c

    r136 r335  
    210210        u->in.domain_name = domain;
    211211        u->in.unjoin_flags = r->in.unjoin_flags;
     212        u->in.delete_machine_account = false;
    212213        u->in.modify_config = true;
    213214        u->in.debug = true;
  • branches/samba-3.2.x/source/lib/smbldap.c

    r228 r335  
    13491349        }
    13501350
    1351         DEBUG(3,("smbldap_search_paged: search was successfull\n"));
     1351        DEBUG(3,("smbldap_search_paged: search was successful\n"));
    13521352
    13531353        rc = ldap_parse_result(ldap_state->ldap_struct, *res, NULL, NULL,
  • branches/samba-3.2.x/source/lib/util.c

    r247 r335  
    27032703                }
    27042704                if (name) {
    2705                         *name = "";
     2705                        *name = dir;
    27062706                }
    27072707                return True;
  • branches/samba-3.2.x/source/libnet/libnet_join.c

    r232 r335  
    18361836        }
    18371837
     1838        if (!(r->in.unjoin_flags & WKSSVC_JOIN_FLAGS_ACCOUNT_DELETE) &&
     1839            !r->in.delete_machine_account) {
     1840                libnet_join_unjoindomain_remove_secrets(mem_ctx, r);
     1841                return WERR_OK;
     1842        }
     1843
    18381844        if (!r->in.dc_name) {
    18391845                struct netr_DsRGetDCNameInfo *info;
     
    18611867        }
    18621868
    1863         status = libnet_join_unjoindomain_rpc(mem_ctx, r);
    1864         if (!NT_STATUS_IS_OK(status)) {
    1865                 libnet_unjoin_set_error_string(mem_ctx, r,
    1866                         "failed to disable machine account via rpc: %s",
    1867                         get_friendly_nt_error_msg(status));
    1868                 if (NT_STATUS_EQUAL(status, NT_STATUS_NO_SUCH_USER)) {
    1869                         return WERR_SETUP_NOT_JOINED;
    1870                 }
    1871                 return ntstatus_to_werror(status);
    1872         }
    1873 
    1874         r->out.disabled_machine_account = true;
    1875 
    18761869#ifdef WITH_ADS
    1877         if (r->in.unjoin_flags & WKSSVC_JOIN_FLAGS_ACCOUNT_DELETE) {
     1870        /* for net ads leave, try to delete the account.  If it works,
     1871           no sense in disabling.  If it fails, we can still try to
     1872           disable it. jmcd */
     1873
     1874        if (r->in.delete_machine_account) {
    18781875                ADS_STATUS ads_status;
    1879                 libnet_unjoin_connect_ads(mem_ctx, r);
    1880                 ads_status = libnet_unjoin_remove_machine_acct(mem_ctx, r);
     1876                ads_status = libnet_unjoin_connect_ads(mem_ctx, r);
     1877                if (ADS_ERR_OK(ads_status)) {
     1878                        /* dirty hack */
     1879                        r->out.dns_domain_name =
     1880                                talloc_strdup(mem_ctx,
     1881                                              r->in.ads->server.realm);
     1882                        ads_status =
     1883                                libnet_unjoin_remove_machine_acct(mem_ctx, r);
     1884                }
    18811885                if (!ADS_ERR_OK(ads_status)) {
    18821886                        libnet_unjoin_set_error_string(mem_ctx, r,
     
    18851889                } else {
    18861890                        r->out.deleted_machine_account = true;
    1887                         /* dirty hack */
    1888                         r->out.dns_domain_name = talloc_strdup(mem_ctx,
    1889                                                                r->in.ads->server.realm);
    18901891                        W_ERROR_HAVE_NO_MEMORY(r->out.dns_domain_name);
     1892                        libnet_join_unjoindomain_remove_secrets(mem_ctx, r);
     1893                        return WERR_OK;
    18911894                }
    18921895        }
    18931896#endif /* WITH_ADS */
     1897
     1898        /* The WKSSVC_JOIN_FLAGS_ACCOUNT_DELETE flag really means
     1899           "disable".  */
     1900        if (r->in.unjoin_flags & WKSSVC_JOIN_FLAGS_ACCOUNT_DELETE) {
     1901                status = libnet_join_unjoindomain_rpc(mem_ctx, r);
     1902                if (!NT_STATUS_IS_OK(status)) {
     1903                        libnet_unjoin_set_error_string(mem_ctx, r,
     1904                                "failed to disable machine account via rpc: %s",
     1905                                get_friendly_nt_error_msg(status));
     1906                        if (NT_STATUS_EQUAL(status, NT_STATUS_NO_SUCH_USER)) {
     1907                                return WERR_SETUP_NOT_JOINED;
     1908                        }
     1909                        return ntstatus_to_werror(status);
     1910                }
     1911
     1912                r->out.disabled_machine_account = true;
     1913        }
     1914
     1915        /* If disable succeeded or was not requested at all, we
     1916           should be getting rid of our end of things */
    18941917
    18951918        libnet_join_unjoindomain_remove_secrets(mem_ctx, r);
  • branches/samba-3.2.x/source/librpc/gen_ndr/libnet_join.h

    r136 r335  
    5757                const char * machine_password;
    5858                uint32_t unjoin_flags;
     59                uint8_t delete_machine_account;
    5960                uint8_t modify_config;
    6061                struct dom_sid *domain_sid;/* [ref] */
  • branches/samba-3.2.x/source/librpc/gen_ndr/ndr_libnet_join.c

    r133 r335  
    8888#endif
    8989                ndr_print_wkssvc_joinflags(ndr, "unjoin_flags", r->in.unjoin_flags);
     90                ndr_print_uint8(ndr, "delete_machine_account", r->in.delete_machine_account);
    9091                ndr_print_uint8(ndr, "modify_config", r->in.modify_config);
    9192                ndr_print_ptr(ndr, "domain_sid", r->in.domain_sid);
  • branches/samba-3.2.x/source/librpc/idl/libnet_join.idl

    r136 r335  
    5252                [in] string machine_password,
    5353                [in] wkssvc_joinflags unjoin_flags,
     54                [in] boolean8 delete_machine_account,
    5455                [in] boolean8 modify_config,
    5556                [in] dom_sid *domain_sid,
  • branches/samba-3.2.x/source/libsmb/passchange.c

    r133 r335  
    170170                        asprintf(err_str, "SAMR connection to machine %s "
    171171                                 "failed. Error was %s, but LANMAN password "
    172                                  "changed are disabled\n",
     172                                 "changes are disabled\n",
    173173                                 nt_errstr(result), remote_machine);
    174174                        result = cli_nt_error(cli);
  • branches/samba-3.2.x/source/nsswitch/pam_winbind.c

    r232 r335  
    19111911        int account_name_len;
    19121912        char sep;
     1913        char *p;
     1914        char *name;
     1915        char *domain;
    19131916
    19141917        /* This cannot work when the winbind separator = @ */
     
    19191922        }
    19201923
     1924        name = strdup(upn);
     1925        if (!name) {
     1926                return NULL;
     1927        }
     1928        if ((p = strchr(name, '@')) != NULL) {
     1929                *p = 0;
     1930                domain = p + 1;
     1931        }
     1932
    19211933        /* Convert the UPN to a SID */
    19221934
     
    19241936        ZERO_STRUCT(resp);
    19251937
    1926         strncpy(req.data.name.dom_name, "",
     1938        strncpy(req.data.name.dom_name, domain,
    19271939                sizeof(req.data.name.dom_name) - 1);
    1928         strncpy(req.data.name.name, upn,
     1940        strncpy(req.data.name.name, name,
    19291941                sizeof(req.data.name.name) - 1);
    19301942        retval = pam_winbind_request_log(ctx, WINBINDD_LOOKUPNAME,
     
    19481960                                    resp.data.name.dom_name,
    19491961                                    resp.data.name.name);
     1962        SAFE_FREE(name);
    19501963
    19511964        return account_name;
  • branches/samba-3.2.x/source/passdb/lookup_sid.c

    r272 r335  
    10861086        DATA_BLOB cache_value;
    10871087
    1088         if (!memcache_lookup(NULL, SID_UID_CACHE,
     1088        if (!memcache_lookup(NULL, SID_GID_CACHE,
    10891089                             data_blob_const(psid, ndr_size_dom_sid(psid, 0)),
    10901090                             &cache_value)) {
  • branches/samba-3.2.x/source/passdb/passdb.c

    r137 r335  
    676676                        }
    677677
    678                         result = samu_set_unix( sam_pass, pwd );
     678                        result = samu_alloc_rid_unix( sam_pass, pwd );
    679679
    680680                        DEBUGLEVEL = tmp_debug;
  • branches/samba-3.2.x/source/rpc_server/srv_lsa_nt.c

    r272 r335  
    10931093        status = _lsa_LookupNames(p, &q);
    10941094
     1095        sid_array2->count = sid_array->count;
    10951096        sid_array2->sids = TALLOC_ARRAY(p->mem_ctx, struct lsa_TranslatedSid2, sid_array->count);
    10961097        if (!sid_array2->sids) {
  • branches/samba-3.2.x/source/rpc_server/srv_samr_nt.c

    r272 r335  
    261261        *pacc_requested &= ~MAXIMUM_ALLOWED_ACCESS;
    262262
    263         /* At least try for generic read. */
    264         *pacc_requested = GENERIC_READ_ACCESS;
     263        /* At least try for generic read|execute - Everyone gets that. */
     264        *pacc_requested = GENERIC_READ_ACCESS|GENERIC_EXECUTE_ACCESS;
    265265
    266266        /* root gets anything. */
  • branches/samba-3.2.x/source/script/tests/test_posix_s3.sh

    r138 r335  
    3939rpc="$rpc RPC-SAMBA3-SPOOLSS RPC-SAMBA3-WKSSVC"
    4040rpc="$rpc RPC-NETLOGSAMBA3 RPC-SAMBA3SESSIONKEY RPC-SAMBA3-GETUSERNAME"
     41rpc="$rpc RPC-LSA-LOOKUPSIDS RPC-JOIN RPC-SAMR-MACHINE-AUTH"
     42
    4143
    4244# NOTE: to enable the UNIX-WHOAMI test, we need to change the default share
  • branches/samba-3.2.x/source/smbd/lanman.c

    r136 r335  
    12181218                }
    12191219                fstrcpy(s->comment, p);
     1220                string_truncate(s->comment, MAX_SERVER_STRING_LENGTH);
    12201221
    12211222                s->domain[0] = '\0';
  • branches/samba-3.2.x/source/smbd/open.c

    r235 r335  
    251251        if (!CAN_WRITE(conn)) {
    252252                /* It's a read-only share - fail if we wanted to write. */
    253                 if(accmode != O_RDONLY) {
     253                if(accmode != O_RDONLY || (flags & O_TRUNC) || (flags & O_APPEND)) {
    254254                        DEBUG(3,("Permission denied opening %s\n", path));
    255255                        return NT_STATUS_ACCESS_DENIED;
     
    259259                           access into the directory.
    260260                        */
    261                         flags &= ~O_CREAT;
    262                         local_flags &= ~O_CREAT;
     261                        flags &= ~(O_CREAT|O_EXCL);
     262                        local_flags &= ~(O_CREAT|O_EXCL);
    263263                }
    264264        }
  • branches/samba-3.2.x/source/smbd/server.c

    r233 r335  
    349349        unsigned dns_port = 0;
    350350
    351         if (!is_daemon) {
    352                 return open_sockets_inetd();
    353         }
    354 
    355351#ifdef HAVE_ATEXIT
    356352        {
     
    362358        }
    363359#endif
     360
     361        if (!is_daemon) {
     362                /*
     363                 * Stop zombies the old way.
     364                 * We aren't forking any new
     365                 * 'normal' connections when
     366                 * run from [x]inetd.
     367                 */
     368                CatchChild();
     369                return open_sockets_inetd();
     370        }
    364371
    365372        /* Stop zombies */
     
    12071214        BlockSignals(False, SIGTERM);
    12081215
     1216        /* Ensure we leave no zombies until we
     1217         * correctly set up child handling below. */
     1218        CatchChild();
     1219
    12091220        /* we want total control over the permissions on created files,
    12101221           so set our umask to 0 */
  • branches/samba-3.2.x/source/smbd/trans2.c

    r272 r335  
    49204920        if (setting_write_time) {
    49214921                /*
    4922                  * This was a setfileinfo on an open file.
     4922                 * This was a Windows setfileinfo on an open file.
    49234923                 * NT does this a lot. We also need to
    49244924                 * set the time here, as it can be read by
     
    59975997        bool delete_on_fail = False;
    59985998        enum perm_type ptype;
     5999        files_struct *all_fsps = NULL;
     6000        bool modify_mtime = true;
     6001        struct file_id id;
    59996002
    60006003        if (total_data < 100) {
     
    61436146
    61446147        /* Deal with any time changes. */
    6145 
    6146         return smb_set_file_time(conn,
     6148        id = vfs_file_id_from_sbuf(conn, psbuf);
     6149        for(all_fsps = file_find_di_first(id); all_fsps;
     6150                        all_fsps = file_find_di_next(all_fsps)) {
     6151                /*
     6152                 * We're setting the time explicitly for UNIX.
     6153                 * Cancel any pending changes over all handles.
     6154                 */
     6155                all_fsps->update_write_time_on_close = false;
     6156                TALLOC_FREE(all_fsps->update_write_time_event);
     6157        }
     6158
     6159        /*
     6160         * Override the "setting_write_time"
     6161         * parameter here as it almost does what
     6162         * we need. Just remember if we modified
     6163         * mtime and send the notify ourselves.
     6164         */
     6165        if (null_timespec(ts[1])) {
     6166                modify_mtime = false;
     6167        }
     6168
     6169        status = smb_set_file_time(conn,
    61476170                                fsp,
    61486171                                fname,
    61496172                                psbuf,
    61506173                                ts,
    6151                                 true);
     6174                                false);
     6175
     6176        if (modify_mtime) {
     6177                notify_fname(conn, NOTIFY_ACTION_MODIFIED,
     6178                        FILE_NOTIFY_CHANGE_LAST_WRITE, fname);
     6179        }
     6180        return status;
    61526181}
    61536182
     
    67766805        }
    67776806
    6778         if (!CAN_WRITE(conn)) {
    6779                 reply_doserror(req, ERRSRV, ERRaccess);
    6780                 return;
    6781         }
    6782 
    67836807        if (INFO_LEVEL_IS_UNIX(info_level) && !lp_unix_extensions()) {
    67846808                reply_nterror(req, NT_STATUS_INVALID_LEVEL);
    67856809                return;
     6810        }
     6811
     6812        if (!CAN_WRITE(conn)) {
     6813                /* Allow POSIX opens. The open path will deny
     6814                 * any non-readonly opens. */
     6815                if (info_level != SMB_POSIX_PATH_OPEN) {
     6816                        reply_doserror(req, ERRSRV, ERRaccess);
     6817                        return;
     6818                }
    67866819        }
    67876820
     
    70907123
    70917124        DEBUG(3,("call_trans2mkdir : name = %s\n", directory));
     7125
     7126        status = resolve_dfspath(ctx,
     7127                                conn,
     7128                                req->flags2 & FLAGS2_DFS_PATHNAMES,
     7129                                directory,
     7130                                &directory);
     7131        if (!NT_STATUS_IS_OK(status)) {
     7132                if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) {
     7133                        reply_botherror(req,
     7134                                        NT_STATUS_PATH_NOT_COVERED,
     7135                                        ERRSRV, ERRbadpath);
     7136                }
     7137                reply_nterror(req, status);
     7138                return;
     7139        }
    70927140
    70937141        status = unix_convert(ctx, conn, directory, False, &directory, NULL, &sbuf);
  • branches/samba-3.2.x/source/utils/net_ads.c

    r232 r335  
    836836        r->in.admin_password    = net_prompt_pass(opt_user_name);
    837837        r->in.modify_config     = lp_config_backend_is_registry();
     838
     839        /* Try to delete it, but if that fails, disable it.  The
     840           WKSSVC_JOIN_FLAGS_ACCOUNT_DELETE really means "disable */
    838841        r->in.unjoin_flags      = WKSSVC_JOIN_FLAGS_JOIN_TYPE |
    839842                                  WKSSVC_JOIN_FLAGS_ACCOUNT_DELETE;
     843        r->in.delete_machine_account = true;
    840844
    841845        werr = libnet_Unjoin(ctx, r);
     
    847851        }
    848852
    849         if (W_ERROR_IS_OK(werr)) {
     853        if (r->out.deleted_machine_account) {
    850854                d_printf("Deleted account for '%s' in realm '%s'\n",
    851855                        r->in.machine_name, r->out.dns_domain_name);
     
    861865        }
    862866
    863         d_fprintf(stderr, "Failed to disable machine account for '%s' in realm '%s'\n",
     867        /* Based on what we requseted, we shouldn't get here, but if
     868           we did, it means the secrets were removed, and therefore
     869           we have left the domain */
     870        d_fprintf(stderr, "Machine '%s' Left domain '%s'\n",
    864871                  r->in.machine_name, r->out.dns_domain_name);
    865872
  • branches/samba-3.2.x/source/utils/net_rpc.c

    r272 r335  
    59395939        union lsa_TrustedDomainInfo *info = NULL;
    59405940        char *cleartextpwd = NULL;
    5941         DATA_BLOB data;
     5941        DATA_BLOB data = data_blob_null;
    59425942
    59435943        nt_status = rpccli_lsa_QueryTrustedDomainInfoBySid(pipe_hnd, mem_ctx,
  • branches/samba-3.2.x/source/winbindd/idmap_ldap.c

    r233 r335  
    894894        struct idmap_ldap_context *ctx;
    895895        LDAPMessage *result = NULL;
     896        LDAPMessage *entry = NULL;
    896897        const char *uidNumber;
    897898        const char *gidNumber;
     
    989990
    990991        for (i = 0; i < count; i++) {
    991                 LDAPMessage *entry = NULL;
    992992                char *sidstr = NULL;
    993993                char *tmp = NULL;
  • branches/samba-3.2.x/source/winbindd/winbindd_ads.c

    r228 r335  
    11201120        /* handle sids not resolved from cache by lsa_lookup_sids */
    11211121        if (num_nocache > 0) {
     1122                unsigned int orig_timeout;
    11221123
    11231124                status = cm_connect_lsa(domain, tmp_ctx, &cli, &lsa_policy);
     
    11261127                        goto done;
    11271128                }
     1129
     1130                /*
     1131                 * This call can take a long time
     1132                 * allow the server to time out.
     1133                 * 35 seconds should do it.
     1134                 */
     1135                orig_timeout = cli_set_timeout(cli->cli, 35000);
    11281136
    11291137                status = rpccli_lsa_lookup_sids(cli, tmp_ctx,
     
    11351143                                                &name_types_nocache);
    11361144
     1145                /* And restore our original timeout. */
     1146                cli_set_timeout(cli->cli, orig_timeout);
     1147
    11371148                if (!(NT_STATUS_IS_OK(status) ||
    11381149                      NT_STATUS_EQUAL(status, STATUS_SOME_UNMAPPED) ||
     
    11481159                                goto done;
    11491160                        }
     1161
     1162                        /*
     1163                         * This call can take a long time
     1164                         * allow the server to time out.
     1165                         * 35 seconds should do it.
     1166                         */
     1167                        orig_timeout = cli_set_timeout(cli->cli, 35000);
    11501168
    11511169                        status = rpccli_lsa_lookup_sids(cli, tmp_ctx,
     
    11561174                                                        &names_nocache,
    11571175                                                        &name_types_nocache);
     1176
     1177                        /* And restore our original timeout. */
     1178                        cli_set_timeout(cli->cli, orig_timeout);
    11581179                }
    11591180
  • branches/samba-3.2.x/source/winbindd/winbindd_rpc.c

    r233 r335  
    280280        struct rpc_pipe_client *cli;
    281281        POLICY_HND lsa_policy;
     282        unsigned int orig_timeout;
    282283
    283284        if (name == NULL || *name=='\0') {
     
    303304                return result;
    304305
     306        /*
     307         * This call can take a long time
     308         * allow the server to time out.
     309         * 35 seconds should do it.
     310         */
     311        orig_timeout = cli_set_timeout(cli->cli, 35000);
     312
    305313        result = rpccli_lsa_lookup_names(cli, mem_ctx, &lsa_policy, 1,
    306314                                         (const char**) &full_name, NULL, 1, &sids, &types);
    307        
     315
     316        /* And restore our original timeout. */
     317        cli_set_timeout(cli->cli, orig_timeout);
     318
    308319        if (!NT_STATUS_IS_OK(result))
    309320                return result;
     
    333344        struct rpc_pipe_client *cli;
    334345        POLICY_HND lsa_policy;
     346        unsigned int orig_timeout;
    335347
    336348        DEBUG(3,("sid_to_name [rpc] %s for domain %s\n", sid_string_dbg(sid),
     
    345357       
    346358
     359        /*
     360         * This call can take a long time
     361         * allow the server to time out.
     362         * 35 seconds should do it.
     363         */
     364        orig_timeout = cli_set_timeout(cli->cli, 35000);
     365
    347366        result = rpccli_lsa_lookup_sids(cli, mem_ctx, &lsa_policy,
    348367                                        1, sid, &domains, &names, &types);
     368
     369        /* And restore our original timeout. */
     370        cli_set_timeout(cli->cli, orig_timeout);
     371
    349372        if (!NT_STATUS_IS_OK(result)) {         
    350373                DEBUG(2,("msrpc_sid_to_name: rpccli_lsa_lookup_sids()  failed (%s)\n",
     
    379402        size_t i;
    380403        char **ret_names;
     404        unsigned int orig_timeout;
    381405
    382406        DEBUG(3, ("rids_to_names [rpc] for domain %s\n", domain->name ));
     
    402426        }
    403427
     428        /*
     429         * This call can take a long time
     430         * allow the server to time out.
     431         * 35 seconds should do it.
     432         */
     433        orig_timeout = cli_set_timeout(cli->cli, 35000);
     434
    404435        result = rpccli_lsa_lookup_sids(cli, mem_ctx, &lsa_policy,
    405436                                        num_rids, sids, &domains,
    406437                                        names, types);
     438
     439        /* And restore our original timeout. */
     440        cli_set_timeout(cli->cli, orig_timeout);
     441
    407442        if (!NT_STATUS_IS_OK(result) &&
    408443            !NT_STATUS_EQUAL(result, STATUS_SOME_UNMAPPED)) {
  • branches/samba-3.2.x/source/winbindd/winbindd_sid.c

    r133 r335  
    9494                name_domain = state->request.data.name.name;
    9595                name_user = p+1;
     96        } else if ((p = strchr(state->request.data.name.name, '@')) != NULL) {
     97                name_domain = p + 1;
     98                *p = 0;
     99                name_user = state->request.data.name.name;
    96100        } else {
    97101                name_domain = state->request.data.name.dom_name;
  • branches/samba-3.2.x/source/winbindd/winbindd_util.c

    r232 r335  
    11031103                        fstrcpy(domain, lp_workgroup());
    11041104                } else if ((p = strchr(domuser, '@')) != NULL) {
    1105                         fstrcpy(domain, "");                   
     1105                        fstrcpy(domain, p + 1);
     1106                        user[PTR_DIFF(p, domuser)] = 0;
    11061107                } else {
    11071108                        return False;
Note: See TracChangeset for help on using the changeset viewer.