Skip Menu |
 

Date: Tue, 27 Jan 2004 18:44:09 +0100
From: Michael Schloh von Bennewitz <krb5bugs@encambio.com>
To: krb5-bugs@mit.edu
Subject: Fixed problem with sig_t on krb5-1.3.1
Download (untitled) / with headers
text/plain 1.5KiB

Hello,

The krb5-1.3.1 code wouldn't build on any of our Solaris machines,
due to the sig_t type not being present on them. This is likely a
problem with any SVR4 machine, though I'm not sure about that. At
OpenPKG[0] we only tested on[1]:

Solaris 2.6/SPARC
Solaris 8/SPARC
Solaris 9/SPARC
Solaris 9/x86
Solaris 10/x86

The first compile error looks like this:

making all in appl/gssftp/ftp...
/openpkg/bin/cc -D<long list of defines and includes> -O2 -pipe -c cmds.c
cmds.c: In function `another':
cmds.c:141: error: syntax error before "intr"
cmds.c: In function `mput':
cmds.c:729: error: `sig_t' undeclared (first use in this function)
cmds.c:729: error: (Each undeclared identifier is reported only once
cmds.c:729: error: for each function it appears in.)

The idiot fix is to put 'typedef void (*sig_t) (int);', but I chose
a more portable solution by patching configure and making the
typedef conditional[2]. I did this by putting a AC_CHECK_TYPE(sig_t)
in krb5-1.3.1/src/appl/gssftp/configure.in and running autoconf. The
results are in a larger patch in CVS[3], although I can send a
minimal one if somebody wants this.

I hope you find this helpful, and please excuse me if the problem
was already noticed and fixed. I didn't see any relevant changes in
krb5-1.3.2-beta1 or krb5-current.

Regards,
Michael

Show quoted text
Download (untitled)
application/pgp-signature 477B

Message body not shown because it is not plain text.

Download (untitled) / with headers
text/plain 1.5KiB
Show quoted text
> The krb5-1.3.1 code wouldn't build on any of our Solaris machines,
> due to the sig_t type not being present on them. This is likely a
> problem with any SVR4 machine, though I'm not sure about that. At
> OpenPKG[0] we only tested on[1]:

We've got Solaris 9 here, and I just did a build from a source tree
unpacked from our distribution site, with no such problems.

Show quoted text
> The first compile error looks like this:
>
> making all in appl/gssftp/ftp...
> /openpkg/bin/cc -D<long list of defines and includes> -O2 -pipe -c
> cmds.c
> cmds.c: In function `another':
> cmds.c:141: error: syntax error before "intr"
> cmds.c: In function `mput':
> cmds.c:729: error: `sig_t' undeclared (first use in this function)
> cmds.c:729: error: (Each undeclared identifier is reported only once
> cmds.c:729: error: for each function it appears in.)

Now this gets interesting. In the 1.3.1 release, lines 141 and 729 (and
the lines immediately around them) don't refer to sig_t.

The first reference to sig_t in that file is at line 116, a declaration
"extern sig_t intr();" in the function another().

In ftp_var.h, around line 60, there's code to define sig_t as a typedef
for a pointer to a function returning krb5_sigtype, where krb5_sigtype
is defined on the compilation command line (on UNIX).

Where did you get this supposed 1.3.1 distribution from, and did you
check the included PGP signature using Tom Yu's key from the PGP key
servers? We've had some unconfirmed(?) indications before that hacked
versions of the MIT code may be out there, being presented as MIT's
distribution.

