dpward / rpms / sssd

Forked from rpms/sssd 3 years ago
Clone

Blame SOURCES/0032-pack_message_v3-allow-empty-name.patch

6cf099
From 1b9a3d516341560ccf8b5f9fab0886f3d05defce Mon Sep 17 00:00:00 2001
6cf099
From: Sumit Bose <sbose@redhat.com>
6cf099
Date: Fri, 26 Jun 2015 14:45:21 +0200
6cf099
Subject: [PATCH 32/37] pack_message_v3: allow empty name
6cf099
6cf099
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
6cf099
---
6cf099
 src/sss_client/pam_message.c | 7 ++++---
6cf099
 1 file changed, 4 insertions(+), 3 deletions(-)
6cf099
6cf099
diff --git a/src/sss_client/pam_message.c b/src/sss_client/pam_message.c
6cf099
index b8104c680d0e733b713c665e6206dc4b0d379237..b239f6f53da54054c52e484bdd076193709cb003 100644
6cf099
--- a/src/sss_client/pam_message.c
6cf099
+++ b/src/sss_client/pam_message.c
6cf099
@@ -107,9 +107,10 @@ int pack_message_v3(struct pam_items *pi, size_t *size, uint8_t **buffer)
6cf099
     uint8_t *buf;
6cf099
     size_t rp;
6cf099
 
6cf099
-    len = sizeof(uint32_t) +
6cf099
-          2*sizeof(uint32_t) + pi->pam_user_size +
6cf099
-          sizeof(uint32_t);
6cf099
+    len = sizeof(uint32_t) + sizeof(uint32_t);
6cf099
+
6cf099
+    len +=  *pi->pam_user != '\0' ?
6cf099
+                2*sizeof(uint32_t) + pi->pam_user_size : 0;
6cf099
     len += *pi->pam_service != '\0' ?
6cf099
                 2*sizeof(uint32_t) + pi->pam_service_size : 0;
6cf099
     len += *pi->pam_tty != '\0' ?
6cf099
-- 
6cf099
2.4.3
6cf099