From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: util-linux-owner@vger.kernel.org Received: from mail-ia0-f178.google.com ([209.85.210.178]:41322 "EHLO mail-ia0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752013Ab3AMJMz (ORCPT ); Sun, 13 Jan 2013 04:12:55 -0500 Received: by mail-ia0-f178.google.com with SMTP id k25so2852664iah.9 for ; Sun, 13 Jan 2013 01:12:54 -0800 (PST) From: Cody Maloney To: util-linux@vger.kernel.org Cc: mitr@redhat.com, Cody Maloney Subject: [PATCH v2 1/4] chsh-chfn: Add flag for enabling/disabling libuser support. Date: Sun, 13 Jan 2013 02:12:21 -0700 Message-Id: <1358068345-773-2-git-send-email-cmaloney@theoreticalchaos.com> In-Reply-To: <1358068345-773-1-git-send-email-cmaloney@theoreticalchaos.com> References: <1358068345-773-1-git-send-email-cmaloney@theoreticalchaos.com> Sender: util-linux-owner@vger.kernel.org List-ID: Signed-off-by: Cody Maloney --- configure.ac | 17 +++++++++++++++++ login-utils/Makemodule.am | 5 +++++ 2 files changed, 22 insertions(+) diff --git a/configure.ac b/configure.ac index e937736..dd846cb 100644 --- a/configure.ac +++ b/configure.ac @@ -1100,6 +1100,23 @@ AS_HELP_STRING([--disable-chsh-only-listed], [chsh: allow shells not in /etc/she [], enable_chsh_only_listed=yes ) +AC_ARG_WITH([libuser], AS_HELP_STRING([--without-libuser], [compile without libuser (remote chsh)]), + [], with_user=auto +) + +if test "x$with_user" = xno; then + AM_CONDITIONAL(HAVE_USER, false) +else + PKG_CHECK_MODULES(LIBUSER,[libuser >= 0.58]) + UL_CHECK_LIB(user, lu_start) + case "$with_user:$have_user" in + yes:no) + AC_MSG_ERROR([user selected but libuser not found]) + ;; + esac +fi + + if test "x$enable_chsh_only_listed" = xyes; then AC_DEFINE(ONLY_LISTED_SHELLS, 1, [Should chsh allow only shells in /etc/shells?]) fi diff --git a/login-utils/Makemodule.am b/login-utils/Makemodule.am index aef8177..479b87b 100644 --- a/login-utils/Makemodule.am +++ b/login-utils/Makemodule.am @@ -68,6 +68,11 @@ chfn_chsh_cflags = $(SUID_CFLAGS) $(AM_CFLAGS) chfn_chsh_ldflags = $(SUID_LDFLAGS) $(AM_LDFLAGS) chfn_chsh_ldadd = libcommon.la -lpam -lpam_misc +if HAVE_USER +chfn_chsh_ldflags += $(LIBUSER_LIBS) +chfn_chsh_cflags += $(LIBUSER_CFLAGS) +endif + if HAVE_SELINUX chfn_chsh_sources += \ login-utils/selinux_utils.c \ -- 1.8.1