summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBo Yang <boyang@samba.org>2010-02-07 15:04:51 +0800
committerKarolin Seeger <kseeger@samba.org>2010-02-24 16:25:09 +0100
commit04dd168aa9a2907e6109e0b1fef428d09d44da53 (patch)
treeb4c0f8847a7f687367570aacab61a6051e0df503
parent98e8e6a58fe6f1fa1444ad89c06aa0d99a5639be (diff)
downloadsamba-04dd168aa9a2907e6109e0b1fef428d09d44da53.tar.gz
samba-04dd168aa9a2907e6109e0b1fef428d09d44da53.tar.xz
samba-04dd168aa9a2907e6109e0b1fef428d09d44da53.zip
s3: Fix malformed require_membership_of_sid.
Signed-off-by: Bo Yang <boyang@samba.org> Fix bug #7106. (cherry picked from commit 0ee0ba83dcd9726244b07c1747e0676a74e1d82f)
-rw-r--r--source/nsswitch/pam_winbind.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/nsswitch/pam_winbind.c b/source/nsswitch/pam_winbind.c
index 74540817af0..5dccba1d310 100644
--- a/source/nsswitch/pam_winbind.c
+++ b/source/nsswitch/pam_winbind.c
@@ -1036,6 +1036,7 @@ static bool winbind_name_list_to_sid_string_list(struct pwb_context *ctx,
char *current_name = NULL;
const char *search_location;
const char *comma;
+ int len;
if (sid_list_buffer_size > 0) {
sid_list_buffer[0] = 0;
@@ -1091,6 +1092,17 @@ static bool winbind_name_list_to_sid_string_list(struct pwb_context *ctx,
_make_remark_format(ctx, PAM_TEXT_INFO, _("Cannot convert group %s "
"to sid, please contact your administrator to see "
"if group %s is valid."), search_location, search_location);
+ /*
+ * The lookup of the last name failed..
+ * It results in require_member_of_sid ends with ','
+ * It is malformated parameter here, overwrite the last ','.
+ */
+ len = strlen(sid_list_buffer);
+ if (len) {
+ if (sid_list_buffer[len - 1] == ',') {
+ sid_list_buffer[len - 1] = '\0';
+ }
+ }
}
result = true;