[scponly] SCPONLY compilation problem

Thomas Toth ttoth at infosys.tuwien.ac.at
Tue Mar 15 08:55:57 EST 2005


Hi,

when trying to compile scponly with the parameters
./configure --without-sftp-server --disable-winscp-compat
--disable-gftp-compat

on a Solaris 9 (SPARC) machine I noticed that gcc reports a compilation
error.

gcc -g -O2 -I. -I. -DHAVE_CONFIG_H
-DDEBUGFILE='"/usr/local/etc/scponly/debuglevel"' -o scponly.o -c
scponly.c
scponly.c:80: error: `PROG_SFTP_SERVER' undeclared here (not in a function)
scponly.c:80: error: initializer element is not constant
scponly.c:80: error: (near initialization for `dangerous_args[1].name')
scponly.c:80: error: initializer element is not constant
scponly.c:80: error: (near initialization for `dangerous_args[1]')
scponly.c:90: error: initializer element is not constant
scponly.c:90: error: (near initialization for `dangerous_args[2]')
make: *** [scponly.o] Error 1

The reason is clear as in config.h is stated
/* Binaries launched in sftp compat mode */
#ifdef ENABLE_SFTP
#define PROG_SFTP_SERVER "/usr/lib/ssh/sftp-server"
#endif

but PROG_SFTP_SERVER is used too if SFTP is disabled, as shown here:
cmd_arg_t dangerous_args[] =
{
        { PROG_SCP, "-S" },
        { PROG_SFTP_SERVER, "-S" },
...

I suggest to place a
#ifdef ENABLE_SFTP
#endif

around
        { PROG_SCP, "-S" },

Then the source compiles fine.

BTW, cool tool!

Thomas Toth




More information about the scponly mailing list