summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin@redhat.com>2010-04-20 18:16:25 -0400
committerNalin Dahyabhai <nalin@redhat.com>2010-04-20 18:16:25 -0400
commit994cfe894ccd6e0cc616237fa739bac18538da4e (patch)
treee357d462f579591bca28e003668aaf66861e2bc1
parent9b86d577e20347c80908afafad0d1d53cffd2976 (diff)
downloadpam_rps-994cfe894ccd6e0cc616237fa739bac18538da4e.zip
pam_rps-994cfe894ccd6e0cc616237fa739bac18538da4e.tar.gz
pam_rps-994cfe894ccd6e0cc616237fa739bac18538da4e.tar.xz
- a few cleanups
- relicense to simple BSD
-rw-r--r--LICENSE18
-rw-r--r--configure.ac2
-rw-r--r--src/pam_rps.c41
3 files changed, 14 insertions, 47 deletions
diff --git a/LICENSE b/LICENSE
index bbfbfbb..593ebf6 100644
--- a/LICENSE
+++ b/LICENSE
@@ -10,21 +10,3 @@ are met:
3. The name of the author may not be used to endorse or promote
products derived from this software without specific prior
written permission.
-
-ALTERNATIVELY, this product may be distributed under the terms of
-the GNU Public License, in which case the provisions of the GPL are
-required INSTEAD OF the above restrictions. (This clause is
-necessary due to a potential bad interaction between the GPL and
-the restrictions contained in a BSD-style copyright.)
-
-THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/configure.ac b/configure.ac
index 35861ea..ba0d9b4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,7 @@
AC_INIT(pam_rps,0.1)
AM_INIT_AUTOMAKE(foreign)
AC_PROG_LIBTOOL
+AM_MAINTAINER_MODE
AC_CHECK_HEADERS(security/pam_modules.h)
+AC_CONFIG_HEADER(src/config.h)
AC_OUTPUT(Makefile src/Makefile)
diff --git a/src/pam_rps.c b/src/pam_rps.c
index a68c0ab..5a225de 100644
--- a/src/pam_rps.c
+++ b/src/pam_rps.c
@@ -1,8 +1,5 @@
-/******************************************************************************
- * A truly challenge-response module for PAM.
- *
- * Copyright (c) 2003 Red Hat, Inc.
- * Written by Nalin Dahyabhai <nalin@redhat.com>
+/*
+ * Copyright (c) 2003,2010 Red Hat, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -16,34 +13,20 @@
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
- *
- * ALTERNATIVELY, this product may be distributed under the terms of
- * the GNU Public License, in which case the provisions of the GPL are
- * required INSTEAD OF the above restrictions. (This clause is
- * necessary due to a potential bad interaction between the GPL and
- * the restrictions contained in a BSD-style copyright.)
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
- *
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <sys/types.h>
+#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <syslog.h>
#include <unistd.h>
-#include <errno.h>
+
#include <security/pam_modules.h>
#include <security/_pam_macros.h>
#include <security/pam_ext.h>
@@ -91,9 +74,10 @@ pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc, const char **argv)
* Bleichenbacher's attack. */
r = c / 85;
close(fd);
- }
- else /* Something is wrong with /dev/urandom */
+ } else {
+ /* Something is wrong with /dev/urandom */
return PAM_CONV_ERR;
+ }
}
switch (r) {
case 0:
@@ -115,8 +99,7 @@ pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc, const char **argv)
}
ret = pam_prompt(pamh, PAM_PROMPT_ECHO_OFF, &response, "%s: ", prompt_text);
if (ret != PAM_SUCCESS) {
- pam_syslog(pamh, LOG_CRIT,
- "conversation error");
+ pam_syslog(pamh, LOG_CRIT, "conversation error");
return PAM_CONV_ERR;
}
if ((response != NULL) &&