diff options
author | Andrew G. Morgan <morgan@kernel.org> | 2001-11-12 07:20:39 +0000 |
---|---|---|
committer | Andrew G. Morgan <morgan@kernel.org> | 2001-11-12 07:20:39 +0000 |
commit | 6c581ef8dbe547cbc2276355803de4bcddee1f42 (patch) | |
tree | 94f1ea08f4665aff837af558df60556e5903df66 /modules/pam_motd | |
parent | 6616ed2d983c6f27d5cb58d9ef02c15329178542 (diff) | |
download | pam-6c581ef8dbe547cbc2276355803de4bcddee1f42.tar.gz pam-6c581ef8dbe547cbc2276355803de4bcddee1f42.tar.bz2 pam-6c581ef8dbe547cbc2276355803de4bcddee1f42.zip |
Relevant BUGIDs: 476938
Purpose of commit: cleanup
Commit summary:
---------------
removed a compiler warning (courtesy Nalin) and added a memory leak comment.
Diffstat (limited to 'modules/pam_motd')
-rw-r--r-- | modules/pam_motd/pam_motd.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/pam_motd/pam_motd.c b/modules/pam_motd/pam_motd.c index 98976b66..759cc017 100644 --- a/modules/pam_motd/pam_motd.c +++ b/modules/pam_motd/pam_motd.c @@ -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")); } |