]> 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 98a2c1d790f63eadeda6dcd2073046a4407055ec..01ec3c09510ae18324900d4fd3651ea63865b401 100644 (file)
@@ -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));
 #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));
 #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;
        Conf_PAM = false;
 #endif
        Conf_PAMIsOptional = false;
+       strcpy(Conf_PAMServiceName, "ngircd");
        Conf_ScrubCTCP = false;
 #ifdef SYSLOG
 #ifdef LOG_LOCAL5
        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;
        }
                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"
        if (strcasecmp(Var, "PredefChannelsOnly") == 0) {
                /*
                 * TODO: This section and support for "PredefChannelsOnly"