summaryrefslogtreecommitdiff
path: root/nsswitch
diff options
context:
space:
mode:
authorBo Yang <boyang@samba.org>2010-02-07 14:45:42 +0800
committerKarolin Seeger <kseeger@samba.org>2010-02-15 14:46:51 +0100
commit4d8fb15892a5a08714f6772167a9433362865653 (patch)
tree7810b038d0a67c373d229980da814885307a3ba1 /nsswitch
parent91a38a7fe36b899625d21654857f93a8f3fbf7d3 (diff)
downloadsamba-4d8fb15892a5a08714f6772167a9433362865653.tar.gz
s3: Fix malformed require_membership_of_sid.
Signed-off-by: Bo Yang <boyang@samba.org> (cherry picked from commit 913a9f4e420c7a4177e6a7874e8ec2703f447918) Fix bug #7106. (cherry picked from commit 7e965f545b6f4d5f1ad12f4177eb477248c895c8)
Diffstat (limited to 'nsswitch')
-rw-r--r--nsswitch/pam_winbind.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/nsswitch/pam_winbind.c b/nsswitch/pam_winbind.c
index ec05f756975..b411eb7f77b 100644
--- a/nsswitch/pam_winbind.c
+++ b/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;