Bug 1001 - Error on MAKE while compiling SRPMS and tar.gz but not while installing RPMS
Summary: Error on MAKE while compiling SRPMS and tar.gz but not while installing RPMS
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Build system (show other bugs)
Version: -current
Hardware: All Linux
: P2 minor
Assignee: OpenSSH Bugzilla mailing list
URL:
Keywords: patch
Depends on:
Blocks: 994
  Show dependency treegraph
 
Reported: 2005-03-16 06:54 AEDT by MMP
Modified: 2005-03-27 02:34 AEST (History)
0 users

See Also:


Attachments
Add coreutils to BuildPreReq (643 bytes, patch)
2005-03-16 10:53 AEDT, Darren Tucker
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description MMP 2005-03-16 06:54:45 AEDT
I am running Red Hat Linux release 7.2 (Enigma) with custom kernel version: 
2.4.21 and openSSH version: 3.7.1p2-1.

When I install openSSH version (any) RPM it gets installed after resolving 
dependencies but it fails at MAKE when I try to install using tar.gz or source 
RPMS. The error displayed is:

---------- ERROR MESSAGE -----

checking if your system defines WTMPX_FILE... no 
configure: creating ./config.status 
./configure: uniq: command not found 
config.status: creating Makefile 
config.status: creating openbsd-compat/Makefile 
config.status: creating scard/Makefile 
config.status: creating ssh_prng_cmds 
config.status: creating config.h 

OpenSSH has been configured with the following options: 
                     User binaries: /usr/local/bin 
                   System binaries: /usr/local/sbin 
               Configuration files: /usr/local/etc 
                   Askpass program: /usr/local/libexec/ssh-askpass 
                      Manual pages: /usr/local/man/manX 
                          PID file: /var/run 
  Privilege separation chroot path: /var/empty 
            sshd default user 
PATH: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin 
                    Manpage format: doc 
                       DNS support: no 
                       PAM support: no 
                 KerberosV support: no 
                 Smartcard support: no 
                     S/KEY support: no 
              TCP Wrappers support: no 
              MD5 password support: no 
       IP address in $DISPLAY hack: no 
           Translate v4 in v6 hack: yes 
                  BSD Auth support: no 
              Random number source: OpenSSL internal ONLY 
 
              Host: i686-pc-linux-gnu 
          Compiler: gcc 
    Compiler flags: -g -O2 -Wall -Wpointer-arith -Wno-uninitialized 
Preprocessor flags: 
      Linker flags: 
         Libraries:   -lutil -lz -lnsl  -lcrypto -lcrypt 
 
bash-2.05# make 
(cd openbsd-compat && make) 
make[1]: Entering directory `/usr/src/redhat/SOURCES/openssh-3.7.1p2/openbsd-
compat' 
gcc -g -O2 -Wall -Wpointer-arith -Wno-uninitialized -I. -I.. -I. -I./..  -
DHAVE_CONFIG_H -c bsd-arc4random.c 
In file included from ../includes.h:170, 
                 from bsd-arc4random.c:25: 
../defines.h:146:4: #error "8 bit int type not found." 
../defines.h:158:5: #error "16 bit int type not found." 
../defines.h:167:5: #error "32 bit int type not found." 
../defines.h:183:5: #error "8 bit int type not found." 
../defines.h:195:6: #error "16 bit int type not found." 
../defines.h:204:6: #error "32 bit int type not found." 
make[1]: *** [bsd-arc4random.o] Error 1 
make[1]: Leaving directory `/usr/src/redhat/SOURCES/openssh-3.7.1p2/openbsd-
compat' 
make: *** [openbsd-compat/libopenbsd-compat.a] Error 2 
 
----- ERROR MESSAGE -------

------ ENVIRONMENT/VERSION DETAILS ---------
bash-2.05# rpm -qa | grep openssh 
openssh-askpass-3.7.1p2-1 
openssh-3.7.1p2-1 
openssh-clients-3.7.1p2-1 
openssh-server-3.7.1p2-1 
 
bash-2.05# rpm -qa | grep openssl 
openssl-devel-0.9.6b-8 
openssl-0.9.6b-8 
 
bash-2.05# rpm -qa | grep zlib 
zlib-devel-1.1.4-8.7x 
zlib-1.1.4-8.7x 
 
bash-2.05# rpm -qa | grep glibc 
glibc-2.2.4-13 
glibc-common-2.2.4-13 
glibc-devel-2.2.4-13 
 
bash-2.05# rpm -qa | grep kernel 
kernel-source-2.4.7-10 
kernel-smp-2.4.7-10 
kernel-pcmcia-cs-3.1.27-10 
kernel-enterprise-2.4.7-10 
kernel-headers-2.4.7-10 
kernel-2.4.7-10 

