+ bool ret = true;
+
+ if (Conf_SSLOptions.KeyFile) {
+ printf( " SSLKeyFile = %s\n", Conf_SSLOptions.KeyFile);
+ ret = can_open("SSLKeyFile", Conf_SSLOptions.KeyFile);
+ }
+ if (Conf_SSLOptions.CertFile) {
+ printf( " SSLCertFile = %s\n", Conf_SSLOptions.CertFile);
+ if (!can_open("SSLCertFile", Conf_SSLOptions.CertFile))
+ ret = false;
+ }
+ if (Conf_SSLOptions.DHFile) {
+ printf( " SSLDHFile = %s\n", Conf_SSLOptions.DHFile);
+ if (!can_open("SSLDHFile", Conf_SSLOptions.DHFile))
+ ret = false;
+ }
+ if (array_bytes(&Conf_SSLOptions.KeyFilePassword))
+ puts(" SSLKeyFilePassword = <secret>" );
+ array_free_wipe(&Conf_SSLOptions.KeyFilePassword);
+
+ return ret;
+}
+#endif
+
+static char *
+strdup_warn(const char *str)
+{
+ char *ptr = strdup(str);
+ if (!ptr)
+ Config_Error(LOG_ERR, "Could not allocate mem for string: %s", str);
+ return ptr;
+}
+
+
+static void
+ports_puts(array *a)
+{
+ size_t len;
+ UINT16 *ports;
+ len = array_length(a, sizeof(UINT16));
+ if (len--) {
+ ports = (UINT16*) array_start(a);
+ printf("%u", (unsigned int) *ports);
+ while (len--) {
+ ports++;
+ printf(", %u", (unsigned int) *ports);
+ }
+ }
+ putc('\n', stdout);
+}
+
+
+static void
+ports_parse(array *a, int Line, char *Arg)
+{
+ char *ptr;
+ int port;
+ UINT16 port16;
+
+ array_trunc(a);
+
+ /* Ports on that the server should listen. More port numbers
+ * must be separated by "," */
+ ptr = strtok( Arg, "," );
+ while (ptr) {
+ ngt_TrimStr(ptr);
+ port = atoi(ptr);
+ if (port > 0 && port < 0xFFFF) {
+ port16 = (UINT16) port;
+ if (!array_catb(a, (char*)&port16, sizeof port16))
+ Config_Error(LOG_ERR, "%s, line %d Could not add port number %ld: %s",
+ NGIRCd_ConfFile, Line, port, strerror(errno));
+ } else {
+ Config_Error( LOG_ERR, "%s, line %d (section \"Global\"): Illegal port number %ld!",
+ NGIRCd_ConfFile, Line, port );
+ }
+
+ ptr = strtok( NULL, "," );
+ }
+}
+
+
+GLOBAL void
+Conf_Init( void )
+{
+ Read_Config( true );
+ Validate_Config(false, false);