]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/pam.c
Add PAMServiceName setting to specify the used PAM configuration
[ngircd-alex.git] / src / ngircd / pam.c
index dd15052f008539ca4780d7d2a21dfb35b6e4cee1..4e47ddb16d8d8be0eaa3b0ccddb6e411e1837960 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2010 Alexander Barton (alex@barton.de).
+ * Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  */
 
 #include <assert.h>
-
-#include "defines.h"
-#include "log.h"
-#include "conn.h"
-#include "client.h"
-
 #include <stdlib.h>
 #include <string.h>
-
 #ifdef HAVE_SECURITY_PAM_APPL_H
-#include <security/pam_appl.h>
+# include <security/pam_appl.h>
 #endif
-
 #ifdef HAVE_PAM_PAM_APPL_H
-#include <pam/pam_appl.h>
+# include <pam/pam_appl.h>
 #endif
 
+#include "defines.h"
+#include "log.h"
+#include "conn.h"
+#include "client.h"
+#include "conf.h"
+
 #include "pam.h"
 
 static char *password;
@@ -104,7 +102,7 @@ PAM_Authenticate(CLIENT *Client) {
        conv.appdata_ptr = Conn_Password(Client_Conn(Client));
 
        /* Initialize PAM */
-       retval = pam_start("ngircd", Client_OrigUser(Client), &conv, &pam);
+       retval = pam_start(Conf_PAMServiceName, Client_OrigUser(Client), &conv, &pam);
        if (retval != PAM_SUCCESS) {
                Log(LOG_ERR, "PAM: Failed to create authenticator! (%d)", retval);
                return false;