]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
add --with-pam-service to specify PAM service name
authorDamien Miller <djm@mindrot.org>
Tue, 16 Aug 2016 03:30:56 +0000 (13:30 +1000)
committerDamien Miller <djm@mindrot.org>
Tue, 16 Aug 2016 03:37:26 +0000 (13:37 +1000)
Saves messing around with CFLAGS to do it.

auth-pam.c
auth-pam.h
configure.ac

index 348fe370acd777e73ee95302efc910f6bf680713..7a14c89f4c8f7b4e429e9ff14b74aa22613744f1 100644 (file)
 #include <pam/pam_appl.h>
 #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 */
index 2e9a0c0a3816226cca8c1b293bb292bbec951d8a..58a257a48a6906efffbf75d91bd6481aa9927f3f 100644 (file)
 #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);
index e083747557f521785a7f02a0ff702a738a12b7ce..1f1941a15185a344e953f9b49870de7421118fdd 100644 (file)
@@ -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)