Ken
Date: Wed, 28 Jan 2004 10:57:28 +0100
From: Michael Schloh von Bennewitz <krb5bugs@encambio.com>
To: Ken Raeburn via RT <rt-comment@krbdev.mit.edu>
Cc: krb5-prs@mit.edu
Subject: Re: [krbdev.mit.edu #2170] Fixed problem with sig_t on krb5-1.3.1
RT-Send-Cc:
Download (untitled) / with headers
text/plain 3.5KiB

Hello Ken,

An Tue, Jan 27, 2004, Ken Raeburn via RT schrieb:
Show quoted text
>> The krb5-1.3.1 code wouldn't build on any of our Solaris machines,
>> due to the sig_t type not being present on them. This is likely a
>> problem with any SVR4 machine, though I'm not sure about that. At
>> OpenPKG[0] we only tested on[1]:
>
>We've got Solaris 9 here, and I just did a build from a source tree
>unpacked from our distribution site, with no such problems.
>
It is very likely that this problem was local to OpenPKG, because of
a patch applied that removes the sig_t typedef. I think you should
assume that your code is correct, although there's a small chance
that the unconditional typedef collides at buildtime with that of a
FreeBSD header, for example. It seems that the sig_t to my_sig_t
detour does the trick, but I don't understand why there's no build
error as my_sig_t is never defined:

ms@dt:/tmp/ms/opkg/krb5-1.3.1/src:> find . -exec grep my_sig_t {} \; -print
#define sig_t my_sig_t
./appl/gssftp/ftp/ftp_var.h
#define sig_t my_sig_t
./appl/gssftp/ftp/pclose.c

I assume that's why we patched in the first place, a long time ago.

Show quoted text
>> The first compile error looks like this:
>>
>> making all in appl/gssftp/ftp...
>> /openpkg/bin/cc -D<long list of defines and includes> -O2 -pipe -c
>> cmds.c
>> cmds.c: In function `another':
>> cmds.c:141: error: syntax error before "intr"
>> cmds.c: In function `mput':
>> cmds.c:729: error: `sig_t' undeclared (first use in this function)
>> cmds.c:729: error: (Each undeclared identifier is reported only once
>> cmds.c:729: error: for each function it appears in.)
>
>Now this gets interesting. In the 1.3.1 release, lines 141 and 729 (and
>the lines immediately around them) don't refer to sig_t.
>
>The first reference to sig_t in that file is at line 116, a declaration
>"extern sig_t intr();" in the function another().
>
These line numbers are slightly different due to the patch we apply,
as I mentioned in the bug report:

http://cvs.openpkg.org/rlog?f=openpkg-src/kerberos/kerberos.patch

Show quoted text
>In ftp_var.h, around line 60, there's code to define sig_t as a typedef
>for a pointer to a function returning krb5_sigtype, where krb5_sigtype
>is defined on the compilation command line (on UNIX).
>
This typedef is removed by our old patch. The new one I created
yesterday reinserted a typedef, but I did it my way. In the end the
results should be the same, although I use autoconf to detect if the
platform has sig_t and it is even necessary to use the explicit typedef.

Show quoted text
>Where did you get this supposed 1.3.1 distribution from, and did you
>check the included PGP signature using Tom Yu's key from the PGP key
>servers? We've had some unconfirmed(?) indications before that hacked
>versions of the MIT code may be out there, being presented as MIT's
>distribution.
>
The distribution we use is from:

http://www.crypto-publish.org/dist/mit-kerberos5/krb5-%{version}.tar.gz

Whereby %{version} is currently 1.3.1 and manually changed by an engineer
everytime a new version is automatically detected on your server
(using our vcheck tool). The engineer checks the patch code and
builds the new version on all our test servers first, of course.

In closing, I conclude that this bug report was a false alarm. I
hope you're not disappointed, but maybe what good came out of this
is considering if autoconf could be a better test of sig_t presence.
Thanks for providing such a good piece of software as kerberos is,
and keep up the good work.

P.S. I'm on a monthlong vacation as of tomorrow, so please don't be
offended if I don't respond after then.

Regards,
Michael
Download (untitled)
application/pgp-signature 477B

Message body not shown because it is not plain text.

To: Michael Schloh von Bennewitz <krb5bugs@encambio.com>
Cc: Ken Raeburn via RT <rt-comment@krbdev.mit.edu>, krb5-prs@mit.edu
Subject: Re: [krbdev.mit.edu #2170] Fixed problem with sig_t on krb5-1.3.1
From: Ken Raeburn <raeburn@MIT.EDU>
Date: Wed, 28 Jan 2004 20:52:31 -0500
RT-Send-Cc:
Download (untitled) / with headers
text/plain 1.5KiB
Michael Schloh von Bennewitz <krb5bugs@encambio.com> writes:
Show quoted text
> It is very likely that this problem was local to OpenPKG, because of
> a patch applied that removes the sig_t typedef. I think you should
> assume that your code is correct, although there's a small chance
> that the unconditional typedef collides at buildtime with that of a
> FreeBSD header, for example. It seems that the sig_t to my_sig_t

Okay. FreeBSD isn't one of our testing platforms at the moment,
unfortunately.

Show quoted text
> detour does the trick, but I don't understand why there's no build
> error as my_sig_t is never defined:

The line

typedef sigtype (*sig_t)();

after macro substitution will wind up looking something like this:

typedef void (*my_sig_t)();

Show quoted text
> The distribution we use is from:
>
> http://www.crypto-publish.org/dist/mit-kerberos5/krb5-%{version}.tar.gz

Yep, that one should be good. We don't control it, but we know the
guy who puts our stuff there.

Show quoted text
> In closing, I conclude that this bug report was a false alarm. I
> hope you're not disappointed, but maybe what good came out of this
> is considering if autoconf could be a better test of sig_t presence.

I'll keep the ticket open for this, but it'll be lower priority since
the current code seems like it should work okay.

Show quoted text
> Thanks for providing such a good piece of software as kerberos is,
> and keep up the good work.

Thanks for the kind words.

Show quoted text
> P.S. I'm on a monthlong vacation as of tomorrow, so please don't be
> offended if I don't respond after then.

No problem. Enjoy your vacation.

Ken