auth: Fix build warning.
authorGünther Deschner <gd@samba.org>
Mon, 25 Aug 2008 09:36:56 +0000 (11:36 +0200)
committerGünther Deschner <gd@samba.org>
Thu, 30 Oct 2008 14:01:05 +0000 (15:01 +0100)
Guenther
(cherry picked from commit 4661ef625a6522d6f859b83e3e3702f01d0b952f)
(cherry picked from commit 60649a74cdf2594bc89c301025f86d23caba91c2)

source/auth/pampass.c

index ba11d2e8fc2b52b747831746849a96d23472e625..a1455e64a29a55fa1d33575bc88461aa81b5fde0 100644 (file)
@@ -60,6 +60,7 @@ typedef int (*smb_pam_conv_fn)(int, const struct pam_message **, struct pam_resp
  *  Macros to help make life easy
  */
 #define COPY_STRING(s) (s) ? SMB_STRDUP(s) : NULL
+#define COPY_FSTRING(s) (s[0]) ? SMB_STRDUP(s) : NULL
 
 /*******************************************************************
  PAM error handler.
@@ -317,7 +318,7 @@ static int smb_pam_passchange_conv(int num_msg,
                                        DEBUG(100,("smb_pam_passchange_conv: PAM_PROMPT_ECHO_ON: We actualy sent: %s\n", current_reply));
 #endif
                                        reply[replies].resp_retcode = PAM_SUCCESS;
-                                       reply[replies].resp = COPY_STRING(current_reply);
+                                       reply[replies].resp = COPY_FSTRING(current_reply);
                                        found = True;
                                        break;
                                }
@@ -345,7 +346,7 @@ static int smb_pam_passchange_conv(int num_msg,
                                        DEBUG(10,("smb_pam_passchange_conv: PAM_PROMPT_ECHO_OFF: We sent: %s\n", current_reply));
                                        pwd_sub(current_reply, udp->PAM_username, udp->PAM_password, udp->PAM_newpassword);
                                        reply[replies].resp_retcode = PAM_SUCCESS;
-                                       reply[replies].resp = COPY_STRING(current_reply);
+                                       reply[replies].resp = COPY_FSTRING(current_reply);
 #ifdef DEBUG_PASSWORD
                                        DEBUG(100,("smb_pam_passchange_conv: PAM_PROMPT_ECHO_OFF: We actualy sent: %s\n", current_reply));
 #endif