[4480] in Kerberos

home help back first fref pref prev next nref lref last post

Re: Porting of V5 to AIX 4.1

daemon@ATHENA.MIT.EDU (Anthony J. Lill)
Tue Jan 10 23:17:35 1995

To: "Theodore Ts'o" <tytso@MIT.EDU>
Cc: alf@minnie.kgn.ibm.com, kerberos@MIT.EDU, krb5-bugs@MIT.EDU
In-Reply-To: Your message of "Thu, 22 Dec 1994 22:49:22 +0500."
Reply-To: Tony.Lill@ajlc.waterloo.on.ca
Date: Tue, 10 Jan 1995 23:14:28 -0500
From: "Anthony J. Lill" <ajlill@ajlc.waterloo.on.ca>

>>>>> "Theodore" == Theodore Ts'o <tytso@MIT.EDU> writes:
    Theodore>    Date: Wed, 21 Dec 1994 23:09:18 -0500 From: "Anthony
    Theodore> J. Lill" <ajlill@ajlc.waterloo.on.ca>

    Tony> 1) The configure script distributed in util/et did not
    Tony> work. Probable cause is that the command to re-create the
    Tony> Makefile doesn't pass the --topdir arg to autoconf. Also,
    Tony> for some reason, running autoconf --topdir=. in src produces
    Tony> a configure script with the head chopped off, while running
    Tony> autoconf without the argument works.

Actually, here's some more info on the autoconf problem. If there is
a file called aclocal.m4 in the current directory and there is an
aclocal.m4 in the directory pointed to by the --topdir= arg, then they are
both included and the resulting configure script has it's head chopped
off. I discovered that general rule when I patched up to B4pl3, but
didn't remove the old aclocal.m4's, and wound up with all the
configure scripts trashed.

    Theodore> You're supposed to only need to run the configure script
    Theodore> in the top level, which then automatically recurses down
    Theodore> the tree, running configure in each directory and
    Theodore> passing in the appropriate --topdir argument at the
    Theodore> time.

    Theodore> Running configure down in a low-level directory without
    Theodore> the correnct --topdir arguments will cause it to lose.
    Theodore> The makefiles that it generates should be set up so that
    Theodore> if the configure file is more recent that the
    Theodore> config.status file, it will automatically re-run the
    Theodore> configure file with the appropriate --topdir arguments.
    Theodore> (I'm pretty sure that made it into pl3.)

I think you may have let a directory or two out with bogus configure
scripts.

    Tony> 3) The sed that comes with SVR4 can't handle the ct_c.sed
    Tony> script, you should probably search for a more appropriate
    Tony> one rather than hardcoding /bin/sed

    Theodore> Hardcoding /bin/sed is wrong; that will be undone in the
    Theodore> next release, so it just looks for sed where it may be
    Theodore> in the search path.

    Theodore> I am curious about SVR4's sed not working on the
    Theodore> ct_c.sed script.  I had tested the ct_c.sed script under
    Theodore> a large number of platforms, including System V
    Theodore> derivitives, so I had assumed that it would work on most
    Theodore> platforms.  If you could send me more details about how
    Theodore> ct_c.sed was failing under SVR4's sed, I'd be grateful.

Ok, Here's the output of 'make' in util/ss using /usr/bin/sed on Dell
SVR4 Issue 2.2:

make -k
/bin/sh config.status
creating Makefile
./config_script ./mk_cmds.sh gawk /usr/bin/sed > mk_cmds
chmod 755 mk_cmds	
gawk -f ./../.././util/et/et_c.awk outfile=ss_err.c ss_err.et
gcc -fpic -DNARROW_PROTOTYPES -I/home/ajlill/src/siips/include -g -DNO_YYLINENO=1 -DHAS_STRDUP=1 -DUSE_DIRENT_H=1 -DNEED_SYS_FCNTL_H=1 -DWAIT_USES_INT=1 -DUSE_SIGPROCMASK=1 -DSTDARG_PROTOTYPES=1 -I. -I./ -I./.. -I./../et -I..   -c ss_err.c 
+ ../.././util/ss/mk_cmds std_rqs.ct 
Unrecognized command: # This script parses a command_table file into something which is a bit 
gawk -f ./../.././util/et/et_h.awk outfile=ss_err.h ss_err.et
gcc -fpic -DNARROW_PROTOTYPES -I/home/ajlill/src/siips/include -g -DNO_YYLINENO=1 -DHAS_STRDUP=1 -DUSE_DIRENT_H=1 -DNEED_SYS_FCNTL_H=1 -DWAIT_USES_INT=1 -DUSE_SIGPROCMASK=1 -DSTDARG_PROTOTYPES=1 -I. -I./ -I./.. -I./../et -I..   -c std_rqs.c 
std_rqs.c:1: parse error before `ssu00001'
std_rqs.c:2: warning: braces around scalar initializer for `ssu00001[0]'
std_rqs.c:2: warning: excess elements in scalar initializer after `ssu00001[0]'
std_rqs.c:2: warning: excess elements in scalar initializer after `ssu00001[0]'
std_rqs.c:2: warning: excess elements in scalar initializer after `ssu00001[0]'
std_rqs.c:3: warning: data definition has no type or storage class
std_rqs.c:5: warning: excess elements in scalar initializer after `ss_request_table'
std_rqs.c:5: warning: data definition has no type or storage class
make: *** [std_rqs.o] Error 1

