summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2013-04-16 19:04:40 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2013-04-16 19:04:40 (GMT)
commit99ed51a2dadb4d5ffca77003524cf9b0900966d0 (patch) (side-by-side diff)
tree97f11f4582fbdc4bfd3de7fd80af81a7421f96ec
parentb8a5067f0c6a189998bfb8e64982915303495d66 (diff)
downloadpam-modules-99ed51a2dadb4d5ffca77003524cf9b0900966d0.tar.gz
pam-modules-99ed51a2dadb4d5ffca77003524cf9b0900966d0.tar.bz2
Bugfixes.
* configure.ac: Do not call PM_ENABLE within a conditional. * pam_ldaphome/pam_ldaphome.c (import_public_key): Exit gracefully if keys == NULL.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--configure.ac30
-rw-r--r--pam_ldaphome/pam_ldaphome.c7
2 files changed, 21 insertions, 16 deletions
diff --git a/configure.ac b/configure.ac
index e1e56f2..4e2067a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -100,23 +100,23 @@ PM_ENABLE(regex)
AC_ARG_WITH(mysql,
AC_HELP_STRING([--without-mysql],
[Configure to work without MySQL]),
- [build_mysql=$withval])
+ [want_mysql=$withval])
AC_ARG_WITH(pgsql,
AC_HELP_STRING([--without-pgsql],
[Configure to work without Postgres]),
- [build_pgsql=$withval])
+ [want_pgsql=$withval])
AC_ARG_WITH(postgres,
AC_HELP_STRING([--without-postgres],
[Same as --without-pgsql]),
- [build_pgsql=$withval])
+ [want_pgsql=$withval])
AC_ARG_WITH(sql,
- AC_HELP_STRING([--without-sql],
+ AC_HELP_STRING([--without-sql],
[Do not build SQL dependent modules]),
- [build_mysql=$withval
- build_pgsql=$withval])
+ [want_mysql=$withval
+ want_pgsql=$withval])
-if test "$build_mysql" != no; then
- PM_ENABLE(mysql, [
+PM_ENABLE(mysql, [
+ if test "$want_mysql" != no; then
PM_CHECK_LIB(mysqlclient, mysql_real_connect, "-lm",
[ AC_DEFINE(USE_SQL_MYSQL,1,
[Define this if you are going to use MySQL])
@@ -127,11 +127,12 @@ if test "$build_mysql" != no; then
build_mysql=yes ],
[ test "$build_mysql" = yes && AC_MSG_ERROR([cannot build the requested module pam_mysql, because MySQL libraries are not present])
build_mysql=no ],
- [/usr/lib/mysql /usr/local/lib/mysql])])
-fi
+ [/usr/lib/mysql /usr/local/lib/mysql])
+ fi
+])
-if test "$build_pgsql" != no; then
- PM_ENABLE(pgsql, [
+PM_ENABLE(pgsql, [
+ if test "$want_pgsql" != no; then
PM_CHECK_LIB(pq, PQconnectStart, [],
[ save_CPPFLAGS=$CPPFLAGS
for dir in /usr/local/pgsql/include /usr/pgsql/include
@@ -149,8 +150,9 @@ if test "$build_pgsql" != no; then
build_pgsql=yes ],
[ test "$build_pgsql" = yes && AC_MSG_ERROR([cannot build the requested module pma_pgsql, because PostgreSQL libraries are not present])
build_pgsql=no ],
- [/usr/pgsql/lib /usr/local/pgsql/lib])])
-fi
+ [/usr/pgsql/lib /usr/local/pgsql/lib])
+ fi
+])
AC_SUBST(MYSQLLIBS)
AC_SUBST(PGSQLLIBS)
diff --git a/pam_ldaphome/pam_ldaphome.c b/pam_ldaphome/pam_ldaphome.c
index 83c10c1..b86fa70 100644
--- a/pam_ldaphome/pam_ldaphome.c
+++ b/pam_ldaphome/pam_ldaphome.c
@@ -1337,8 +1337,11 @@ import_public_key(pam_handle_t *pamh, struct passwd *pw, struct gray_env *env)
keys = get_pubkeys(ld, base, filter, attr);
gray_slist_free(&slist);
- retval = store_pubkeys(keys, pw, env);
- argcvz_free(keys);
+ if (keys) {
+ retval = store_pubkeys(keys, pw, env);
+ argcvz_free(keys);
+ } else
+ retval = PAM_SUCCESS;
}
ldap_unbind(ld);
return retval;

Return to:

Send suggestions and report system problems to the System administrator.