Changeset 228 for branches/samba-3.2.x/source/nsswitch
- Timestamp:
- May 26, 2009, 9:44:50 AM (16 years ago)
- Location:
- branches/samba-3.2.x/source/nsswitch
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.2.x/source/nsswitch/libwbclient/wbc_sid.c
r141 r228 41 41 int i; 42 42 char *tmp = NULL; 43 TALLOC_CTX *ctx = NULL;44 43 45 44 if (!sid) { … … 47 46 BAIL_ON_WBC_ERROR(wbc_status); 48 47 } 49 50 ctx = talloc_init("wbcSidToString");51 BAIL_ON_PTR_ERROR(ctx, wbc_status);52 48 53 49 id_auth = sid->id_auth[5] + … … 56 52 (sid->id_auth[2] << 24); 57 53 58 tmp = talloc_asprintf( ctx, "S-%d-%d", sid->sid_rev_num, id_auth);54 tmp = talloc_asprintf(NULL, "S-%d-%d", sid->sid_rev_num, id_auth); 59 55 BAIL_ON_PTR_ERROR(tmp, wbc_status); 60 56 … … 67 63 } 68 64 69 *sid_string =talloc_strdup(NULL, tmp);70 BAIL_ON_PTR_ERROR((*sid_string), wbc_status);65 *sid_string = tmp; 66 tmp = NULL; 71 67 72 68 wbc_status = WBC_ERR_SUCCESS; 73 69 74 70 done: 75 talloc_free( ctx);71 talloc_free(tmp); 76 72 77 73 return wbc_status; -
branches/samba-3.2.x/source/nsswitch/pam_winbind.c
r141 r228 2359 2359 2360 2360 out: 2361 /* 2362 * Delete the krb5 ccname variable from the PAM environment 2363 * if it was set by winbind. 2364 */ 2365 if (ctx->ctrl & WINBIND_KRB5_AUTH) { 2366 pam_putenv(pamh, "KRB5CCNAME"); 2367 } 2361 2368 2362 2369 _PAM_LOG_FUNCTION_LEAVE("pam_sm_close_session", ctx, retval); -
branches/samba-3.2.x/source/nsswitch/winbind_struct_protocol.h
r133 r228 203 203 /* Flag to say this is a winbindd internal send - don't recurse. */ 204 204 #define WBFLAG_RECURSE 0x00000800 205 205 /* Flag to tell winbind the NTLMv2 blob is too big for the struct and is in the 206 * extra_data field */ 207 #define WBFLAG_BIG_NTLMV2_BLOB 0x00010000 206 208 207 209 #define WINBINDD_MAX_EXTRA_DATA (128*1024) -
branches/samba-3.2.x/source/nsswitch/wins.c
r136 r228 24 24 25 25 #include <ns_daemon.h> 26 #endif 27 28 #if HAVE_PTHREAD_H 29 #include <pthread.h> 30 #endif 31 32 #if HAVE_PTHREAD 33 static pthread_mutex_t wins_nss_mutex = PTHREAD_MUTEX_INITIALIZER; 26 34 #endif 27 35 … … 322 330 char *buffer, size_t buflen, int *h_errnop) 323 331 { 332 NSS_STATUS nss_status = NSS_STATUS_SUCCESS; 324 333 struct in_addr *ip_list; 325 334 int i, count; … … 327 336 size_t namelen; 328 337 338 #if HAVE_PTHREAD 339 pthread_mutex_lock(&wins_nss_mutex); 340 #endif 341 329 342 memset(he, '\0', sizeof(*he)); 330 343 fstrcpy(name, hostname); … … 334 347 ip_list = lookup_byname_backend(name, &count); 335 348 336 if (!ip_list) 337 return NSS_STATUS_NOTFOUND; 349 if (!ip_list) { 350 nss_status = NSS_STATUS_NOTFOUND; 351 goto out; 352 } 338 353 339 354 /* Copy h_name */ … … 343 358 if ((he->h_name = get_static(&buffer, &buflen, namelen)) == NULL) { 344 359 free(ip_list); 345 return NSS_STATUS_TRYAGAIN; 360 nss_status = NSS_STATUS_TRYAGAIN; 361 goto out; 346 362 } 347 363 … … 355 371 if (get_static(&buffer, &buflen, i) == NULL) { 356 372 free(ip_list); 357 return NSS_STATUS_TRYAGAIN; 373 nss_status = NSS_STATUS_TRYAGAIN; 374 goto out; 358 375 } 359 376 … … 361 378 &buffer, &buflen, (count + 1) * sizeof(char *))) == NULL) { 362 379 free(ip_list); 363 return NSS_STATUS_TRYAGAIN; 380 nss_status = NSS_STATUS_TRYAGAIN; 381 goto out; 364 382 } 365 383 … … 368 386 INADDRSZ)) == NULL) { 369 387 free(ip_list); 370 return NSS_STATUS_TRYAGAIN; 388 nss_status = NSS_STATUS_TRYAGAIN; 389 goto out; 371 390 } 372 391 memcpy(he->h_addr_list[i], &ip_list[i], INADDRSZ); … … 387 406 i = sizeof(char*) - i; 388 407 389 if (get_static(&buffer, &buflen, i) == NULL) 390 return NSS_STATUS_TRYAGAIN; 408 if (get_static(&buffer, &buflen, i) == NULL) { 409 nss_status = NSS_STATUS_TRYAGAIN; 410 goto out; 411 } 391 412 392 413 if ((he->h_aliases = (char **)get_static( 393 &buffer, &buflen, sizeof(char *))) == NULL) 394 return NSS_STATUS_TRYAGAIN; 414 &buffer, &buflen, sizeof(char *))) == NULL) { 415 nss_status = NSS_STATUS_TRYAGAIN; 416 goto out; 417 } 395 418 396 419 he->h_aliases[0] = NULL; 397 420 398 return NSS_STATUS_SUCCESS; 421 nss_status = NSS_STATUS_SUCCESS; 422 423 out: 424 425 #if HAVE_PTHREAD 426 pthread_mutex_unlock(&wins_nss_mutex); 427 #endif 428 return nss_status; 399 429 } 400 430 … … 404 434 char *buffer, size_t buflen, int *h_errnop) 405 435 { 436 NSS_STATUS nss_status; 437 406 438 if(af!=AF_INET) { 407 439 *h_errnop = NO_DATA; 408 return NSS_STATUS_UNAVAIL; 409 } 410 411 return _nss_wins_gethostbyname_r( 412 name, he, buffer, buflen, h_errnop); 413 } 414 #endif 440 nss_status = NSS_STATUS_UNAVAIL; 441 } else { 442 nss_status = _nss_wins_gethostbyname_r( 443 name, he, buffer, buflen, h_errnop); 444 } 445 return nss_status; 446 } 447 #endif
Note:
See TracChangeset
for help on using the changeset viewer.