[scponly] One failure condition with scponly shell

Higgins, Bobby G bobby.g.higgins at citigroup.com
Tue Feb 21 10:21:30 EST 2006


I added a few lines of code to make this work on the AIX 5.2 and 5.3 P4 and P5 systems.  The failure condition when the 'ssh' command with no arguments was used for access.  The scponly program was exiting.  However the user's forked sshd was not exiting.  I added a statement to kill the PPID and everything now works.  The modified code follows:
#ifdef WINSCP_COMPAT
        if ((argc!=3) && (argc!=1))
#else
        if (argc!=3)
#endif
        {
#ifdef AIX
                pid_t ppid;
 
                ppid = getppid();
n#edif
                if (debuglevel)
                        syslog (LOG_ERR, "incorrect number of args");
 
#ifdef AIX
                if (debuglevel)
                        syslog (LOG_ERR, "kill ppid on AIX.");
                (void)kill(ppid, 1);
#endif
                exit(EXIT_FAILURE);
        }

The lines that were added are between the #ifdef AIX and its corresponding #endif.  This fixed the AIX 5 failure.  I had to add the '-DAIX' compile option to the scponly target in the Makefile.
 
 
 
Bobby Higgins
(817) 317-8231
 
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the scponly mailing list