Subject: all works except -d, -l, -L on Solaris 2.5.1

From: "Roger A. Hanke" <[email-masked]>
Date: Fri, 31 Jan 1997 18:00:57 -0500

Dear WUFTPD'ers,

 With Beta 11 built with GCC on IRIX 6.2 all command line options work
fine. When I add -d, -l, -L options in inetd I get extra info in /var/adm/SYSLOG.

 But on Solaris 2.5.1 system, same Beta 11 source and GCC version, I get
xferlog entries, and I get /var/adm/messages entries when errors occur,
like logon refused. My command line has -a -u options only.
When I add -d, -l, and -L options to the command line I do not get any
more info printed to messages. Still just get ftpd messages there when
errors occur. I have flipped back and forth several times to verify this,
making sure to signal inetd each time. Also have done this on two different
Solaris 2.5.1 systems as well. These servers have also been rebooted since 
the options were added, still no output.

 Can anyone think of any reason since it knows where /var/adm/messages
is for sure, why it wouldnt put out the -d, -l, or -L info there when requested?
Any differences in the way this extra output is handled from the way error
messages are?

	Thanx,
	Roger Hanke

-------------------------------------------------------------------
 Roger A. Hanke         AT&T Easy World Wide Web Service
 (908)949-4091          [email-masked] or
 FAX (908)949-7171              [email-masked]
 HO 6C-111              http://lynxhub.ho.att.com/~rah/	
-------------------------------------------------------------------

---

From: Bob Luckin <[email-masked]>
Date: Fri, 31 Jan 97 18:24:29 CST

Roger Hanke asked :-
> Any differences in the way this extra output is handled from the way error

If I remember correctly (and if I don't, hopefully someone will correct
me  :-)  ), under Solaris syslog output is handled by the syslogd daemon,
which must be running.  The output, and the files it writes to are controlled
by the configuration file "/etc/syslog.conf".

So you need to make sure your /etc/syslog.conf file is configured
appropriately, to write the correct type of log messages to the desired
file.  'fraid I can't recommend settings off the top of my head; just
check the syslogd man page and experiment util you get what you want.
You'll need to force syslogd to reread the config file each time you
change it - I think this can be done by sending it the HUP signal.

Hope this helps !

Cheers, Bob
-- 
Bob Luckin      [email-masked]      "A man, a plan, a canal, Suez !"

---

From: [email-masked] (Albert Lunde)
Date: Fri, 31 Jan 1997 22:34:18 +73800 (CST)

> > Any differences in the way this extra output is handled from the way error

Here's some more ideas:

On many (most?) implementations of inetd there is a limit on the number
of arguments that can be passed to a program running under inetd.

I think I ran into this sooner because I was using tcp_wrappers too
and it "used up" one argument. Try putting -u first and last and see if the 
umask changes, if it does you will know you are dropping arguments.

I eventually wound up using this wrapper program to pass all
the arguments I needed:
= = =
/* wrapper for wuftpd to add command line arguments
   that don't fit under inetd */

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <syslog.h>

int main(argc,argv)
int argc;
char **argv;
{
    char *path="/local-adm/bin/ftpd";
    char *cmd="ftpd";

    fflush(stderr);
    fflush(stdout);
    errno=0;
    execl(path,cmd,"-a","-l","-L","-u022","-t600","-T1200",NULL);

    openlog("wrapftpd",LOG_PID, LOG_LOCAL6);
    syslog(LOG_WARNING,(const char *)strerror(errno));
    closelog();
    exit(EXIT_FAILURE);

}

= = =
(The use of syslog to signal if exec failed is just a refinement;
 the execl is really all you need.)

I compiled _this_ and ran it under inetd and tcp_wrappers (with
no arguments.)

Other possible argument "gotchas":
- wu ftpd doesn't seem to like a space between a option and its 
value.
- misconfiguation of tcp_wrappers can lose arguments; run tcpdchk to test.