Changeset 736 for branches/samba-3.5.x/source3
- Timestamp:
- Nov 12, 2012, 5:38:52 PM (13 years ago)
- Location:
- branches/samba-3.5.x/source3
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.5.x/source3/VERSION
r735 r736 26 26 SAMBA_VERSION_MAJOR=3 27 27 SAMBA_VERSION_MINOR=5 28 SAMBA_VERSION_RELEASE=1 528 SAMBA_VERSION_RELEASE=16 29 29 30 30 ######################################################## -
branches/samba-3.5.x/source3/auth/auth_server.c
r414 r736 274 274 auth_serversupplied_info **server_info) 275 275 { 276 struct server_security_state *state = talloc_get_type_abort( 277 my_private_data, struct server_security_state); 278 struct cli_state *cli; 276 struct server_security_state *state = NULL; 277 struct cli_state *cli = NULL; 279 278 static bool tested_password_server = False; 280 279 static bool bad_password_server = False; … … 282 281 bool locally_made_cli = False; 283 282 283 DEBUG(10, ("check_smbserver_security: Check auth for: [%s]\n", 284 user_info->smb_name)); 285 286 if (my_private_data == NULL) { 287 DEBUG(10,("check_smbserver_security: " 288 "password server is not connected\n")); 289 return NT_STATUS_LOGON_FAILURE; 290 } 291 292 state = talloc_get_type_abort(my_private_data, struct server_security_state); 284 293 cli = state->cli; 285 294 -
branches/samba-3.5.x/source3/include/ads.h
r414 r736 109 109 char *schema_path; 110 110 char *config_path; 111 int ldap_page_size; 111 112 } config; 112 113 -
branches/samba-3.5.x/source3/include/proto.h
r733 r736 3919 3919 3920 3920 char *lp_smb_ports(void); 3921 c har *lp_dos_charset(void);3922 c har *lp_unix_charset(void);3923 c har *lp_display_charset(void);3921 const char *lp_dos_charset(void); 3922 const char *lp_unix_charset(void); 3923 const char *lp_display_charset(void); 3924 3924 char *lp_logfile(void); 3925 3925 char *lp_configfile(void); -
branches/samba-3.5.x/source3/lib/debug.c
r414 r736 658 658 fname = SMB_STRDUP(logfname); 659 659 if (!fname) { 660 TALLOC_FREE(logfname); 660 661 return false; 661 662 } 662 663 } 664 TALLOC_FREE(logfname); 663 665 } 664 666 … … 1029 1031 if( lp_timestamp_logs() || lp_debug_prefix_timestamp() || !(lp_loaded()) ) { 1030 1032 char header_str[200]; 1033 char *curtime = current_timestring(talloc_tos(), 1034 lp_debug_hires_timestamp()); 1031 1035 1032 1036 header_str[0] = '\0'; … … 1051 1055 default_classname_table[cls]); 1052 1056 } 1053 1057 1054 1058 /* Print it all out at once to prevent split syslog output. */ 1055 1059 if( lp_debug_prefix_timestamp() ) { 1056 1060 (void)Debug1( "[%s, %2d%s] ", 1057 current_timestring(talloc_tos(), 1058 lp_debug_hires_timestamp()), 1061 curtime, 1059 1062 level, header_str); 1060 1063 } else { 1061 1064 (void)Debug1( "[%s, %2d%s] %s(%s)\n", 1062 current_timestring(talloc_tos(), 1063 lp_debug_hires_timestamp()), 1065 curtime, 1064 1066 level, header_str, location, func ); 1065 1067 } 1068 TALLOC_FREE(curtime); 1066 1069 } 1067 1070 -
branches/samba-3.5.x/source3/libads/ads_status.c
r414 r736 80 80 return NT_STATUS_OK; 81 81 } 82 if (status.err.rc == LDAP_TIMELIMIT_EXCEEDED) { 83 return NT_STATUS_IO_TIMEOUT; 84 } 82 85 return NT_STATUS_LDAP(status.err.rc); 83 86 #endif -
branches/samba-3.5.x/source3/libads/ads_struct.c
r414 r736 149 149 ads->auth.flags = wrap_flags; 150 150 151 /* Start with a page size of 1000 when the connection is new, 152 * we will drop it by half we get a timeout. */ 153 ads->config.ldap_page_size = 1000; 154 151 155 return ads; 152 156 } -
branches/samba-3.5.x/source3/libads/ldap.c
r583 r736 925 925 cookie_be = ber_alloc_t(LBER_USE_DER); 926 926 if (*cookie) { 927 ber_printf(cookie_be, "{iO}", (ber_int_t) 1000, *cookie);927 ber_printf(cookie_be, "{iO}", (ber_int_t) ads->config.ldap_page_size, *cookie); 928 928 ber_bvfree(*cookie); /* don't need it from last time */ 929 929 *cookie = NULL; 930 930 } else { 931 ber_printf(cookie_be, "{io}", (ber_int_t) 1000, "", 0);931 ber_printf(cookie_be, "{io}", (ber_int_t) ads->config.ldap_page_size, "", 0); 932 932 } 933 933 ber_flatten(cookie_be, &cookie_bv); -
branches/samba-3.5.x/source3/libads/ldap_utils.c
r414 r736 69 69 while (--count) { 70 70 71 if (NT_STATUS_EQUAL(ads_ntstatus(status), NT_STATUS_IO_TIMEOUT) && ads->config.ldap_page_size >= 250) { 72 int new_page_size = (ads->config.ldap_page_size / 2); 73 DEBUG(1, ("Reducing LDAP page size from %d to %d due to IO_TIMEOUT\n", 74 ads->config.ldap_page_size, new_page_size)); 75 ads->config.ldap_page_size = new_page_size; 76 } 77 71 78 if (*res) 72 79 ads_msgfree(ads, *res); -
branches/samba-3.5.x/source3/libsmb/clireadwrite.c
r733 r736 89 89 struct tevent_req *req, *subreq; 90 90 struct cli_read_andx_state *state; 91 bool bigoffset = False;92 91 uint8_t wct = 10; 93 92 … … 116 115 SSVAL(state->vwv + 9, 0, 0); 117 116 118 if ((uint64_t)offset >> 32) { 119 bigoffset = true; 117 if (cli->capabilities & CAP_LARGE_FILES) { 120 118 SIVAL(state->vwv + 10, 0, 121 119 (((uint64_t)offset)>>32) & 0xffffffff); 122 wct += 2; 120 wct = 12; 121 } else { 122 if ((((uint64_t)offset) & 0xffffffff00000000LL) != 0) { 123 DEBUG(10, ("cli_read_andx_send got large offset where " 124 "the server does not support it\n")); 125 tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER); 126 return tevent_req_post(req, ev); 127 } 123 128 } 124 129 -
branches/samba-3.5.x/source3/libsmb/clispnego.c
r590 r736 162 162 const char *oid_str = NULL; 163 163 asn1_read_OID(data,talloc_autofree_context(),&oid_str); 164 if (data->has_error) { 165 break; 166 } 164 167 OIDs[i] = CONST_DISCARD(char *, oid_str); 165 168 } -
branches/samba-3.5.x/source3/libsmb/namequery.c
r414 r736 572 572 "looking for duplicate address/port pairs\n")); 573 573 574 /* one loop to remove duplicates*/574 /* One loop to set duplicates to a zero addr. */ 575 575 for ( i=0; i<count; i++ ) { 576 576 if ( is_zero_addr((struct sockaddr *)&iplist[i].ss)) { … … 586 586 } 587 587 588 /* one loop to clean up any holes we left */ 589 /* first ip should never be a zero_ip() */ 590 for (i = 0; i<count; ) { 591 if (is_zero_addr((struct sockaddr *)&iplist[i].ss) ) { 592 if (i != count-1) { 593 memmove(&iplist[i], &iplist[i+1], 594 (count - i - 1)*sizeof(iplist[i])); 588 /* Now remove any addresses set to zero above. */ 589 for (i = 0; i < count; i++) { 590 while (i < count && 591 is_zero_addr((struct sockaddr *)&iplist[i].ss)) { 592 if (count-i-1>0) { 593 memmove(&iplist[i], 594 &iplist[i+1], 595 (count-i-1)*sizeof(struct ip_service)); 595 596 } 596 597 count--; 597 continue; 598 } 599 i++; 598 } 600 599 } 601 600 … … 850 849 851 850 /******************************************************** 852 convert an array if struct sockaddr_storage to struct ip_service851 Convert an array if struct sockaddr_storage to struct ip_service 853 852 return false on failure. Port is set to PORT_NONE; 853 pcount is [in/out] - it is the length of ss_list on input, 854 and the length of return_iplist on output as we remove any 855 zero addresses from ss_list. 854 856 *********************************************************/ 855 857 856 858 static bool convert_ss2service(struct ip_service **return_iplist, 857 859 const struct sockaddr_storage *ss_list, 858 int count)860 int *pcount) 859 861 { 860 862 int i; 861 862 if ( count==0 || !ss_list ) 863 int orig_count = *pcount; 864 int real_count = 0; 865 866 if (orig_count==0 || !ss_list ) 863 867 return False; 864 868 869 /* Filter out zero addrs. */ 870 for ( i=0; i<orig_count; i++ ) { 871 if (is_zero_addr((struct sockaddr *)&ss_list[i])) { 872 continue; 873 } 874 real_count++; 875 } 876 if (real_count==0) { 877 return false; 878 } 879 865 880 /* copy the ip address; port will be PORT_NONE */ 866 if ((*return_iplist = SMB_MALLOC_ARRAY(struct ip_service, count)) ==881 if ((*return_iplist = SMB_MALLOC_ARRAY(struct ip_service, real_count)) == 867 882 NULL) { 868 883 DEBUG(0,("convert_ip2service: malloc failed " 869 "for %d enetries!\n", count ));884 "for %d enetries!\n", real_count )); 870 885 return False; 871 886 } 872 887 873 for ( i=0; i<count; i++ ) { 874 (*return_iplist)[i].ss = ss_list[i]; 875 (*return_iplist)[i].port = PORT_NONE; 876 } 877 888 for ( i=0, real_count = 0; i<orig_count; i++ ) { 889 if (is_zero_addr((struct sockaddr *)&ss_list[i])) { 890 continue; 891 } 892 (*return_iplist)[real_count].ss = ss_list[i]; 893 (*return_iplist)[real_count].port = PORT_NONE; 894 real_count++; 895 } 896 897 *pcount = real_count; 878 898 return true; 879 899 } … … 948 968 949 969 status = NT_STATUS_OK; 950 if (!convert_ss2service(return_iplist, ss_list, *return_count) )970 if (!convert_ss2service(return_iplist, ss_list, return_count) ) 951 971 status = NT_STATUS_INVALID_PARAMETER; 952 972 … … 1083 1103 1084 1104 status = NT_STATUS_OK; 1085 if (!convert_ss2service(return_iplist, ss_list, *return_count))1105 if (!convert_ss2service(return_iplist, ss_list, return_count)) 1086 1106 status = NT_STATUS_INVALID_PARAMETER; 1087 1107 … … 1231 1251 memcpy(&ss, res->ai_addr, res->ai_addrlen); 1232 1252 1253 if (is_zero_addr((struct sockaddr *)&ss)) { 1254 continue; 1255 } 1256 1233 1257 *return_count += 1; 1234 1258 … … 1264 1288 int *return_count) 1265 1289 { 1266 int i , j;1290 int i; 1267 1291 NTSTATUS status; 1268 1292 TALLOC_CTX *ctx; … … 1313 1337 1314 1338 for (i=0;i<numdcs;i++) { 1315 numaddrs += MAX(dcs[i].num_ips,1); 1339 if (!dcs[i].ss_s) { 1340 numaddrs += 1; 1341 } else { 1342 numaddrs += dcs[i].num_ips; 1343 } 1316 1344 } 1317 1345 … … 1327 1355 1328 1356 *return_count = 0; 1329 i = 0; 1330 j = 0; 1331 while ( i < numdcs && (*return_count<numaddrs) ) { 1332 struct ip_service *r = &(*return_iplist)[*return_count]; 1333 1334 r->port = dcs[i].port; 1335 1336 /* If we don't have an IP list for a name, lookup it up */ 1337 1357 1358 for (i = 0; i < numdcs; i++) { 1359 /* If we don't have an IP list for a name, look it up */ 1338 1360 if (!dcs[i].ss_s) { 1339 interpret_string_addr(&r->ss, dcs[i].hostname, 0); 1340 i++; 1341 j = 0; 1361 /* We need to get all IP addresses here. */ 1362 struct addrinfo *res = NULL; 1363 struct addrinfo *p; 1364 int extra_addrs = 0; 1365 1366 if (!interpret_string_addr_internal(&res, 1367 dcs[i].hostname, 1368 0)) { 1369 continue; 1370 } 1371 /* Add in every IP from the lookup. How 1372 many is that ? */ 1373 for (p = res; p; p = p->ai_next) { 1374 if (is_zero_addr((struct sockaddr *)p->ai_addr)) { 1375 continue; 1376 } 1377 extra_addrs++; 1378 } 1379 if (extra_addrs > 1) { 1380 /* We need to expand the return_iplist array 1381 as we only budgeted for one address. */ 1382 numaddrs += (extra_addrs-1); 1383 *return_iplist = SMB_REALLOC_ARRAY(*return_iplist, 1384 struct ip_service, 1385 numaddrs); 1386 if (*return_iplist == NULL) { 1387 if (res) { 1388 freeaddrinfo(res); 1389 } 1390 talloc_destroy(ctx); 1391 return NT_STATUS_NO_MEMORY; 1392 } 1393 } 1394 for (p = res; p; p = p->ai_next) { 1395 (*return_iplist)[*return_count].port = dcs[i].port; 1396 memcpy(&(*return_iplist)[*return_count].ss, 1397 p->ai_addr, 1398 p->ai_addrlen); 1399 if (is_zero_addr((struct sockaddr *)&(*return_iplist)[*return_count].ss)) { 1400 continue; 1401 } 1402 (*return_count)++; 1403 /* Should never happen, but still... */ 1404 if (*return_count>=numaddrs) { 1405 break; 1406 } 1407 } 1408 if (res) { 1409 freeaddrinfo(res); 1410 } 1342 1411 } else { 1343 /* use the IP addresses from the SRV sresponse */ 1344 1345 if ( j >= dcs[i].num_ips ) { 1346 i++; 1347 j = 0; 1348 continue; 1349 } 1350 1351 r->ss = dcs[i].ss_s[j]; 1352 j++; 1353 } 1354 1355 /* make sure it is a valid IP. I considered checking the 1356 * negative connection cache, but this is the wrong place 1357 * for it. Maybe only as a hack. After think about it, if 1358 * all of the IP addresses returned from DNS are dead, what 1359 * hope does a netbios name lookup have ? The standard reason 1360 * for falling back to netbios lookups is that our DNS server 1361 * doesn't know anything about the DC's -- jerry */ 1362 1363 if (!is_zero_addr((struct sockaddr *)&r->ss)) { 1364 (*return_count)++; 1412 /* use all the IP addresses from the SRV sresponse */ 1413 int j; 1414 for (j = 0; j < dcs[i].num_ips; j++) { 1415 (*return_iplist)[*return_count].port = dcs[i].port; 1416 (*return_iplist)[*return_count].ss = dcs[i].ss_s[j]; 1417 if (is_zero_addr((struct sockaddr *)&(*return_iplist)[*return_count].ss)) { 1418 continue; 1419 } 1420 (*return_count)++; 1421 /* Should never happen, but still... */ 1422 if (*return_count>=numaddrs) { 1423 break; 1424 } 1425 } 1365 1426 } 1366 1427 } … … 1419 1480 return NT_STATUS_INVALID_PARAMETER; 1420 1481 } 1482 if (is_zero_addr((struct sockaddr *)&(*return_iplist)->ss)) { 1483 SAFE_FREE(*return_iplist); 1484 return NT_STATUS_UNSUCCESSFUL; 1485 } 1421 1486 *return_count = 1; 1422 1487 return NT_STATUS_OK; … … 1426 1491 1427 1492 if (namecache_fetch(name, name_type, return_iplist, return_count)) { 1493 *return_count = remove_duplicate_addrs2(*return_iplist, 1494 *return_count ); 1428 1495 /* This could be a negative response */ 1429 1496 if (*return_count > 0) { … … 1520 1587 the iplist when the PDC is down will cause two sets of timeouts. */ 1521 1588 1522 if ( *return_count ) { 1523 *return_count = remove_duplicate_addrs2(*return_iplist, 1524 *return_count ); 1525 } 1589 *return_count = remove_duplicate_addrs2(*return_iplist, *return_count ); 1526 1590 1527 1591 /* Save in name cache */ … … 1539 1603 } 1540 1604 1541 namecache_store(name, name_type, *return_count, *return_iplist); 1605 if (*return_count) { 1606 namecache_store(name, name_type, *return_count, *return_iplist); 1607 } 1542 1608 1543 1609 /* Display some debugging info */ … … 2002 2068 explicit password servers */ 2003 2069 2004 if (local_count) { 2005 local_count = remove_duplicate_addrs2(return_iplist, 2006 local_count ); 2007 } 2070 local_count = remove_duplicate_addrs2(return_iplist, local_count ); 2008 2071 2009 2072 /* For DC's we always prioritize IPv4 due to W2K3 not -
branches/samba-3.5.x/source3/modules/vfs_default.c
r596 r736 1134 1134 1135 1135 #ifdef HAVE_KERNEL_OPLOCKS_LINUX 1136 /* first set the signal handler */1137 if(linux_set_lease_sighandler(fsp->fh->fd) == -1) {1138 return -1;1139 }1140 1141 1136 result = linux_setlease(fsp->fh->fd, leasetype); 1142 1137 #else -
branches/samba-3.5.x/source3/modules/vfs_gpfs.c
r599 r736 587 587 588 588 result = gpfs2smb_acl(pacl); 589 if (result == NULL) {590 goto done;589 if (result != NULL) { 590 errno = 0; 591 591 } 592 592 -
branches/samba-3.5.x/source3/nmbd/nmbd.c
r596 r736 371 371 372 372 if ( lp_loaded() ) { 373 c onst char *fname = lp_configfile();373 char *fname = lp_configfile(); 374 374 if (file_exist(fname) && !strcsequal(fname,get_dyn_CONFIGFILE())) { 375 375 set_dyn_CONFIGFILE(fname); 376 376 test = False; 377 377 } 378 TALLOC_FREE(fname); 378 379 } 379 380 -
branches/samba-3.5.x/source3/param/loadparm.c
r733 r736 5364 5364 5365 5365 FN_GLOBAL_STRING(lp_smb_ports, &Globals.smb_ports) 5366 FN_GLOBAL_ STRING(lp_dos_charset, &Globals.dos_charset)5367 FN_GLOBAL_ STRING(lp_unix_charset, &Globals.unix_charset)5368 FN_GLOBAL_ STRING(lp_display_charset, &Globals.display_charset)5366 FN_GLOBAL_CONST_STRING(lp_dos_charset, &Globals.dos_charset) 5367 FN_GLOBAL_CONST_STRING(lp_unix_charset, &Globals.unix_charset) 5368 FN_GLOBAL_CONST_STRING(lp_display_charset, &Globals.display_charset) 5369 5369 FN_GLOBAL_STRING(lp_logfile, &Globals.szLogFile) 5370 5370 FN_GLOBAL_STRING(lp_configfile, &Globals.szConfigFile) … … 9329 9329 } 9330 9330 9331 lp_add_auto_services(lp_auto_services()); 9331 { 9332 char *serv = lp_auto_services(); 9333 lp_add_auto_services(serv); 9334 TALLOC_FREE(serv); 9335 } 9332 9336 9333 9337 if (add_ipc) { -
branches/samba-3.5.x/source3/smbd/notify.c
r590 r736 367 367 } 368 368 369 static void notify_parent_dir(connection_struct *conn, 370 uint32 action, uint32 filter, 371 const char *path) 372 { 373 struct smb_filename smb_fname_parent; 374 char *parent; 375 const char *name; 376 char *oldwd; 377 378 if (!parent_dirname(talloc_tos(), path, &parent, &name)) { 379 DEBUG(1, ("Can't get parent dirname, giving up\n")); 380 return; 381 } 382 383 ZERO_STRUCT(smb_fname_parent); 384 smb_fname_parent.base_name = parent; 385 386 oldwd = vfs_GetWd(parent, conn); 387 if (oldwd == NULL) { 388 DEBUG(1, ("vfs_GetWd failed!\n")); 389 goto done; 390 } 391 if (vfs_ChDir(conn, conn->connectpath) == -1) { 392 DEBUG(1, ("Could not chdir to connect path!\n")); 393 goto done; 394 } 395 396 if (SMB_VFS_STAT(conn, &smb_fname_parent) == -1) { 397 goto chdir_done; 398 } 399 400 notify_onelevel(conn->notify_ctx, action, filter, 401 SMB_VFS_FILE_ID_CREATE(conn, &smb_fname_parent.st), 402 name); 403 chdir_done: 404 vfs_ChDir(conn, oldwd); 405 done: 406 TALLOC_FREE(parent); 407 } 408 369 409 void notify_fname(connection_struct *conn, uint32 action, uint32 filter, 370 410 const char *path) 371 411 { 372 char *fullpath; 373 char *parent; 374 const char *name; 412 char *fullpath = NULL; 375 413 376 414 if (path[0] == '.' && path[1] == '/') { 377 415 path += 2; 378 416 } 379 if (parent_dirname(talloc_tos(), path, &parent, &name)) { 380 struct smb_filename smb_fname_parent; 381 382 ZERO_STRUCT(smb_fname_parent); 383 smb_fname_parent.base_name = parent; 384 385 if (SMB_VFS_STAT(conn, &smb_fname_parent) != -1) { 386 notify_onelevel(conn->notify_ctx, action, filter, 387 SMB_VFS_FILE_ID_CREATE(conn, &smb_fname_parent.st), 388 name); 389 } 390 } 417 notify_parent_dir(conn, action, filter, path); 391 418 392 419 fullpath = talloc_asprintf(talloc_tos(), "%s/%s", conn->connectpath, -
branches/samba-3.5.x/source3/smbd/nttrans.c
r733 r736 133 133 total_sent_thistime + alignment_offset 134 134 + data_alignment_offset); 135 136 /*137 * We might have had SMBnttranss in req->inbuf, fix that.138 */139 SCVAL(req->outbuf, smb_com, SMBnttrans);140 135 141 136 /* … … 3069 3064 show_msg((char *)req->inbuf); 3070 3065 3066 /* Windows clients expect all replies to 3067 an NT transact secondary (SMBnttranss 0xA1) 3068 to have a command code of NT transact 3069 (SMBnttrans 0xA0). See bug #8989 for details. */ 3070 req->cmd = SMBnttrans; 3071 3071 3072 if (req->wct < 18) { 3072 3073 reply_nterror(req, NT_STATUS_INVALID_PARAMETER); -
branches/samba-3.5.x/source3/smbd/open.c
r733 r736 2297 2297 SMB_ASSERT(!is_ntfs_stream_smb_fname(smb_dname)); 2298 2298 2299 /* Ensure we have a directory attribute. */ 2300 file_attributes |= FILE_ATTRIBUTE_DIRECTORY; 2299 if (!(file_attributes & FILE_FLAG_POSIX_SEMANTICS)) { 2300 /* Ensure we have a directory attribute. */ 2301 file_attributes |= FILE_ATTRIBUTE_DIRECTORY; 2302 } 2301 2303 2302 2304 DEBUG(5,("open_directory: opening directory %s, access_mask = 0x%x, " -
branches/samba-3.5.x/source3/smbd/oplock_linux.c
r414 r736 75 75 int ret; 76 76 77 /* First set the signal handler. */ 78 if (linux_set_lease_sighandler(fd) == -1) { 79 return -1; 80 } 77 81 ret = fcntl(fd, F_SETLEASE, leasetype); 78 82 if (ret == -1 && errno == EACCES) { 79 83 set_effective_capability(LEASE_CAPABILITY); 84 /* 85 * Bug 8974 - work around Linux kernel bug 86 * https://bugzilla.kernel.org/show_bug.cgi?id=43336. 87 * "fcntl(F_SETLEASE) resets signal number when 88 * called multiple times" 89 */ 90 if (linux_set_lease_sighandler(fd) == -1) { 91 return -1; 92 } 80 93 ret = fcntl(fd, F_SETLEASE, leasetype); 81 94 } -
branches/samba-3.5.x/source3/smbd/server.c
r668 r736 804 804 test = False; 805 805 } 806 TALLOC_FREE(fname); 806 807 } 807 808 -
branches/samba-3.5.x/source3/smbd/service.c
r480 r736 751 751 return NULL; 752 752 } 753 754 /* We don't want to replace the original sanitized_username 755 as it is the original user given in the connect attempt. 756 This is used in '%U' substitutions. */ 757 TALLOC_FREE(forced_serverinfo->sanitized_username); 758 forced_serverinfo->sanitized_username = 759 talloc_move(forced_serverinfo, 760 &conn->server_info->sanitized_username); 753 761 754 762 TALLOC_FREE(conn->server_info); -
branches/samba-3.5.x/source3/smbd/trans2.c
r733 r736 862 862 reply_outbuf(req, 10, total_sent_thistime + alignment_offset 863 863 + data_alignment_offset); 864 865 /*866 * We might have SMBtrans2s in req which was transferred to867 * the outbuf, fix that.868 */869 SCVAL(req->outbuf, smb_com, SMBtrans2);870 864 871 865 /* Set total params and data to be sent */ … … 8585 8579 show_msg((char *)req->inbuf); 8586 8580 8581 /* Windows clients expect all replies to 8582 a transact secondary (SMBtranss2 0x33) 8583 to have a command code of transact 8584 (SMBtrans2 0x32). See bug #8989 8585 and also [MS-CIFS] section 2.2.4.47.2 8586 for details. 8587 */ 8588 req->cmd = SMBtrans2; 8589 8587 8590 if (req->wct < 8) { 8588 8591 reply_nterror(req, NT_STATUS_INVALID_PARAMETER); -
branches/samba-3.5.x/source3/utils/net_ads.c
r596 r736 2157 2157 attrs = (argv + 1); 2158 2158 2159 rc = ads_do_search_ all(ads, ads->config.bind_path,2159 rc = ads_do_search_retry(ads, ads->config.bind_path, 2160 2160 LDAP_SCOPE_SUBTREE, 2161 2161 ldap_exp, attrs, &res); -
branches/samba-3.5.x/source3/winbindd/winbindd.c
r732 r736 68 68 69 69 if (lp_loaded()) { 70 c onst char *fname = lp_configfile();70 char *fname = lp_configfile(); 71 71 72 72 if (file_exist(fname) && !strcsequal(fname,get_dyn_CONFIGFILE())) { 73 73 set_dyn_CONFIGFILE(fname); 74 74 } 75 TALLOC_FREE(fname); 75 76 } 76 77 … … 1073 1074 } 1074 1075 1076 /* We call dump_core_setup one more time because the command line can 1077 * set the log file or the log-basename and this will influence where 1078 * cores are stored. Without this call get_dyn_LOGFILEBASE will be 1079 * the default value derived from build's prefix. For EOM this value 1080 * is often not related to the path where winbindd is actually run 1081 * in production. 1082 */ 1083 dump_core_setup("winbindd"); 1084 1075 1085 if (is_daemon && interactive) { 1076 1086 d_fprintf(stderr,"\nERROR: " … … 1107 1117 exit(1); 1108 1118 } 1119 /* After parsing the configuration file we setup the core path one more time 1120 * as the log file might have been set in the configuration and cores's 1121 * path is by default basename(lp_logfile()). 1122 */ 1123 dump_core_setup("winbindd"); 1109 1124 1110 1125 /* Initialise messaging system */ -
branches/samba-3.5.x/source3/winbindd/winbindd_ads.c
r414 r736 181 181 182 182 rc = ads_search_retry(ads, &res, "(objectCategory=user)", attrs); 183 if (!ADS_ERR_OK(rc) || !res) {183 if (!ADS_ERR_OK(rc)) { 184 184 DEBUG(1,("query_user_list ads_search: %s\n", ads_errstr(rc))); 185 status = ads_ntstatus(rc); 186 } else if (!res) { 187 DEBUG(1,("query_user_list ads_search returned NULL res\n")); 188 185 189 goto done; 186 190 } … … 326 330 327 331 rc = ads_search_retry(ads, &res, filter, attrs); 328 if (!ADS_ERR_OK(rc) || !res) { 332 if (!ADS_ERR_OK(rc)) { 333 status = ads_ntstatus(rc); 329 334 DEBUG(1,("enum_dom_groups ads_search: %s\n", ads_errstr(rc))); 335 goto done; 336 } else if (!res) { 337 DEBUG(1,("enum_dom_groups ads_search returned NULL res\n")); 330 338 goto done; 331 339 } … … 533 541 } 534 542 rc = ads_search_retry(ads, &msg, ldap_exp, attrs); 535 free(ldap_exp);543 SAFE_FREE(ldap_exp); 536 544 TALLOC_FREE(sidstr); 537 if (!ADS_ERR_OK(rc) || !msg) {545 if (!ADS_ERR_OK(rc)) { 538 546 DEBUG(1,("query_user(sid=%s) ads_search: %s\n", 539 547 sid_string_dbg(sid), ads_errstr(rc))); 540 goto done; 548 return ads_ntstatus(rc); 549 } else if (!msg) { 550 DEBUG(1,("query_user(sid=%s) ads_search returned NULL res\n", 551 sid_string_dbg(sid))); 552 return NT_STATUS_INTERNAL_ERROR; 541 553 } 542 554 … … 633 645 rc = ads_search_retry(ads, &res, ldap_exp, group_attrs); 634 646 635 if (!ADS_ERR_OK(rc) || !res) {647 if (!ADS_ERR_OK(rc)) { 636 648 DEBUG(1,("lookup_usergroups ads_search member=%s: %s\n", user_dn, ads_errstr(rc))); 637 649 return ads_ntstatus(rc); 638 } 650 } else if (!res) { 651 DEBUG(1,("lookup_usergroups ads_search returned NULL res\n")); 652 return NT_STATUS_INTERNAL_ERROR; 653 } 654 639 655 640 656 count = ads_count_replies(ads, res); -
branches/samba-3.5.x/source3/winbindd/winbindd_dual.c
r732 r736 37 37 extern bool override_logfile; 38 38 extern struct winbindd_methods cache_methods; 39 40 static struct winbindd_child *children = NULL; 39 41 40 42 /* Read some data from a client connection */ … … 171 173 close(state->child->sock); 172 174 state->child->sock = -1; 175 DLIST_REMOVE(children, state->child); 173 176 tevent_req_error(req, err); 174 177 return; … … 517 520 SMB_ASSERT(child->rpccli != NULL); 518 521 } 519 520 struct winbindd_child *children = NULL;521 522 522 523 void winbind_child_died(pid_t pid) -
branches/samba-3.5.x/source3/winbindd/winbindd_pam.c
r733 r736 1366 1366 } 1367 1367 1368 logon_fn = contact_domain->can_do_samlogon_ex1368 logon_fn = (contact_domain->can_do_samlogon_ex && domain->can_do_validation6) 1369 1369 ? rpccli_netlogon_sam_network_logon_ex 1370 1370 : rpccli_netlogon_sam_network_logon; … … 1559 1559 1560 1560 if ( mapped_user != state->request->data.auth.user ) { 1561 fstr_sprintf( domain_user, "%s\\%s", name_domain, name_user ); 1561 fstr_sprintf( domain_user, "%s%c%s", name_domain, 1562 *lp_winbind_separator(), 1563 name_user ); 1562 1564 safe_strcpy( state->request->data.auth.user, domain_user, 1563 1565 sizeof(state->request->data.auth.user)-1 ); … … 1990 1992 } 1991 1993 1992 logon_fn = contact_domain->can_do_samlogon_ex1994 logon_fn = (contact_domain->can_do_samlogon_ex && domain->can_do_validation6) 1993 1995 ? rpccli_netlogon_sam_network_logon_ex 1994 1996 : rpccli_netlogon_sam_network_logon;
Note:
See TracChangeset
for help on using the changeset viewer.