Changeset 335 for branches/samba-3.2.x/source
- Timestamp:
- Sep 24, 2009, 9:15:13 AM (16 years ago)
- Location:
- branches/samba-3.2.x/source
- Files:
-
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.2.x/source/VERSION
r282 r335 26 26 SAMBA_VERSION_MAJOR=3 27 27 SAMBA_VERSION_MINOR=2 28 SAMBA_VERSION_RELEASE=1 328 SAMBA_VERSION_RELEASE=14 29 29 30 30 ######################################################## -
branches/samba-3.2.x/source/include/version.h
r282 r335 2 2 #define SAMBA_VERSION_MAJOR 3 3 3 #define SAMBA_VERSION_MINOR 2 4 #define SAMBA_VERSION_RELEASE 1 35 #define SAMBA_VERSION_OFFICIAL_STRING "3.2.1 3"4 #define SAMBA_VERSION_RELEASE 14 5 #define SAMBA_VERSION_OFFICIAL_STRING "3.2.14" 6 6 #define SAMBA_VERSION_STRING samba_version_string() -
branches/samba-3.2.x/source/lib/netapi/joindomain.c
r136 r335 210 210 u->in.domain_name = domain; 211 211 u->in.unjoin_flags = r->in.unjoin_flags; 212 u->in.delete_machine_account = false; 212 213 u->in.modify_config = true; 213 214 u->in.debug = true; -
branches/samba-3.2.x/source/lib/smbldap.c
r228 r335 1349 1349 } 1350 1350 1351 DEBUG(3,("smbldap_search_paged: search was successful l\n"));1351 DEBUG(3,("smbldap_search_paged: search was successful\n")); 1352 1352 1353 1353 rc = ldap_parse_result(ldap_state->ldap_struct, *res, NULL, NULL, -
branches/samba-3.2.x/source/lib/util.c
r247 r335 2703 2703 } 2704 2704 if (name) { 2705 *name = "";2705 *name = dir; 2706 2706 } 2707 2707 return True; -
branches/samba-3.2.x/source/libnet/libnet_join.c
r232 r335 1836 1836 } 1837 1837 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 1838 1844 if (!r->in.dc_name) { 1839 1845 struct netr_DsRGetDCNameInfo *info; … … 1861 1867 } 1862 1868 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 1876 1869 #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) { 1878 1875 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 } 1881 1885 if (!ADS_ERR_OK(ads_status)) { 1882 1886 libnet_unjoin_set_error_string(mem_ctx, r, … … 1885 1889 } else { 1886 1890 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);1890 1891 W_ERROR_HAVE_NO_MEMORY(r->out.dns_domain_name); 1892 libnet_join_unjoindomain_remove_secrets(mem_ctx, r); 1893 return WERR_OK; 1891 1894 } 1892 1895 } 1893 1896 #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 */ 1894 1917 1895 1918 libnet_join_unjoindomain_remove_secrets(mem_ctx, r); -
branches/samba-3.2.x/source/librpc/gen_ndr/libnet_join.h
r136 r335 57 57 const char * machine_password; 58 58 uint32_t unjoin_flags; 59 uint8_t delete_machine_account; 59 60 uint8_t modify_config; 60 61 struct dom_sid *domain_sid;/* [ref] */ -
branches/samba-3.2.x/source/librpc/gen_ndr/ndr_libnet_join.c
r133 r335 88 88 #endif 89 89 ndr_print_wkssvc_joinflags(ndr, "unjoin_flags", r->in.unjoin_flags); 90 ndr_print_uint8(ndr, "delete_machine_account", r->in.delete_machine_account); 90 91 ndr_print_uint8(ndr, "modify_config", r->in.modify_config); 91 92 ndr_print_ptr(ndr, "domain_sid", r->in.domain_sid); -
branches/samba-3.2.x/source/librpc/idl/libnet_join.idl
r136 r335 52 52 [in] string machine_password, 53 53 [in] wkssvc_joinflags unjoin_flags, 54 [in] boolean8 delete_machine_account, 54 55 [in] boolean8 modify_config, 55 56 [in] dom_sid *domain_sid, -
branches/samba-3.2.x/source/libsmb/passchange.c
r133 r335 170 170 asprintf(err_str, "SAMR connection to machine %s " 171 171 "failed. Error was %s, but LANMAN password " 172 "change dare disabled\n",172 "changes are disabled\n", 173 173 nt_errstr(result), remote_machine); 174 174 result = cli_nt_error(cli); -
branches/samba-3.2.x/source/nsswitch/pam_winbind.c
r232 r335 1911 1911 int account_name_len; 1912 1912 char sep; 1913 char *p; 1914 char *name; 1915 char *domain; 1913 1916 1914 1917 /* This cannot work when the winbind separator = @ */ … … 1919 1922 } 1920 1923 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 1921 1933 /* Convert the UPN to a SID */ 1922 1934 … … 1924 1936 ZERO_STRUCT(resp); 1925 1937 1926 strncpy(req.data.name.dom_name, "",1938 strncpy(req.data.name.dom_name, domain, 1927 1939 sizeof(req.data.name.dom_name) - 1); 1928 strncpy(req.data.name.name, upn,1940 strncpy(req.data.name.name, name, 1929 1941 sizeof(req.data.name.name) - 1); 1930 1942 retval = pam_winbind_request_log(ctx, WINBINDD_LOOKUPNAME, … … 1948 1960 resp.data.name.dom_name, 1949 1961 resp.data.name.name); 1962 SAFE_FREE(name); 1950 1963 1951 1964 return account_name; -
branches/samba-3.2.x/source/passdb/lookup_sid.c
r272 r335 1086 1086 DATA_BLOB cache_value; 1087 1087 1088 if (!memcache_lookup(NULL, SID_ UID_CACHE,1088 if (!memcache_lookup(NULL, SID_GID_CACHE, 1089 1089 data_blob_const(psid, ndr_size_dom_sid(psid, 0)), 1090 1090 &cache_value)) { -
branches/samba-3.2.x/source/passdb/passdb.c
r137 r335 676 676 } 677 677 678 result = samu_ set_unix( sam_pass, pwd );678 result = samu_alloc_rid_unix( sam_pass, pwd ); 679 679 680 680 DEBUGLEVEL = tmp_debug; -
branches/samba-3.2.x/source/rpc_server/srv_lsa_nt.c
r272 r335 1093 1093 status = _lsa_LookupNames(p, &q); 1094 1094 1095 sid_array2->count = sid_array->count; 1095 1096 sid_array2->sids = TALLOC_ARRAY(p->mem_ctx, struct lsa_TranslatedSid2, sid_array->count); 1096 1097 if (!sid_array2->sids) { -
branches/samba-3.2.x/source/rpc_server/srv_samr_nt.c
r272 r335 261 261 *pacc_requested &= ~MAXIMUM_ALLOWED_ACCESS; 262 262 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; 265 265 266 266 /* root gets anything. */ -
branches/samba-3.2.x/source/script/tests/test_posix_s3.sh
r138 r335 39 39 rpc="$rpc RPC-SAMBA3-SPOOLSS RPC-SAMBA3-WKSSVC" 40 40 rpc="$rpc RPC-NETLOGSAMBA3 RPC-SAMBA3SESSIONKEY RPC-SAMBA3-GETUSERNAME" 41 rpc="$rpc RPC-LSA-LOOKUPSIDS RPC-JOIN RPC-SAMR-MACHINE-AUTH" 42 41 43 42 44 # 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 1218 1218 } 1219 1219 fstrcpy(s->comment, p); 1220 string_truncate(s->comment, MAX_SERVER_STRING_LENGTH); 1220 1221 1221 1222 s->domain[0] = '\0'; -
branches/samba-3.2.x/source/smbd/open.c
r235 r335 251 251 if (!CAN_WRITE(conn)) { 252 252 /* 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)) { 254 254 DEBUG(3,("Permission denied opening %s\n", path)); 255 255 return NT_STATUS_ACCESS_DENIED; … … 259 259 access into the directory. 260 260 */ 261 flags &= ~ O_CREAT;262 local_flags &= ~ O_CREAT;261 flags &= ~(O_CREAT|O_EXCL); 262 local_flags &= ~(O_CREAT|O_EXCL); 263 263 } 264 264 } -
branches/samba-3.2.x/source/smbd/server.c
r233 r335 349 349 unsigned dns_port = 0; 350 350 351 if (!is_daemon) {352 return open_sockets_inetd();353 }354 355 351 #ifdef HAVE_ATEXIT 356 352 { … … 362 358 } 363 359 #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 } 364 371 365 372 /* Stop zombies */ … … 1207 1214 BlockSignals(False, SIGTERM); 1208 1215 1216 /* Ensure we leave no zombies until we 1217 * correctly set up child handling below. */ 1218 CatchChild(); 1219 1209 1220 /* we want total control over the permissions on created files, 1210 1221 so set our umask to 0 */ -
branches/samba-3.2.x/source/smbd/trans2.c
r272 r335 4920 4920 if (setting_write_time) { 4921 4921 /* 4922 * This was a setfileinfo on an open file.4922 * This was a Windows setfileinfo on an open file. 4923 4923 * NT does this a lot. We also need to 4924 4924 * set the time here, as it can be read by … … 5997 5997 bool delete_on_fail = False; 5998 5998 enum perm_type ptype; 5999 files_struct *all_fsps = NULL; 6000 bool modify_mtime = true; 6001 struct file_id id; 5999 6002 6000 6003 if (total_data < 100) { … … 6143 6146 6144 6147 /* 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, 6147 6170 fsp, 6148 6171 fname, 6149 6172 psbuf, 6150 6173 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; 6152 6181 } 6153 6182 … … 6776 6805 } 6777 6806 6778 if (!CAN_WRITE(conn)) {6779 reply_doserror(req, ERRSRV, ERRaccess);6780 return;6781 }6782 6783 6807 if (INFO_LEVEL_IS_UNIX(info_level) && !lp_unix_extensions()) { 6784 6808 reply_nterror(req, NT_STATUS_INVALID_LEVEL); 6785 6809 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 } 6786 6819 } 6787 6820 … … 7090 7123 7091 7124 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 } 7092 7140 7093 7141 status = unix_convert(ctx, conn, directory, False, &directory, NULL, &sbuf); -
branches/samba-3.2.x/source/utils/net_ads.c
r232 r335 836 836 r->in.admin_password = net_prompt_pass(opt_user_name); 837 837 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 */ 838 841 r->in.unjoin_flags = WKSSVC_JOIN_FLAGS_JOIN_TYPE | 839 842 WKSSVC_JOIN_FLAGS_ACCOUNT_DELETE; 843 r->in.delete_machine_account = true; 840 844 841 845 werr = libnet_Unjoin(ctx, r); … … 847 851 } 848 852 849 if ( W_ERROR_IS_OK(werr)) {853 if (r->out.deleted_machine_account) { 850 854 d_printf("Deleted account for '%s' in realm '%s'\n", 851 855 r->in.machine_name, r->out.dns_domain_name); … … 861 865 } 862 866 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", 864 871 r->in.machine_name, r->out.dns_domain_name); 865 872 -
branches/samba-3.2.x/source/utils/net_rpc.c
r272 r335 5939 5939 union lsa_TrustedDomainInfo *info = NULL; 5940 5940 char *cleartextpwd = NULL; 5941 DATA_BLOB data ;5941 DATA_BLOB data = data_blob_null; 5942 5942 5943 5943 nt_status = rpccli_lsa_QueryTrustedDomainInfoBySid(pipe_hnd, mem_ctx, -
branches/samba-3.2.x/source/winbindd/idmap_ldap.c
r233 r335 894 894 struct idmap_ldap_context *ctx; 895 895 LDAPMessage *result = NULL; 896 LDAPMessage *entry = NULL; 896 897 const char *uidNumber; 897 898 const char *gidNumber; … … 989 990 990 991 for (i = 0; i < count; i++) { 991 LDAPMessage *entry = NULL;992 992 char *sidstr = NULL; 993 993 char *tmp = NULL; -
branches/samba-3.2.x/source/winbindd/winbindd_ads.c
r228 r335 1120 1120 /* handle sids not resolved from cache by lsa_lookup_sids */ 1121 1121 if (num_nocache > 0) { 1122 unsigned int orig_timeout; 1122 1123 1123 1124 status = cm_connect_lsa(domain, tmp_ctx, &cli, &lsa_policy); … … 1126 1127 goto done; 1127 1128 } 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); 1128 1136 1129 1137 status = rpccli_lsa_lookup_sids(cli, tmp_ctx, … … 1135 1143 &name_types_nocache); 1136 1144 1145 /* And restore our original timeout. */ 1146 cli_set_timeout(cli->cli, orig_timeout); 1147 1137 1148 if (!(NT_STATUS_IS_OK(status) || 1138 1149 NT_STATUS_EQUAL(status, STATUS_SOME_UNMAPPED) || … … 1148 1159 goto done; 1149 1160 } 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); 1150 1168 1151 1169 status = rpccli_lsa_lookup_sids(cli, tmp_ctx, … … 1156 1174 &names_nocache, 1157 1175 &name_types_nocache); 1176 1177 /* And restore our original timeout. */ 1178 cli_set_timeout(cli->cli, orig_timeout); 1158 1179 } 1159 1180 -
branches/samba-3.2.x/source/winbindd/winbindd_rpc.c
r233 r335 280 280 struct rpc_pipe_client *cli; 281 281 POLICY_HND lsa_policy; 282 unsigned int orig_timeout; 282 283 283 284 if (name == NULL || *name=='\0') { … … 303 304 return result; 304 305 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 305 313 result = rpccli_lsa_lookup_names(cli, mem_ctx, &lsa_policy, 1, 306 314 (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 308 319 if (!NT_STATUS_IS_OK(result)) 309 320 return result; … … 333 344 struct rpc_pipe_client *cli; 334 345 POLICY_HND lsa_policy; 346 unsigned int orig_timeout; 335 347 336 348 DEBUG(3,("sid_to_name [rpc] %s for domain %s\n", sid_string_dbg(sid), … … 345 357 346 358 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 347 366 result = rpccli_lsa_lookup_sids(cli, mem_ctx, &lsa_policy, 348 367 1, sid, &domains, &names, &types); 368 369 /* And restore our original timeout. */ 370 cli_set_timeout(cli->cli, orig_timeout); 371 349 372 if (!NT_STATUS_IS_OK(result)) { 350 373 DEBUG(2,("msrpc_sid_to_name: rpccli_lsa_lookup_sids() failed (%s)\n", … … 379 402 size_t i; 380 403 char **ret_names; 404 unsigned int orig_timeout; 381 405 382 406 DEBUG(3, ("rids_to_names [rpc] for domain %s\n", domain->name )); … … 402 426 } 403 427 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 404 435 result = rpccli_lsa_lookup_sids(cli, mem_ctx, &lsa_policy, 405 436 num_rids, sids, &domains, 406 437 names, types); 438 439 /* And restore our original timeout. */ 440 cli_set_timeout(cli->cli, orig_timeout); 441 407 442 if (!NT_STATUS_IS_OK(result) && 408 443 !NT_STATUS_EQUAL(result, STATUS_SOME_UNMAPPED)) { -
branches/samba-3.2.x/source/winbindd/winbindd_sid.c
r133 r335 94 94 name_domain = state->request.data.name.name; 95 95 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; 96 100 } else { 97 101 name_domain = state->request.data.name.dom_name; -
branches/samba-3.2.x/source/winbindd/winbindd_util.c
r232 r335 1103 1103 fstrcpy(domain, lp_workgroup()); 1104 1104 } else if ((p = strchr(domuser, '@')) != NULL) { 1105 fstrcpy(domain, ""); 1105 fstrcpy(domain, p + 1); 1106 user[PTR_DIFF(p, domuser)] = 0; 1106 1107 } else { 1107 1108 return False;
Note:
See TracChangeset
for help on using the changeset viewer.