Ignore:
Timestamp:
Nov 25, 2016, 8:04:54 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to version 4.4.7

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/lib/substitute.c

    r988 r989  
    500500                case 'G' : {
    501501                        struct passwd *pass;
     502                        bool is_domain_name = false;
     503                        const char *sep = lp_winbind_separator();
    502504
    503505                        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)) {
    506508                                r = talloc_asprintf(tmp_ctx,
    507509                                                    "%s%c%s",
    508510                                                    domain_name,
    509                                                     *lp_winbind_separator(),
     511                                                    *sep,
    510512                                                    smb_name);
     513                                is_domain_name = true;
    511514                        } else {
    512515                                r = talloc_strdup(tmp_ctx, smb_name);
     
    518521                        pass = Get_Pwnam_alloc(tmp_ctx, r);
    519522                        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);
    523535                        }
    524536                        TALLOC_FREE(pass);
Note: See TracChangeset for help on using the changeset viewer.