]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/conf.c
Add PAMServiceName setting to specify the used PAM configuration
[ngircd-alex.git] / src / ngircd / conf.c
index 62b5044c87be0daa7569846c6d07d42f1bf67417..01ec3c09510ae18324900d4fd3651ea63865b401 100644 (file)
@@ -364,7 +364,7 @@ Conf_Test( void )
                       ? (const char*) array_start(&Conf_Motd) : "");
        }
        printf("  Network = %s\n", Conf_Network);
-       if (!Conf_PAM) 
+       if (!Conf_PAM)
                printf("  Password = %s\n", Conf_ServerPwd);
        printf("  PidFile = %s\n", Conf_PidFile);
        printf("  Ports = ");
@@ -419,6 +419,7 @@ Conf_Test( void )
 #ifdef PAM
        printf("  PAM = %s\n", yesno_to_str(Conf_PAM));
        printf("  PAMIsOptional = %s\n", yesno_to_str(Conf_PAMIsOptional));
+       printf("  PAMServiceName = %s\n", Conf_PAMServiceName);
 #endif
 #ifndef STRICT_RFC
        printf("  RequireAuthPing = %s\n", yesno_to_str(Conf_AuthPing));
@@ -807,6 +808,7 @@ Set_Defaults(bool InitServers)
        Conf_PAM = false;
 #endif
        Conf_PAMIsOptional = false;
+       strcpy(Conf_PAMServiceName, "ngircd");
        Conf_ScrubCTCP = false;
 #ifdef SYSLOG
 #ifdef LOG_LOCAL5
@@ -1833,6 +1835,12 @@ Handle_OPTIONS(const char *File, int Line, char *Var, char *Arg)
                Conf_PAMIsOptional = Check_ArgIsTrue(Arg);
                return;
        }
+       if (strcasecmp(Var, "PAMServiceName") == 0) {
+               len = strlcpy(Conf_PAMServiceName, Arg, sizeof(Conf_PAMServiceName));
+               if (len >= sizeof(Conf_PAMServiceName))
+                       Config_Error_TooLong(File, Line, Var);
+               return;
+       }
        if (strcasecmp(Var, "PredefChannelsOnly") == 0) {
                /*
                 * TODO: This section and support for "PredefChannelsOnly"