------ ENVIRONMENT/VERSION DETAILS ---------
Comment 1 Darren Tucker 2005-03-16 10:21:16 AEDT
(In reply to comment #0)
> ./configure: uniq: command not found

This is probably the cause.  On my FC3 box, uniq is provided by the "coreutils"
package, try installing it for your box and retesting.

Comment 2 Darren Tucker 2005-03-16 10:53:13 AEDT
Created attachment 856 [details]
Add coreutils to BuildPreReq

If I rename /usr/bin/uniq I get the same errors as you report, so I'm almost
certain that's the source of your problem.

This patch adds coreutils as a build prereq which will catch this.
Comment 3 Darren Tucker 2005-03-16 10:57:13 AEDT
A build problem in a contrib file does not warrant "critical" severity.

Please try the attached patch and see if it complains about coreutils being
missing.  (I can't remove it to test on my box because many things depend on it).
Comment 4 Darren Tucker 2005-03-16 11:14:47 AEDT
Comment on attachment 856 [details]
Add coreutils to BuildPreReq

I've just looked at what's actually *in* coreutils (ls, rm, mv and many other
things that are likely to be missed) so I find it difficult to believe that
it's not installed. 

>+BuildPreReq: perl, openssl-devel, tcp_wrappers, coreutils

Perhaps uniq is provided be some other RPM on your platform, in which case the
BuildPreReq should be "/usr/bin/uniq".
Comment 5 MMP 2005-03-17 03:37:05 AEDT
I tried to patch (patch file is in /usr/src/redhat/SOURCES/openssh-3.7.1p2/)and 
displays following:


bash-2.05# pwd
/usr/src/redhat/SOURCES/openssh-3.7.1p2

bash-2.05# patch < openssh-rpm-coreutils.patch
can't find file to patch at input line 8
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|Index: contrib/redhat/openssh.spec
|===================================================================
|RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/contrib/redhat/openss
h.spec,v
|retrieving revision 1.133
|diff -u -p -r1.133 openssh.spec
|--- contrib/redhat/openssh.spec        9 Mar 2005 00:02:42 -0000       1.133
|+++ contrib/redhat/openssh.spec        15 Mar 2005 23:46:24 -0000
--------------------------
File to patch:
Comment 6 Darren Tucker 2005-03-17 06:52:24 AEDT
(In reply to comment #5)
> bash-2.05# patch < openssh-rpm-coreutils.patch

Try giving patch the "-p0" option.
Comment 7 MMP 2005-03-17 08:11:58 AEDT
It still gives the same error. See output below:

bash-2.05# patch < openssh-rpm-coreutils.patch -p0
patching file contrib/redhat/openssh.spec
Hunk #1 succeeded at 79 (offset -5 lines).


bash-2.05# ./configure --with-md5-password
....
....
....
checking if the systems has expire shadow information... yes
checking for "/etc/default/login"... no
Adding /usr/local/bin to USER_PATH so scp will work
checking if we need to convert IPv4 in IPv6-mapped addresses... yes (default)
checking if your system defines LASTLOG_FILE... no
checking if your system defines _PATH_LASTLOG... yes
checking if your system defines UTMP_FILE... yes
checking if your system defines WTMP_FILE... yes
checking if your system defines UTMPX_FILE... no
checking if your system defines WTMPX_FILE... no
configure: creating ./config.status
./configure: uniq: command not found
config.status: creating Makefile
config.status: creating openbsd-compat/Makefile
config.status: creating scard/Makefile
config.status: creating ssh_prng_cmds
config.status: creating config.h
config.status: config.h is unchanged

OpenSSH has been configured with the following options:
                     User binaries: /usr/local/bin
                   System binaries: /usr/local/sbin
               Configuration files: /usr/local/etc
                   Askpass program: /usr/local/libexec/ssh-askpass
                      Manual pages: /usr/local/man/manX
                          PID file: /var/run
  Privilege separation chroot path: /var/empty
            sshd default user PATH: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
                    Manpage format: doc
                       DNS support: no
                       PAM support: no
                 KerberosV support: no
                 Smartcard support: no
                     S/KEY support: no
              TCP Wrappers support: no
              MD5 password support: no
       IP address in $DISPLAY hack: no
           Translate v4 in v6 hack: yes
                  BSD Auth support: no
              Random number source: OpenSSL internal ONLY

              Host: i686-pc-linux-gnu
          Compiler: gcc
    Compiler flags: -g -O2 -Wall -Wpointer-arith -Wno-uninitialized
Preprocessor flags:
      Linker flags:
         Libraries:   -lutil -lz -lnsl  -lcrypto -lcrypt

bash-2.05# make
....
....
....
(cd openbsd-compat && make)
make[1]: Entering directory `/usr/src/redhat/SOURCES/openssh-3.7.1p2/openbsd-
compat'
gcc -g -O2 -Wall -Wpointer-arith -Wno-uninitialized -I. -I.. -I. -I./..  -
DHAVE_CONFIG_H -c bsd-arc4random.c
In file included from ../includes.h:170,
                 from bsd-arc4random.c:25:
../defines.h:146:4: #error "8 bit int type not found."
../defines.h:158:5: #error "16 bit int type not found."
../defines.h:167:5: #error "32 bit int type not found."
../defines.h:183:5: #error "8 bit int type not found."
../defines.h:195:6: #error "16 bit int type not found."
../defines.h:204:6: #error "32 bit int type not found."
make[1]: *** [bsd-arc4random.o] Error 1
make[1]: Leaving directory `/usr/src/redhat/SOURCES/openssh-3.7.1p2/openbsd-
compat'
make: *** [openbsd-compat/libopenbsd-compat.a] Error 2

Comment 8 Darren Tucker 2005-03-17 08:35:44 AEDT
OK, please try editting the spec file and changing this line:
BuildPreReq: perl, openssl-devel, tcp_wrappers, coreutils

to

BuildPreReq: perl, openssl-devel, tcp_wrappers, /usr/bin/uniq

then retest.
Comment 9 MMP 2005-03-17 09:56:16 AEDT
Still produces same error. 

Block 1: openssh.specs extract which contains BuildPreReq line
Block 2: error output

---- BLOCK 1 (openssh.spec) -------
License: BSD
Group: Applications/Internet
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
Obsoletes: ssh
%if %{build6x}
PreReq: initscripts >= 5.00
%else
PreReq: initscripts >= 5.20
%endif
BuildPreReq: perl, openssl-devel, tcp_wrappers, /usr/bin/uniq
BuildPreReq: /bin/login
%if ! %{build6x}
BuildPreReq: glibc-devel, pam
%else
BuildPreReq: /usr/include/security/pam_appl.h
---- BLOCK 1 -------

---- BLOCK 2 -------
bash-2.05# ./configure
....
....
....
./configure: uniq: command not found
config.status: creating Makefile
config.status: creating openbsd-compat/Makefile
config.status: creating scard/Makefile
config.status: creating ssh_prng_cmds
config.status: creating config.h

OpenSSH has been configured with the following options:
                     User binaries: /usr/local/bin
                   System binaries: /usr/local/sbin
               Configuration files: /usr/local/etc
                   Askpass program: /usr/local/libexec/ssh-askpass
                      Manual pages: /usr/local/man/manX
                          PID file: /var/run
  Privilege separation chroot path: /var/empty
            sshd default user PATH: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
                    Manpage format: doc
                       DNS support: no
                       PAM support: no
                 KerberosV support: no
                 Smartcard support: no
                     S/KEY support: no
              TCP Wrappers support: no
              MD5 password support: no
       IP address in $DISPLAY hack: no
           Translate v4 in v6 hack: yes
                  BSD Auth support: no
              Random number source: OpenSSL internal ONLY

              Host: i686-pc-linux-gnu
          Compiler: gcc
    Compiler flags: -g -O2 -Wall -Wpointer-arith -Wno-uninitialized
Preprocessor flags:
      Linker flags:
         Libraries:   -lutil -lz -lnsl  -lcrypto -lcrypt

bash-2.05# make clean
bash-2.05# make
....
....
....
(cd openbsd-compat && make)
make[1]: Entering directory `/usr/src/redhat/SOURCES/openssh-3.7.1p2/openbsd-
compat'
gcc -g -O2 -Wall -Wpointer-arith -Wno-uninitialized -I. -I.. -I. -I./..  -
DHAVE_CONFIG_H -c bsd-arc4random.c
In file included from ../includes.h:170,
                 from bsd-arc4random.c:25:
../defines.h:146:4: #error "8 bit int type not found."
../defines.h:158:5: #error "16 bit int type not found."
../defines.h:167:5: #error "32 bit int type not found."
../defines.h:183:5: #error "8 bit int type not found."
../defines.h:195:6: #error "16 bit int type not found."
../defines.h:204:6: #error "32 bit int type not found."
make[1]: *** [bsd-arc4random.o] Error 1
make[1]: Leaving directory `/usr/src/redhat/SOURCES/openssh-3.7.1p2/openbsd-
compat'
make: *** [openbsd-compat/libopenbsd-compat.a] Error 2

---- BLOCK 2 -------
Comment 10 Darren Tucker 2005-03-17 10:56:03 AEDT
I don't know why the buildprereq doesn't work.  My only guess is that uniq is in
the rpm database but has been deleted from /usr/bin.

Does /usr/bin/uniq exist?  Does rpm know about it ("rpm -qfi /usr/bin/uniq")?
Comment 11 MMP 2005-03-17 12:55:22 AEDT
/usr/bin/uniq does not exist.

bash-2.05# rpm -qfi /usr/bin/uniq
error: file /usr/bin/uniq: No such file or directory
Comment 12 Darren Tucker 2005-03-18 10:51:52 AEDT
(In reply to comment #11)
> /usr/bin/uniq does not exist.

Well, that's the source of your problem.  It may be in some other RPM on your
version of redhat (maybe fileutils?), I suggest you find it and install it.

I don't understand why the /usr/bin/uniq BuildPreReq doesn't cause it to
complain, though.
Comment 13 MMP 2005-03-22 05:08:59 AEDT
Thanks, Darren. With TextUtils was able to execute MAKE. 

On MAKE INSTALL, I get this below message on permissions. I stopped the SSHD 
service (/usr/local/sbin) and tried MAKE INSTALL but still gives same message.

The permissions I have on SSHD is:
bash-2.05# ls -alp
total 644
drwxr-xr-x    2 root     root         4096 Feb  6  1996 ./
drwxr-sr-x   15 root     root         4096 Mar 18 18:18 ../
-rwsr-sr-x    1 root     root       645854 Oct 14  2003 sshd
--------------------


bash-2.05# make install
if test ! -z ""; then \
        /usr/bin/perl ./fixprogs ssh_prng_cmds ; \
fi
(cd openbsd-compat && make)
make[1]: Entering directory `/usr/src/redhat/SOURCES/openssh-3.7.1p2/openbsd-com
pat'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/usr/src/redhat/SOURCES/openssh-3.7.1p2/openbsd-comp
at'
(cd scard && make DESTDIR= install)
make[1]: Entering directory `/usr/src/redhat/SOURCES/openssh-3.7.1p2/scard'
../mkinstalldirs /usr/local/share
/usr/bin/install -c -m 0644 ./Ssh.bin /usr/local/share/Ssh.bin
make[1]: Leaving directory `/usr/src/redhat/SOURCES/openssh-3.7.1p2/scard'
./mkinstalldirs /usr/local/bin
./mkinstalldirs /usr/local/sbin
./mkinstalldirs /usr/local/man
./mkinstalldirs /usr/local/share
./mkinstalldirs /usr/local/man/man1
./mkinstalldirs /usr/local/man/man5
./mkinstalldirs /usr/local/man/man8
./mkinstalldirs /usr/local/libexec
(umask 022 ; ./mkinstalldirs /var/empty)
/usr/bin/install -c -m 0755 -s ssh /usr/local/bin/ssh
/usr/bin/install -c -m 0755 -s scp /usr/local/bin/scp
/usr/bin/install -c -m 0755 -s ssh-add /usr/local/bin/ssh-add
/usr/bin/install -c -m 0755 -s ssh-agent /usr/local/bin/ssh-agent
/usr/bin/install -c -m 0755 -s ssh-keygen /usr/local/bin/ssh-keygen
/usr/bin/install -c -m 0755 -s ssh-keyscan /usr/local/bin/ssh-keyscan
/usr/bin/install -c -m 0755 -s sshd /usr/local/sbin/sshd
/usr/bin/install: cannot remove `/usr/local/sbin/sshd': Operation not permitted
make: *** [install-files] Error 1

Thanks!
Comment 14 Darren Tucker 2005-03-22 11:22:20 AEDT
(In reply to comment #13)
> -rwsr-sr-x    1 root     root       645854 Oct 14  2003 sshd

That looks badly wrong (and very suspect).  sshd should not be setuid (or setgid).

> /usr/bin/install -c -m 0755 -s sshd /usr/local/sbin/sshd
> /usr/bin/install: cannot remove `/usr/local/sbin/sshd': Operation not permitted

Assuming that's running as root, maybe it's flagged immutable?  Try "lsattr sshd".
Comment 15 MMP 2005-03-22 13:06:29 AEDT
It is running as root. Result of lsattr sshd 
bash-2.05# lsattr sshd
-u--a-------- sshd
Comment 16 Darren Tucker 2005-03-22 13:40:47 AEDT
(In reply to comment #15)
> It is running as root. Result of lsattr sshd 
> bash-2.05# lsattr sshd
> -u--a-------- sshd

Yep, that's it (AFAIK there's no good reason for doing this and I would consider
it pretty suspicious).

From the chattr(1) man page:

       A file with the 'a' attribute set can only be open in append mode  for
       writing.    Only   the   superuser   or   a   process  possessing  the
       CAP_LINUX_IMMUTABLE capability can set or clear this attribute.

So you need to "chattr -ua sshd".  Anyway, this is a local configuration problem
not an OpenSSH problem so please close this bug.
Comment 17 MMP 2005-03-27 02:34:16 AEST
Thanks so much, Darren!