Changeset 989 for vendor/current/source3/lib/substitute.c
- Timestamp:
- Nov 25, 2016, 8:04:54 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/lib/substitute.c
r988 r989 500 500 case 'G' : { 501 501 struct passwd *pass; 502 bool is_domain_name = false; 503 const char *sep = lp_winbind_separator(); 502 504 503 505 if (domain_name != NULL && domain_name[0] != '\0' && 504 !strequal(domain_name, my_sam_name()))505 {506 (lp_security() == SEC_ADS || 507 lp_security() == SEC_DOMAIN)) { 506 508 r = talloc_asprintf(tmp_ctx, 507 509 "%s%c%s", 508 510 domain_name, 509 * lp_winbind_separator(),511 *sep, 510 512 smb_name); 513 is_domain_name = true; 511 514 } else { 512 515 r = talloc_strdup(tmp_ctx, smb_name); … … 518 521 pass = Get_Pwnam_alloc(tmp_ctx, r); 519 522 if (pass != NULL) { 520 a_string = realloc_string_sub( 521 a_string, "%G", 522 gidtoname(pass->pw_gid)); 523 char *group_name; 524 525 group_name = gidtoname(pass->pw_gid); 526 if (is_domain_name) { 527 p = strchr_m(group_name, *sep); 528 if (p != NULL) { 529 group_name = p + 1; 530 } 531 } 532 a_string = realloc_string_sub(a_string, 533 "%G", 534 group_name); 523 535 } 524 536 TALLOC_FREE(pass);
Note:
See TracChangeset
for help on using the changeset viewer.