]> granicus.if.org Git - linux-pam/commitdiff
Relevant BUGIDs: 476938
authorAndrew G. Morgan <morgan@kernel.org>
Mon, 12 Nov 2001 07:20:39 +0000 (07:20 +0000)
committerAndrew G. Morgan <morgan@kernel.org>
Mon, 12 Nov 2001 07:20:39 +0000 (07:20 +0000)
Purpose of commit: cleanup

Commit summary:
---------------
removed a compiler warning (courtesy Nalin) and added a memory leak comment.

CHANGELOG
modules/pam_motd/pam_motd.c

index 7ab5df55da5cf38de26fe864501fbbc6f250bf92..89d9989a6f17cceb9965c00eb27c50fb383692a6 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -49,6 +49,7 @@ bug report - outstanding bugs are listed here:
 0.76: please submit patches for this section with actual code/doc
       patches!
 
+* pam_motd: Nalin fixed compiler warning. (Bug 476938 - agmorgan)
 * pam_pwdb: Solar Designer pointed out that there was a problem with
   the compatibility support for md5 password hashing. (Bug 460717,
   476961 - agmorgan)
index 98976b66463895a6035e488f63fc416972b6840b..759cc017047703950c15d49bc73eb3db969f9702 100644 (file)
@@ -10,6 +10,8 @@
  *
  */
 
+#include <security/_pam_aconf.h>
+
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -47,7 +49,8 @@ int pam_sm_open_session(pam_handle_t *pamh, int flags, int argc,
 {
      int retval = PAM_IGNORE;
      int fd;
-     char *mtmp=NULL, *motd_path=NULL;
+     char *mtmp=NULL;
+     const char *motd_path=NULL;
      struct pam_conv *conversation;
      struct pam_message message;
      struct pam_message *pmessage = &message;
@@ -60,9 +63,10 @@ int pam_sm_open_session(pam_handle_t *pamh, int flags, int argc,
 
     for (; argc-- > 0; ++argv) {
         if (!strncmp(*argv,"motd=",5)) {
+
             motd_path = (char *) strdup(5+*argv);
             if (motd_path != NULL) {
-                D(("set motd path: %s", motd_path));
+                D(("set motd path: %s (and a memory leak)", motd_path));
             } else {
                 D(("failed to duplicate motd path - ignored"));
             }