summaryrefslogtreecommitdiff
path: root/modules/pam_mail
diff options
context:
space:
mode:
authorThorsten Kukuk <kukuk@thkukuk.de>2005-08-16 12:27:38 +0000
committerThorsten Kukuk <kukuk@thkukuk.de>2005-08-16 12:27:38 +0000
commit23624ea6f78ec8acc167a2491c00998907fc76b1 (patch)
treea57b3caee23a167d442d7d4e0419c4689dfba565 /modules/pam_mail
parent2b5457bbf7352200f7bc77795adbbcfd47550855 (diff)
Relevant BUGIDs: none
Purpose of commit: new feature Commit summary: --------------- Big "automake/autoconf/libtool" commit
Diffstat (limited to 'modules/pam_mail')
-rw-r--r--modules/pam_mail/Makefile15
-rw-r--r--modules/pam_mail/Makefile.am18
-rw-r--r--modules/pam_mail/pam_mail.c19
3 files changed, 28 insertions, 24 deletions
diff --git a/modules/pam_mail/Makefile b/modules/pam_mail/Makefile
deleted file mode 100644
index 93ca429b..00000000
--- a/modules/pam_mail/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-# $Id$
-#
-# This Makefile controls a build process of $(TITLE) module for
-# Linux-PAM. You should not modify this Makefile (unless you know
-# what you are doing!).
-#
-# Created by Andrew Morgan <morgan@linux.kernel.org> 2000/08/27
-#
-
-include ../../Make.Rules
-
-TITLE=pam_mail
-
-include ../Simple.Rules
diff --git a/modules/pam_mail/Makefile.am b/modules/pam_mail/Makefile.am
new file mode 100644
index 00000000..1a0f1bc0
--- /dev/null
+++ b/modules/pam_mail/Makefile.am
@@ -0,0 +1,18 @@
+#
+# Copyright (c) 2005 Thorsten Kukuk <kukuk@suse.de>
+#
+
+CLEANFILES = *~
+
+EXTRA_DIST = README
+
+securelibdir = $(SECUREDIR)
+secureconfdir = $(SCONFIGDIR)
+
+AM_CFLAGS = -I$(top_srcdir)/libpam/include -I$(top_srcdir)/libpamc/include \
+ -I$(top_srcdir)/modules/pammodutil/include/
+AM_LDFLAGS = -avoid-version -module \
+ -L$(top_builddir)/modules/pammodutil -lpammodutil \
+ -L$(top_builddir)/libpam -lpam
+
+securelib_LTLIBRARIES = pam_mail.la
diff --git a/modules/pam_mail/pam_mail.c b/modules/pam_mail/pam_mail.c
index 81dedcea..e0647465 100644
--- a/modules/pam_mail/pam_mail.c
+++ b/modules/pam_mail/pam_mail.c
@@ -75,7 +75,7 @@ static void _log_err(int err, const char *format, ...)
#define PAM_QUIET_MAIL 0x1000
static int _pam_parse(int flags, int argc, const char **argv, char **maildir,
- int *hashcount)
+ size_t *hashcount)
{
int ctrl=0;
@@ -107,8 +107,8 @@ static int _pam_parse(int flags, int argc, const char **argv, char **maildir,
}
} else if (!strncmp(*argv,"hash=",5)) {
char *ep = NULL;
- *hashcount = strtol(*argv+5,&ep,10);
- if (!ep || (*hashcount < 0)) {
+ *hashcount = strtoul(*argv+5,&ep,10);
+ if (!ep) {
*hashcount = 0;
}
} else if (!strcmp(*argv,"close")) {
@@ -171,7 +171,7 @@ static int converse(pam_handle_t *pamh, int ctrl, int nargs
}
static int get_folder(pam_handle_t *pamh, int ctrl,
- char **path_mail, char **folder_p, int hashcount)
+ char **path_mail, char **folder_p, size_t hashcount)
{
int retval;
const char *user, *path;
@@ -228,7 +228,7 @@ static int get_folder(pam_handle_t *pamh, int ctrl,
if (ctrl & PAM_HOME_MAIL) {
sprintf(folder, MAIL_FILE_FORMAT, pwd->pw_dir, "", path);
} else {
- int i;
+ size_t i;
char *hash = malloc(2*hashcount+1);
if (hash) {
@@ -372,9 +372,9 @@ static int _do_mail(pam_handle_t *, int, int, const char **, int);
/* --- authentication functions --- */
-PAM_EXTERN
-int pam_sm_authenticate(pam_handle_t *pamh,int flags,int argc,
- const char **argv)
+PAM_EXTERN int
+pam_sm_authenticate (pam_handle_t *pamh UNUSED, int flags UNUSED,
+ int argc UNUSED, const char **argv UNUSED)
{
return PAM_IGNORE;
}
@@ -412,7 +412,8 @@ int pam_sm_open_session(pam_handle_t *pamh, int flags, int argc,
static int _do_mail(pam_handle_t *pamh, int flags, int argc,
const char **argv, int est)
{
- int retval, ctrl, hashcount;
+ int retval, ctrl;
+ size_t hashcount;
char *path_mail=NULL, *folder;
const char *type;