and here's std_rqs.c, in it's entirity:

static ss_request_entry ssu00001[] = {
    { 0, 0, 0, 0 }
};

ss_request_table  = { 2, ssu00001 };

It looks like the sed can't deal with the comments in the sed script.

    Tony> 7) Of course, the eval fails when it shouldn't, so the test
    Tony> is bogus for me. The stock C compiler rejects the test:

    Tony> { /* Sun SC1.0 ANSI compiler rejects this -- but not the
    Tony> above. */ typedef const int *iptr; iptr p = 0; ++p; }

    Theodore> Is this the stock C compiler for SVR4?  We should find
    Theodore> out whether this is because it doesn't support const
    Theodore> correctly, or because this is a bug in a standard
    Theodore> autoconf test.  If it's the latter, it should get
    Theodore> reported back to the autoconf folks.

It is for Dell. The only other one I have access to now is the Metaware
compiler that comes with NCR Unix. It doesn't have this bug, but makes
up for it with horrible bugs in the optimizer that causes Kerberos to
core dump in the MD4 routines.

    Tony> and so sets const to "", however, a number of files
    Tony> (e.g. lib/krb5/asn.1/asn1_decode.c) include stdio.h,
    Tony> autoconf.h, then stdlib.h. In both stdio.h and stdlib.h,
    Tony> system is defined as

    Tony> int system( const char * );

    Tony> but the second time around, the const is stripped, and the
    Tony> compile fails.

    Theodore> Can you get me a list of those files?  We should really
    Theodore> fix the ordering of the include files to allow for this
    Theodore> case.

When I get some time, I'll do a compile with the old cc and send you a
list of the files that blow up, though I guess anywhere you include
the krb files after system files is suspect.

    Tony> 8) Is it your intention to propagate the DECLARG/OLDDECLARG
    Tony> to all the kerberos source? If so, I may do some of the
    Tony> work.

    Theodore> The only reason why we're using DECLARG/OLDDECLARG was
    Theodore> because of the decision to make certain types (like the
    Theodore> encryption types) be "narrow" types --- i.e., char or
    Theodore> shorts --- and the ANSI allowed behavior that could
    Theodore> allow compilers to do different calling conventions if
    Theodore> they know that a function is declared using narrow
    Theodore> types.  Hence, only functions which get passed in
    Theodore> parameters that are narrow types currently have
    Theodore> DECLARG/OLDDECLARG applied to them.  Elsewhere, the
    Theodore> function prototypes use have prototypes, and we use the
    Theodore> standard K&R function headers for portability without
    Theodore> the mess of DECLARG/OLDDECLARG.

    Theodore> It's enough of a mess that I'm considering simply just
    Theodore> removing the use of narrow types from krb5 altogether.
    Theodore> It doesn't actually buy you much (if anything) on most
    Theodore> architectures.

Personally, I'd like to see the DECLARG stuff propogated to the whole
thing, it eliminates a lot of warnings, which makes me feel a lot
better, especially when porting to DOS. Are there really that many
pure K&R compilers still being used?? BTW, I found an couple of
argument mismatches between libss and kdb5_edit when I added
prototypes to the .h file. 

    Tony> 9) Anyone working on a way to set NARROW_PROTOTYPES?

    Theodore> NARROW_PROTOTYPES is only supposed to be turned on and
    Theodore> off for small pieces of code, during certain specialized
    Theodore> declarations.  It's part of a really ugly hack caused by
    Theodore> the fact that we use narrow prototypes, and a desire for
    Theodore> code linked against the kerberos library to work whether
    Theodore> or not the include files containing the function
    Theodore> prototypes are linked in or not.

Don't you get them all when you include krb5.h? I can't think of a
situation where someone couldn't use the include files when building
their code. Would someone ship the libs without the includes??
Speaking of libs, anyone thinking about building shared libraries. I
think this is one area where autoconf falls far short of imake.

    Tony> 10) Your test for -lsocket in kdc (probably elsewhere as
    Tony> well) can't work. On SVR4 -lsocket requires -lnsl, so trying
    Tony> to compile the test program with -lsocket but without -lnsl
    Tony> will always fail. I switched the order, and it linked, but
    Tony> only because I'm using shared libs.

    Theodore> Under solaris, it does work, since merely linking in
    Theodore> -lsocket without -lnsl works if you don't actually pull
    Theodore> in any of the libsocket.a routines.  This is a tough
    Theodore> one; we'll probably have to do a specialized test to get
    Theodore> around this particular bit of SVR4 braindamage....

Are you linking with shared or static libs? The test will work in the
correct order with static libs, cause you're effectively only testing
for the existence of the lib. Does Sun/Solaris treat it's shared
objects like a .a or a .o? I'm surprised that autoconf doesn't build
up the list of LIBS from back to front instead of like it does. That's
probably the correct fix, but then you'd have to get the installed
base of autoconf users to buy into it.

--
Tony Lill,                         Tony.Lill@AJLC.Waterloo.ON.CA
President, A. J. Lill Consultants                 (519) 241 2461
539 Grand Valley Dr., Cambridge, Ont.    fax/data (519) 650 3571

"Welcome to All Things UNIX, where if it's not UNIX, it's CRAP!"

home help back first fref pref prev next nref lref last post