1 (edited by JoKnarf 2008-05-22 14:38:02)

Topic: Installation on Solaris sparc

First of all, crongratulations for this great tool.

Here is how I managed to compile it on Solaris 8 :

1- pb with u_int16_t

In file included from SftpServer/Sftp.h:25,
                 from main.c:31:
SftpServer/SftpWho.h:68: parse error before `u_int16_t'

=>added in SftpServer/SftpWho.h

typedef uint16_t u_int16_t;

pb then here

Compile         [SftpWho/Main.c]
In file included from SftpWho/Main.c:25:
SftpWho/../SftpServer/SftpWho.h:68: parse error before `u_int32_t'

=>change includes in SftpWho/Main.c

#include "../config.h"
#include <errno.h>
#include <fcntl.h>

#include <stdio.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <stdlib.h>
#include "../conf.h"
#include "../hash.h"
#include "../ip.h"
#include "../prog.h"

#include "../SftpServer/SftpWho.h"

2- pb with -Xlinker --as-needed options with ld :

unrecognized option '--as-needed'

=>options removed on LDFLAGS from Makefile

LDFLAGS=

3- add -lsocket and -liconv in Makefile
add -R /usr/local/lib for suid bit library search in this dir

$(NAME) : $(OBJ)
        @echo "Compile binary   [$(NAME)]"
        @$(CC) -lsocket -liconv -R /usr/local/lib -o $(NAME) $(OBJ) $(LDFLAGS)
        @$(CHMOD) 755 $(NAME)

sftpwho : $(OBJ1)
        @echo "Compile binary   [$(NAME1)]"
        @$(CC) -lsocket -o $(NAME1) $(OBJ1) $(LDFLAGS)
        @$(CHMOD) 711 $(NAME1)

After that the make is ok

I hope it can help, and I wish a long life to MySecureShell


JoK

Re: Installation on Solaris sparc

Thank you for the report, i'll fix it for next version ! big_smile

3 (edited by Nothing 2009-06-15 12:50:32)

Re: Installation on Solaris sparc

I also have problems compiling this great tool in Solaris 10 SPARC.
I had to do all the above changes in the source, but then I've got this:

bash-3.00# make
Makefile:135: warning: overriding commands for target `MySecureShell'
Makefile:66: warning: ignoring old commands for target `MySecureShell'
Compile         [main.c]
Compile         [string.c]
Compile         [parsing.c]
Compile         [hash.c]
Compile         [conf.c]
Compile         [convert.c]
Compile         [user.c]
Compile         [prog.c]
Compile         [ip.c]
Compile         [SftpServer/Buffer.c]
Compile         [SftpServer/Encode.c]
Compile         [SftpServer/Handle.c]
Compile         [SftpServer/Send.c]
Compile         [SftpServer/Sftp.c]
Compile         [SftpServer/Util.c]
Compile         [SftpServer/Log.c]
Compile         [SftpServer/Encoding.c]
SftpServer/Encoding.c: In function `convertToUtf8':
SftpServer/Encoding.c:47: warning: passing arg 2 of `libiconv' from incompatible pointer type
SftpServer/Encoding.c: In function `convertFromUtf8':
SftpServer/Encoding.c:77: warning: passing arg 2 of `libiconv' from incompatible pointer type
Compile         [SftpServer/Admin.c]
Compile         [SftpServer/SftpWho.c]
SftpServer/SftpWho.c: In function `SftpWhoRelaseStruct':
SftpServer/SftpWho.c:169: warning: passing arg 1 of `shmdt' from incompatible pointer type
Compile         [SftpServer/SftpExt.c]
Compile         [SftpServer/SftpServer.c]
Compile         [SftpServer/GetUsersInfos.c]
Compile         [SftpServer/Stats.c]
Compile         [SftpServer/Access.c]
Compile binary   [MySecureShell]
Undefined                       first referenced
 symbol                             in file
gethostbyaddr                       ip.o  (symbol belongs to implicit dependency /usr/lib/libnsl.so.1)
gethostbyname                       parsing.o  (symbol belongs to implicit dependency /usr/lib/libnsl.so.1)
inet_addr                           ip.o  (symbol belongs to implicit dependency /usr/lib/libnsl.so.1)
ld: fatal: Symbol referencing errors. No output written to MySecureShell
collect2: ld returned 1 exit status
make: *** [MySecureShell] Error 1

I'm not a C programmer and the easiest thing was to remove the lines with the unknown code in the source.
Then it compiled successfully.

Re: Installation on Solaris sparc

Hi,

Before compile MySecureShell, you have to modify the line in "Makefile":

LDFLAGS = -lcrypto

by

LDFLAGS = -lcrypto -lnsl

Then it should compile smile

Re: Installation on Solaris sparc

teka wrote:

Hi,

Before compile MySecureShell, you have to modify the line in "Makefile":

LDFLAGS = -lcrypto

by

LDFLAGS = -lcrypto -lnsl

Then it should compile smile

Hello and thank you for the reply smile
After clean "configure" the line with LDFLAGS in Makefile looks like this:

LDFLAGS  =

I've tried adding "-lnsl" but the error is the same as I quoted above.
If I add "-lcrypto" I get this:

Compile         [SftpServer/Sftp.c]
Compile         [SftpServer/Util.c]
Compile         [SftpServer/Log.c]
Compile         [SftpServer/Encoding.c]
SftpServer/Encoding.c: In function `convertToUtf8':
SftpServer/Encoding.c:47: warning: passing arg 2 of `libiconv' from incompatible pointer type
SftpServer/Encoding.c: In function `convertFromUtf8':
SftpServer/Encoding.c:77: warning: passing arg 2 of `libiconv' from incompatible pointer type
Compile         [SftpServer/Admin.c]
Compile         [SftpServer/SftpWho.c]
SftpServer/SftpWho.c: In function `SftpWhoRelaseStruct':
SftpServer/SftpWho.c:169: warning: passing arg 1 of `shmdt' from incompatible pointer type
Compile         [SftpServer/SftpExt.c]
Compile         [SftpServer/SftpServer.c]
Compile         [SftpServer/GetUsersInfos.c]
Compile         [SftpServer/Stats.c]
Compile         [SftpServer/Access.c]
Compile binary  [MySecureShell]
ld: fatal: library -lcrypto: not found
ld: fatal: File processing errors. No output written to MySecureShell
collect2: ld returned 1 exit status
make: *** [MySecureShell] Error 1

Installed is libgcrypt-1.2.4.

Re: Installation on Solaris sparc

Hi,

If i'm right, lib crypto is OpenSSL smile

Re: Installation on Solaris sparc

teka wrote:

Hi,

If i'm right, lib crypto is OpenSSL smile

Strange...
I have openssl-0.9.8k-sol10-sparc-local installed, even tried with openssl-0.9.7g-sol10-sparc-local.
Same result!?

Re: Installation on Solaris sparc

Since lib crypto isn't necessary for MySecureShell. It's not a big problem if you delete the "-lcrypto" smile

Re: Installation on Solaris sparc

Hello,

I know that the object of this post is about sparc platform but i've the same problems than 'nothing' on Sol 10 x86 platform.
I've tried to remove options in the LDFLAGS line in the MakeFile file.
When I compile with sun's make and gcc tool the result is the same than the post of '2009-06-15 14:26:57'.
I've tried whith SunFreeware's make and gcc too, but it's the same result too.
Can somebody help me?

Thanks a lot for your help