From dm@home.dinoex.sub.org  Sat Mar  4 23:18:30 2000
Return-Path: <dm@home.dinoex.sub.org>
Received: from mail.dinoex.sub.org (mail.dinoex.sub.de [195.243.29.14])
	by hub.freebsd.org (Postfix) with ESMTP id EB64F37B980
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  4 Mar 2000 23:18:28 -0800 (PST)
	(envelope-from dm@home.dinoex.sub.org)
Received: (from uucp@localhost)
	by mail.dinoex.sub.org (8.9.3/8.9.3) with UUCP id IAA17953
	for FreeBSD-gnats-submit@freebsd.org; Sun, 5 Mar 2000 08:18:28 +0100 (CET)
Received: (from uucp@localhost)
	by net2.dinoex.sub.org (8.9.3/8.9.3) with UUCP id HAA07496
	for FreeBSD-gnats-submit@freebsd.org; Sun, 5 Mar 2000 07:32:44 +0100 (CET)
Received: (from dm@localhost)
	by home.dinoex.sub.org (8.9.3/8.9.3) id GAA69253;
	Sun, 5 Mar 2000 06:30:09 +0100 (CET)
Message-Id: <200003050530.GAA69253@home.dinoex.sub.org>
Date: Sun, 5 Mar 2000 06:30:09 +0100 (CET)
From: dirk.meyer@dinoex.sub.org
Sender: dm@home.dinoex.sub.org
Reply-To: dirk.meyer@dinoex.sub.org
To: FreeBSD-gnats-submit@freebsd.org
Subject: uucp grade patch and policy
X-Send-Pr-Version: 3.2

>Number:         17202
>Category:       gnu
>Synopsis:       uucp grade patch and policy
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Mar  4 23:20:02 PST 2000
>Closed-Date:    Fri Nov 23 00:58:26 PST 2001
>Last-Modified:  Fri Nov 23 00:58:55 PST 2001
>Originator:     Dirk Meyer
>Release:        FreeBSD 3.4-STABLE i386
>Organization:
privat
>Environment:

	Taylor UUCP

>Description:

	1) The Grade patch is now common in use
	so it seem to make sense to include it
	in teh base distribution.

	2) As we allow the Logfiles to rotate
	we sould allow UUCP to close it in time.

>How-To-Repeat:


>Fix:
	add the features by this patches:

*** gnu/libexec/uucp/common_sources/policy.h	Fri Sep  1 08:01:38 1995
--- gnu/libexec/uucp/common_sources/policy.h.neu	Tue Apr 15 05:24:44 1997
***************
*** 566,572 ****
     exist when a new message is written out, it will be created.
     Setting CLOSE_LOGFILES to 1 will obviously require slightly more
     processing time.  */
! #define CLOSE_LOGFILES 0
  
  /* The name of the default spool directory.  If HAVE_TAYLOR_CONFIG is
     set to 1, this may be overridden by the ``spool'' command in the
--- 566,572 ----
     exist when a new message is written out, it will be created.
     Setting CLOSE_LOGFILES to 1 will obviously require slightly more
     processing time.  */
! #define CLOSE_LOGFILES 1
  
  /* The name of the default spool directory.  If HAVE_TAYLOR_CONFIG is
     set to 1, this may be overridden by the ``spool'' command in the
--- gnu/libexec/uucp/uucico/uucico.c.orig	Mon Aug 21 13:28:23 1995
+++ gnu/libexec/uucp/uucico/uucico.c	Mon Feb 22 21:04:40 1999
@@ -126,6 +126,9 @@
   struct sconnection *qconn;
 };
 
+/* min. grade set on commandline */
+static char cmdlgrade = '\0';
+
 /* Local functions.  */
 
 static void uusage P((void));
@@ -176,6 +179,7 @@
   { "nodetach", no_argument, NULL, 'D' },
   { "loop", no_argument, NULL, 'e' },
   { "force", no_argument, NULL, 'f'},
+  { "grade", required_argument, NULL, 'g'},
   { "stdin", required_argument, NULL, 'i' },
   { "prompt", no_argument, NULL, 'l' },
   { "port", required_argument, NULL, 'p' },
@@ -250,9 +254,9 @@
     ++zProgram;
 
 #if COHERENT_C_OPTION
-  zopts = "c:CDefi:I:lp:qr:s:S:u:x:X:vwz";
+  zopts = "c:CDefg:i:I:lp:qr:s:S:u:x:X:vwz";
 #else
-  zopts = "cCDefi:I:lp:qr:s:S:u:x:X:vwz";
+  zopts = "cCDefg:i:I:lp:qr:s:S:u:x:X:vwz";
 #endif
 
   while ((iopt = getopt_long (argc, argv, zopts,
@@ -293,6 +297,14 @@
 	     failed call.  */
 	  fforce = TRUE;
 	  break;
+	
+	case 'g':
+	  /* Force a grade */
+	  if (isalpha(optarg[0]))
+	     cmdlgrade = optarg[0];
+	  else
+	     fprintf (stderr, "%s: invalid grade \n", zProgram);
+	  break;
 
 	case 'i':
 	  /* Type of port to use for standard input.  Only TLI is
@@ -794,6 +806,7 @@
   printf ("Usage: %s [options]\n", zProgram);
   printf (" -s,-S,--system system: Call system (-S implies -f)\n");
   printf (" -f,--force: Force call despite system status\n");
+  printf (" -g,--grade: limit outgoing call to a given grade\n");
   printf (" -r state: 1 for master, 0 for slave (default)\n");
   printf (" --master: Act as master\n");
   printf (" --slave: Act as slave (default)\n");
@@ -940,6 +953,9 @@
       if (! qsys->uuconf_fcall || qsys->uuconf_qtimegrade == NULL)
 	continue;
 
+      if (qport && strcmp (qsys->uuconf_zport,qport->uuconf_zname))
+       continue;
+
       fnevertime = FALSE;
 
       /* Make sure this is a legal time to call.  */
@@ -1331,12 +1347,18 @@
     boolean fret;
 
     /* Determine the grade we should request of the other system.  A
-       '\0' means that no restrictions have been made.  */
-    if (! ftimespan_match (qsys->uuconf_qcalltimegrade, &ival,
-			   (int *) NULL))
-      bgrade = '\0';
+       '\0' means that no restrictions have been made.
+       If a grade is set on the command line, the calltimegrade-value
+       is overwritten.  */
+       
+    if (cmdlgrade != '\0')
+      bgrade = cmdlgrade;
     else
-      bgrade = (char) ival;
+      if (! ftimespan_match (qsys->uuconf_qcalltimegrade, &ival,
+			   (int *) NULL))
+         bgrade = '\0';
+      else
+         bgrade = (char) ival;
 
     /* Determine the name we will call ourselves.  */
     if (qsys->uuconf_zlocalname != NULL)

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: dinoex 
State-Changed-When: Fri Nov 23 00:58:26 PST 2001 
State-Changed-Why:  
Committed in the ports version. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=17202 
>Unformatted:
