Subject: problem with ftpcmd.y in beta 11

From: James Fidell <[email-masked]>
Date: Fri, 30 Aug 1996 11:28:11 +0100 (BST)

In ftpcmd.y, there are many occurrences of something similar to :

        |   CWD check_login SP pathname CRLF
        = {
            if (log_commands) syslog(LOG_INFO, "CWD %s", $4);

Checking the code for "pathname" :

pathname:   pathstring
    = {
        /*
         * Problem: this production is used for all pathname
         * processing, but only gives a 550 error reply.
         * This is a valid reply in some cases but not in others.
         */
        if (logged_in && $1 && strncmp($1, "~", 1) == 0) {
            $$ = *ftpglob($1);
            if (globerr) {
                reply(550, globerr);
                $$ = NULL;
            }
            free($1);
        } else
            $$ = $1;
    }
    ;

Which means that $4 can be set to NULL when syslog is called.  Solaris
2.5 doesn't like this very much -- the server aborts with a SIGSEGV.

My current fix is to change the call to syslog be be something like :

    if ( log_commands && $4 ) syslog(LOG_INFO, "CWD %s", $4);

James.
-- 
 "Yield to temptation --             | Work: [email-masked]
  it may not pass your way again"    | Play: [email-masked]
                                     | http://www.netcom.net.uk/~james/
        - Lazarus Long               |              James Fidell