[scponly] Compiling scponly on AIX...

Kaleb Pederson kpederson at mail.ewu.edu
Thu Mar 17 14:58:44 EST 2005


Hello,

I've been working with scponly on AIX and it won't compile out of the box, nor 
does configure work correctly.  I have attached a patch, but document the 
problems below:

$ ./configure --disable-wildcards --disable-gftp-compat 
--disable-winscp-compat --disable-scp-compat 
--with-sftp-server=/usr/local/libexec/sftp-server --enable-chrooted-binary 
--enable-passwd-compat

# note, this isn't gnu make, this is the one supplied with AIX-5.2 and the
# ibm c compiler.
$ make
make: 1254-002 Cannot find a rule to create target = from dependencies.
Stop.

(See attached patch for fixes).

In config.h:
/* passwd compatibility */
#ifdef ENABLE_PASSWD
#define PROG_PASSWD "/usr/bin/passwd"
#endif

But in the makefile, there is no reference to ENABLE_PASSWD.  As it isn't 
correctly defined, 

I'm not an autoconf/automake guru (actually never tried using them as a dev.), 
so I didn't attempt a correct change, but my patch did mod the makefile so 
that it would correctly run on my system.

Once the makefile is fixed:

$ make
        gcc -g -O2 -I. -I. -DENABLE_PASSWD -DHAVE_CONFIG_H 
-DDEBUGFILE='"/usr/local/etc/scponly/debuglevel"' -o scponly.o -c scponly.c
scponly.c:79: error: `PROG_SCP' undeclared here (not in a function)
scponly.c:79: error: initializer element is not constant

PROG_SCP isn't defined because --disable-scp-compat was used in the configure 
process.

Once that is fixed:
$ make
	...
        gcc -g -O2 -I. -I. -DENABLE_PASSWD -DHAVE_CONFIG_H 
-DDEBUGFILE='"/usr/local/etc/scponly/debuglevel"' -o groups
gcc: no input files

I don't get this one, but the makefile isn't correctly picking up $< on the 
groups line.  You can see my mod in the patch.

Although I haven't included it, another patch is necessary to get this to 
compile using the IBM compiler.  I used gcc, which is a little more lenient, 
but there are a lot of #define lines that cause problems.  For example:

#define exact_match(x,y) (0==strcmp(x,y))       // we dont want strncpy for 
this

Because of the c++ style comment string, the macro preprocessor thinks that 
the comment is part of the macro, so it places the comment anywhere 
exact_match is found.  In an if statement, this is a slight problem ;).

The fix for this is to use the C style comments /* which is easy enough */.

At this point, everything will compile using gcc.  If I fix the defines (and 
there are quite a few of them) then it compiles using the standard IBM AIX 
compiler.

One other thing, which I don't have a patch for at this point in time is the 
chroot stuff.  The setup_chroot script didn't even come close to working :(.  
I just manually copied the files over, so I don't have a script that you can 
use as, at the time, I wasn't ready to take the time to understand the 
structure of the script.  I hope to get to that,....

Thanks for the product, it's very useful.

--Kaleb

-------------- next part --------------
A non-text attachment was scrubbed...
Name: scponly-compile.patch
Type: text/x-diff
Size: 1517 bytes
Desc: not available
Url : https://lists.ccs.neu.edu/pipermail/scponly/attachments/20050317/3a738945/scponly-compile.bin


More information about the scponly mailing list