OSSP CVS Repository

ossp - Check-in [793]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 793
Date: 2001-Aug-30 11:01:59 (local)
2001-Aug-30 09:01:59 (UTC)
User:thl
Branch:
Comment: implemented and documented [-n hostname] option
Tickets:
Inspections:
Files:
ossp-pkg/lmtp2nntp/lmtp2nntp.c      1.35 -> 1.36     11 inserted, 4 deleted
ossp-pkg/lmtp2nntp/lmtp2nntp.pod      1.10 -> 1.11     8 inserted, 7 deleted

ossp-pkg/lmtp2nntp/lmtp2nntp.c 1.35 -> 1.36

--- lmtp2nntp.c  2001/08/30 08:35:44     1.35
+++ lmtp2nntp.c  2001/08/30 09:01:59     1.36
@@ -53,7 +53,7 @@
 #define ERR_DELIVERY -2
 
 #define STDSTRLEN 128
-#define MAXNEWSSERVICES 3
+#define MAXNEWSSERVICES 16
 
 extern void lmtp_debug_dumplmtp(lmtp_t *lmtp);
 
@@ -130,8 +130,8 @@
      */
     fprintf(stderr, 
             "USAGE: %s "
-            "[-V] [-d deliverymode] [-g groupmode] [-h host[:port]] "
-            "[-m maxmessagesize] [-t tracefile] [-v] newsgroup [newsgroup ...]"
+            "[-V] [-d deliverymode] [-g groupmode] [-h host[:port][,host[:port], ...]] "
+            "[-m maxmessagesize] [-n hostname] [-t tracefile] [-v] newsgroup [newsgroup ...]"
             "\n",
             command);
     return;
@@ -205,7 +205,7 @@
      */
 
     /* read in the arguments */
-    while ((i = getopt(argc, argv, "Vd:g:h:m:t:v")) != -1) {
+    while ((i = getopt(argc, argv, "Vd:g:h:m:n:t:v")) != -1) {
         switch (i) {
             case 'V': /*POD [B<-V>] (version)*/
                 fprintf(stdout, "%s\n", lmtp2nntp_version.v_gnu);
@@ -316,6 +316,13 @@
                         exit(ERR_EXECUTION);
                     }
                 break;
+            case 'n': /*POD [B<-n> I<hostname>] */
+                if (strlen(optarg) > sizeof(ctx->uname.nodename)-1) {
+                        fprintf(stderr, "%s:Error: nodename \"%s\" to long to option -n.\n", progname, optarg);
+                        exit(ERR_EXECUTION);
+                }
+                strcpy(ctx->uname.nodename, optarg);
+                break;
             case 't': /*POD [B<-t> I<tracefile>] */
                 ctx->option_tracing = TRUE;
                 trace_read (-1, optarg, 0);


ossp-pkg/lmtp2nntp/lmtp2nntp.pod 1.10 -> 1.11

--- lmtp2nntp.pod        2001/08/30 08:35:44     1.10
+++ lmtp2nntp.pod        2001/08/30 09:01:59     1.11
@@ -13,12 +13,12 @@
 [B<-g> I<groupmode>]
 [B<-h> I<host>[I<:port>][,I<host>[I<:port>], ...]]
 [B<-m> I<maxmessagesize>]
+[B<-n> I<hostname>]
 [B<-t> I<tracefile>]
 [B<-v>]
 I<newsgroup> [I<newsgroup> ...]
 B<FIXME NOT YET IMPLEMENTED>
 [B<-o> I<origin>]
-[B<-j> I<hostname>]
 [B<-i> I<messageid>]
 [B<-T> I<timeout>]
 [B<-l> I<logtarget>]
@@ -66,7 +66,7 @@
 arguments. However, in these modes the command line arguments are filters
 representing allowed groups. Filters can be specified as wildmat's.
 
-=item [B<-h> I<host>[I<:port>][,I<host>[I<:port>], ...]]
+=item B<-h> I<host>[I<:port>][,I<host>[I<:port>], ...]
 
 Hostname or address and optional TCP port of a NNTP service. Unless a port is
 specified, getserbyname(nntp) is queried with fallback to 119/tcp. If C<-h>
@@ -81,11 +81,16 @@
 In regard to this program they must provide the same groups and talk to each
 other. 
 
-=item [B<-m> I<maxmessagesize>]
+=item B<-m> I<maxmessagesize>
 
 Maximum message size in bytes. Default is 8388608 (8M). Values below 64 are
 considered unacceptable small.
 
+=item B<-n> I<nodename>
+
+Own FQDN used in LMTP and NNTP protocols. This overrides the nodename returned
+by uname(3).
+
 =item B<-t> I<tracefile>
 
 Enable LMTP and NNTP protocol tracing into tracefile. When using C<syslog:>
@@ -108,10 +113,6 @@
 
 Outgoing network IP address or hostname to bind to.
 
-=item B<-j> I<hostname>
-
-Own FQDN used in LMTP and NNTP protocols.
-
 =item B<-i> I<messageid>
 
 Message id of MTA (for logging purposes only).

CVSTrac 2.0.1