diff src/noffle.c @ 391:6cb66f5a0479 noffle

[svn] * docs/noffle.1,src/configure.h,src/configfile.c,src/noffle.c: Add optional "auth" parameter to '--server' option. This turns on client authorisation regardless of the setting of authenticate-client. Useful if you want the same Noffle to authenticate or not depending on what/how it gets invoked.
author bears
date Fri, 23 May 2003 10:33:10 +0100
parents 2ad4c1c97734
children b540ecb6f218
line wrap: on
line diff
--- a/src/noffle.c	Thu May 22 10:04:38 2003 +0100
+++ b/src/noffle.c	Fri May 23 10:33:10 2003 +0100
@@ -10,7 +10,7 @@
   received for some seconds (to allow multiple clients connect at the same
   time).
 
-  $Id: noffle.c 532 2003-05-22 09:04:38Z bears $
+  $Id: noffle.c 533 2003-05-23 09:33:10Z bears $
 */
 
 #if HAVE_CONFIG_H
@@ -574,7 +574,7 @@
       " -p | --post                      Post article on stdin\n"
       " -q | --query groups [server]     Get group list from server\n"
       " -q | --query desc [server]       Get group descriptions from server\n"
-      " -r | --server                    Run as server on stdin/stdout\n"
+      " -r | --server [auth]             Run as server on stdin/stdout\n"
       " -R | --requested                 List articles marked for download\n"
       " -s | --subscribe-over <grp>      Add group to fetch list (overview)\n"
       " -S | --subscribe-full <grp>      Add group to fetch list (full)\n"
@@ -1039,7 +1039,22 @@
         }
         break;
     case 'r':
-        Log_inf( "Starting as server" );
+	if ( *argv != NULL )
+	{
+	    if ( strcmp( *argv, "auth" ) != 0 )
+	    {
+                fprintf( stderr, "Unknown argument -r %s\n", *argv );
+                result = EXIT_FAILURE;
+		break;
+	    }
+
+	    Cfg_setClientAuth( TRUE );
+	    p = ", authentication enabled from command line";
+	}
+	else
+	    p = "";
+
+	Log_inf( "Starting as server%s", p );
         Server_run();
         break;
     case 'R':