The Samba-Bugzilla – Attachment 868 Details for
Bug 2191
[patch] %G / %g substitution does not correctly work in 'template homedir'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
a possible fix
winbind-groupname.patch (text/plain), 2.64 KB, created by
takeuchi
on 2004-12-26 23:22:06 UTC
(
hide
)
Description:
a possible fix
Filename:
MIME Type:
Creator:
takeuchi
Created:
2004-12-26 23:22:06 UTC
Size:
2.64 KB
patch
obsolete
>diff -uNr samba-3.0.10.orig/source/lib/substitute.c samba-3.0.10/source/lib/substitute.c >--- samba-3.0.10.orig/source/lib/substitute.c 2004-12-15 23:33:12.000000000 +0900 >+++ samba-3.0.10/source/lib/substitute.c 2004-12-27 11:56:54.000000000 +0900 >@@ -607,7 +607,8 @@ > gid_t gid) > { > char *a, *t; >- a = alloc_sub_specified(input_string, username, domain, uid, gid); >+ char *grpname = NULL; >+ a = alloc_sub_specified(input_string, username, domain, uid, gid, grpname); > if (!a) return NULL; > t = talloc_strdup(mem_ctx, a); > SAFE_FREE(a); >@@ -618,7 +619,8 @@ > const char *username, > const char *domain, > uid_t uid, >- gid_t gid) >+ gid_t gid, >+ const char *grpname) > { > char *a_string, *ret_string; > char *b, *p, *s, *t; >@@ -642,14 +644,20 @@ > break; > case 'G' : > if (gid != -1) { >- t = realloc_string_sub(t, "%G", gidtoname(gid)); >+ if (grpname == NULL) >+ t = realloc_string_sub(t, "%G", gidtoname(gid)); >+ else >+ t = realloc_string_sub(t, "%G", grpname); > } else { > t = realloc_string_sub(t, "%G", "NO_GROUP"); > } > break; > case 'g' : > if (gid != -1) { >- t = realloc_string_sub(t, "%g", gidtoname(gid)); >+ if (grpname == NULL) >+ t = realloc_string_sub(t, "%g", gidtoname(gid)); >+ else >+ t = realloc_string_sub(t, "%g", grpname); > } else { > t = realloc_string_sub(t, "%g", "NO_GROUP"); > } >diff -uNr samba-3.0.10.orig/source/nsswitch/winbindd_user.c samba-3.0.10/source/nsswitch/winbindd_user.c >--- samba-3.0.10.orig/source/nsswitch/winbindd_user.c 2004-12-15 23:33:14.000000000 +0900 >+++ samba-3.0.10/source/nsswitch/winbindd_user.c 2004-12-24 17:47:01.000000000 +0900 >@@ -40,6 +40,10 @@ > char *homedir; > char *shell; > fstring sid_string; >+ fstring domainame; >+ fstring grpname; >+ fstring output_grpname; >+ enum SID_NAME_USE type; > > if (!pw || !dom_name || !user_name) > return False; >@@ -79,7 +83,13 @@ > > fstrcpy(current_user_info.domain, dom_name); > >- homedir = alloc_sub_specified(lp_template_homedir(), user_name, dom_name, pw->pw_uid, pw->pw_gid); >+ /* Groupname */ >+ if (!winbindd_lookup_name_by_sid(group_sid, domainame, grpname, &type)) >+ DEBUG(1, ("could not lookup sid\n")); >+ >+ fill_domain_username(output_grpname, dom_name, grpname); >+ >+ homedir = alloc_sub_specified(lp_template_homedir(), user_name, dom_name, pw->pw_uid, pw->pw_gid, output_grpname); > > if (!homedir) > return False; >@@ -88,7 +98,7 @@ > > SAFE_FREE(homedir); > >- shell = alloc_sub_specified(lp_template_shell(), user_name, dom_name, pw->pw_uid, pw->pw_gid); >+ shell = alloc_sub_specified(lp_template_shell(), user_name, dom_name, pw->pw_uid, pw->pw_gid, output_grpname); > > if (!shell) > return False;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 2191
:
868
|
7379
|
9432
|
9477
|
9478
|
9601
|
9602
|
9639
|
9641