Mailing List Archive

[Bug 600] compilation of ssh-askpass or ssh-rand-helper fails on NCR MP-RAS v3.02
http://bugzilla.mindrot.org/show_bug.cgi?id=600

Summary: compilation of ssh-askpass or ssh-rand-helper fails on
NCR MP-RAS v3.02
Product: Portable OpenSSH
Version: -current
Platform: ix86
OS/Version: other
Status: NEW
Severity: normal
Priority: P2
Component: Build system
AssignedTo: openssh-bugs@mindrot.org
ReportedBy: johnf.ct@netzero.net


ssh, sshd, ssh-add, ssh-keygen, ssh-keyscan, ssh-keysign, and ssh-agent
appear to compile fine. Here's where it fails:


cc -g -I. -I. -I/usr/local/ssl/include -I/usr/local/include -DSSHDIR=\"
/usr/local/etc\" -D_PATH_SSH_PROGRAM=\"/usr/local/bin/ssh\" -D_PATH_SSH_ASKPAS
S_DEFAULT=\"/usr/local/libexec/ssh-askpass\" -D_PATH_SFTP_SERVER=\"/usr/local/l
ibexec/sftp-server\" -D_PATH_SSH_KEY_SIGN=\"/usr/local/libexec/ssh-keysign\" -
D_PATH_SSH_PIDDIR=\"/usr/local/etc\" -D_PATH_PRIVSEP_CHROOT_DIR=\"/var/empty\"
-DSSH_RAND_HELPER=\"/usr/local/libexec/ssh-rand-helper\" -DHAVE_CONFIG_H -c ssh
-rand-helper.c
E "ssh-rand-helper.c",L252/C16(#444): ru
| Type `double stir_rusage(int who,double entropy_estimate)::struct rusage' (
"ssh-rand-helper.c",L252/C9) of variable is a yet undefined struct/union.
E "ssh-rand-helper.c",L257/C23(#80): ru
| sizeof can't be applied to an incomplete struct/union.
w "ssh-rand-helper.c",L712/C30(#257): '=' encountered where '==' may have been
intended.
2 user errors 1 warning
*** Error code 2 (bu21)

make: fatal error.

I will add the config.log file as an attachment.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 600] compilation of ssh-askpass or ssh-rand-helper fails on NCR MP-RAS v3.02 [ In reply to ]
http://bugzilla.mindrot.org/show_bug.cgi?id=600





------- Additional Comments From johnf.ct@netzero.net 2003-06-22 20:30 -------
Created an attachment (id=331)
--> (http://bugzilla.mindrot.org/attachment.cgi?id=331&action=view)
Contains the output of ./configure




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 600] compilation of ssh-askpass or ssh-rand-helper fails on NCR MP-RAS v3.02 [ In reply to ]
http://bugzilla.mindrot.org/show_bug.cgi?id=600





------- Additional Comments From dtucker@zip.com.au 2003-06-22 21:00 -------
I would guess that "struct rusage" is defined in a header file that is not
included. Try grepping /usr/include to find which header it is, then try
#include'ing it in ssh-rand-helper.c to see if it fixes the problem. Then tell
us which one it is :-)



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 600] compilation of ssh-askpass or ssh-rand-helper fails on NCR MP-RAS v3.02 [ In reply to ]
http://bugzilla.mindrot.org/show_bug.cgi?id=600





------- Additional Comments From johnf.ct@netzero.net 2003-06-25 14:00 -------
I found rusage in /usr/include/sys/resource.h

I tried to add the following just after the first "#include" statement
in ssh-rand-helper.c. Still getting the same error:

1. #include "sys/resource.h"
2. #include <resource.h>
3. I even copied /usr/include/sys/resource.h into /usr/local/include
(make shows "-I/usr/local/include" somewhere in the compilation)
That didn't work either.

I also modified config.h and changed HAS_GETRUSAGE(?) from 1 to 0. Still
the same problem. In the end, I just commented the following code starting
in line 252 in ssh-rand-helper.c:

struct rusage ru;

if (getrusage(who, &ru) == -1)
return 0;

RAND_add(&ru, sizeof(ru), entropy_estimate);

return entropy_estimate;

and replaced it with "return 0", just like in the "#else" part
of the "#ifdef" statement. All the rest of the programs compiled
fine.

I didn't run "make install" yet though because I'm not sure what
the effect of changing the code above to just one line (return 0)
would do.

Pls. let me know if it's fine to run "make install" even though
I changed my version of ssh-rand-helper.c. Just a reminder, this
is the newest source: 3.6.1p2. Thanks!



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 600] compilation of ssh-askpass or ssh-rand-helper fails on NCR MP-RAS v3.02 [ In reply to ]
http://bugzilla.mindrot.org/show_bug.cgi?id=600





------- Additional Comments From djm@mindrot.org 2003-06-28 17:58 -------
1. Changing the HAS_GETRUSAGE to 0 will not help, you need to comment out the
#define altogether

2. For some reason, configure is finding rusage but it is not in the headers
that we are including. Please try the following command (or equivalent):

find /usr/include -type f -exec grep rusage {} /dev/null \;

and report which files are matched.

Your system probably has what we need tucked away in some weird header file.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 600] compilation of ssh-askpass or ssh-rand-helper fails on NCR MP-RAS v3.02 [ In reply to ]
http://bugzilla.mindrot.org/show_bug.cgi?id=600





------- Additional Comments From johnf.ct@netzero.net 2003-06-28 20:01 -------
Hi,

The rusage function(?) is in /usr/include/sys/resource.h.

I'll comment the whole HAS_GETRUSAGE section in config.h and
will recompile.

I also had problems about "no controlling tty". I found another
post that says to add "#...CTTY 1". After I did that, ssh worked.

JohnF



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 600] compilation of ssh-askpass or ssh-rand-helper fails on NCR MP-RAS v3.02 [ In reply to ]
http://bugzilla.mindrot.org/show_bug.cgi?id=600





------- Additional Comments From djm@mindrot.org 2003-06-28 20:21 -------
> The rusage function(?) is in /usr/include/sys/resource.h.

We are after the definition of "struct rusage", not so much the functions.

Try manually adding '#include <sys/resource.h>' to ssh-rand-helper.c just before
the '#include "misc.h"' line near the top of the file.

If that doesn't work, try the find command I mentioned and attach the results to
this bug.




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 600] compilation of ssh-askpass or ssh-rand-helper fails on NCR MP-RAS v3.02 [ In reply to ]
http://bugzilla.mindrot.org/show_bug.cgi?id=600





------- Additional Comments From johnf.ct@netzero.net 2003-06-29 13:44 -------
Hi,

Adding "#include <sys/resource.h>" didn't help. Got the same error.

Here's the output of the "find" command:

/usr/include/sys/resource.h:struct rusage {
/usr/include/sys/resource.h:extern int getrusage(int, struct rusage *);
/usr/include/sys/wait.h:extern pid_t wait3(int *, int, struct rusage *);

Commenting the whole "#define HAVE_GETRUSAGE 1" line in config.h
succeeds and compilation goes ok all the way with no problems.

JohnF



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 600] compilation of ssh-askpass or ssh-rand-helper fails on NCR MP-RAS v3.02 [ In reply to ]
http://bugzilla.mindrot.org/show_bug.cgi?id=600





------- Additional Comments From dtucker@zip.com.au 2003-06-29 17:10 -------
Created an attachment (id=343)
--> (http://bugzilla.mindrot.org/attachment.cgi?id=343&action=view)
configure.gz: rebuilt with extra defines for NCR MP-RAS

Should have remembered this earlier (this was added after 3.6.1p2):
$ cvs log configure.ac
[snip]
revision 1.124
date: 2003/05/30 07:43:42; author: dtucker; state: Exp; lines: +3 -1
- (dtucker) Define SSHD_ACQUIRES_CTTY for NCR MP-RAS and Reliant Unix.

I'm pretty sure these are required. I also want to add -D_XOPEN_SOURCE=1
-D_XOPEN_SOURCE_EXTENDED=1 to CPPFLAGS for MP-RAS but I haven't had
confirmation
that it will not break anything else.
[end quote]

Please try the attached (gzip'ed) configure file, which is from 3.6.1p2 with
both sets of defines added. You shouldn't need any other flags or changes,
hopefully configure will get it right.




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 600] compilation of ssh-askpass or ssh-rand-helper fails on NCR MP-RAS v3.02 [ In reply to ]
http://bugzilla.mindrot.org/show_bug.cgi?id=600





------- Additional Comments From johnf.ct@netzero.net 2003-06-30 17:25 -------
Created an attachment (id=345)
--> (http://bugzilla.mindrot.org/attachment.cgi?id=345&action=view)
output of 'make' after running the new attachment 'configure.gz' on 3.6.1p2




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 600] compilation of ssh-askpass or ssh-rand-helper fails on NCR MP-RAS v3.02 [ In reply to ]
http://bugzilla.mindrot.org/show_bug.cgi?id=600





------- Additional Comments From johnf.ct@netzero.net 2003-06-30 17:27 -------
(From update of attachment 345)
Using the configure.gz
that was attached here
breaks the compilation
real bad. Just commenting "HAVE_GETRUSAGE" and adding the "#define ....CTTY 1"
makes everything work"




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 600] compilation of ssh-askpass or ssh-rand-helper fails on NCR MP-RAS v3.02 [ In reply to ]
http://bugzilla.mindrot.org/show_bug.cgi?id=600

dtucker@zip.com.au changed:

What |Removed |Added
----------------------------------------------------------------------------
Attachment #343 is|0 |1
obsolete| |



------- Additional Comments From dtucker@zip.com.au 2003-06-30 19:30 -------
Created an attachment (id=346)
--> (http://bugzilla.mindrot.org/attachment.cgi?id=346&action=view)
Attempt to fix configure for NCR MP-RAS

Ouch. You appear to have system headers that blow up when those XOPEN defines
are defined.

We can try only defining HAVE_GETRUSAGE if getrusage() is defined AND can be
linked, as opposed to just if it can be linked (patch attached).

I'll attach a new configure rebuilt with this patch to test in a few minutes.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 600] compilation of ssh-askpass or ssh-rand-helper fails on NCR MP-RAS v3.02 [ In reply to ]
http://bugzilla.mindrot.org/show_bug.cgi?id=600





------- Additional Comments From dtucker@zip.com.au 2003-06-30 19:34 -------
Created an attachment (id=347)
--> (http://bugzilla.mindrot.org/attachment.cgi?id=347&action=view)
New (gzip'ed) configure for MP-RAS made with previous attachment.




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 600] compilation of ssh-askpass or ssh-rand-helper fails on NCR MP-RAS v3.02 [ In reply to ]
http://bugzilla.mindrot.org/show_bug.cgi?id=600





------- Additional Comments From dtucker@zip.com.au 2003-06-30 19:35 -------
Created an attachment (id=348)
--> (http://bugzilla.mindrot.org/attachment.cgi?id=348&action=view)
New (gzip'ed) configure for MP-RAS made with previous attachment.




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 600] compilation of ssh-askpass or ssh-rand-helper fails on NCR MP-RAS v3.02 [ In reply to ]
http://bugzilla.mindrot.org/show_bug.cgi?id=600





------- Additional Comments From johnf.ct@netzero.net 2003-07-03 13:15 -------
Hi,

I'm confused here. Attachment 347 shows a configure.ac patch file while
attachment 348 shows a gzipped configure. Anyway, here's what I did:

1. download attachment 348 (the one dated 2003-06-30 19:35 above)
2. extracted openssh-3.6.1p2.tar.gz to another directory
3. replaced the 'configure' file that came with openssh-3.6.1p2 with
attachment 348
4. ./configure
5. make

The compilation finished. I haven't run 'make install' yet.
JohnF



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 600] compilation of ssh-askpass or ssh-rand-helper fails on NCR MP-RAS v3.02 [ In reply to ]
http://bugzilla.mindrot.org/show_bug.cgi?id=600





------- Additional Comments From dtucker@zip.com.au 2003-07-03 13:34 -------
"configure" is generated by autoconf from "configure.ac", so the changes are
made to configure.ac but you need autoconf (I used v2.53) and gnu m4 to rebuild
configure.

Attachment #346 is the patch, #347 and #348 are the resulting configure file (a
network hiccup meant that it was submitted twice).

I attached the patch so people could see what was changed and the rebuilt
configure so it's easy to test. If it runs OK for you and there are no
objections I'll commit patch #346.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 600] compilation of ssh-askpass or ssh-rand-helper fails on NCR MP-RAS v3.02 [ In reply to ]
http://bugzilla.mindrot.org/show_bug.cgi?id=600

dtucker@zip.com.au changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED



------- Additional Comments From dtucker@zip.com.au 2003-07-07 19:46 -------
Attachment #346 applied. Please reopen if this is not resolved or a new bug if
there are further problems.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.