From: Damien Miller Date: Tue, 16 Aug 2016 03:30:56 +0000 (+1000) Subject: add --with-pam-service to specify PAM service name X-Git-Tag: V_7_4_P1~156 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8bd81e1596ab1bab355146cb65e82fb96ade3b23;p=thirdparty%2Fopenssh-portable.git add --with-pam-service to specify PAM service name Saves messing around with CFLAGS to do it. --- diff --git a/auth-pam.c b/auth-pam.c index 348fe370a..7a14c89f4 100644 --- a/auth-pam.c +++ b/auth-pam.c @@ -66,6 +66,11 @@ #include #endif +#if !defined(SSHD_PAM_SERVICE) +extern char *__progname; +# define SSHD_PAM_SERVICE __progname +#endif + /* OpenGroup RFC86.0 and XSSO specify no "const" on arguments */ #ifdef PAM_SUN_CODEBASE # define sshpam_const /* Solaris, HP-UX, SunOS */ @@ -615,7 +620,6 @@ sshpam_cleanup(void) static int sshpam_init(Authctxt *authctxt) { - extern char *__progname; const char *pam_rhost, *pam_user, *user = authctxt->user; const char **ptr_pam_user = &pam_user; struct ssh *ssh = active_state; /* XXX */ diff --git a/auth-pam.h b/auth-pam.h index 2e9a0c0a3..58a257a48 100644 --- a/auth-pam.h +++ b/auth-pam.h @@ -27,10 +27,6 @@ #include "includes.h" #ifdef USE_PAM -#if !defined(SSHD_PAM_SERVICE) -# define SSHD_PAM_SERVICE __progname -#endif - void start_pam(Authctxt *); void finish_pam(void); u_int do_pam_account(void); diff --git a/configure.ac b/configure.ac index e08374755..1f1941a15 100644 --- a/configure.ac +++ b/configure.ac @@ -3047,6 +3047,17 @@ AC_ARG_WITH([pam], ] ) +AC_ARG_WITH([pam-service], + [ --with-pam-service=name Specify PAM service name ], + [ + if test "x$withval" != "xno" && \ + test "x$withval" != "xyes" ; then + AC_DEFINE_UNQUOTED([SSHD_PAM_SERVICE], + ["$withval"], [sshd PAM service name]) + fi + ] +) + # Check for older PAM if test "x$PAM_MSG" = "xyes" ; then # Check PAM strerror arguments (old PAM)