Linux commands

Monday, June 19, 2017

ProviderTest.exe example

C:\Program Files (x86)\CA\erpconn\siebel\bin>ProviderTest.exe
Enter username: sadmin (username should authenticate and Authorization in User directory given in policies)
Enter password: sadmin (username should validated in User directory given in policies)
Testing provider with username 'sadmin' and password 'sadmin'
Loading library... OK
Finding entry point... OK
Enter Config File: C:\Siebel\8.1.1.14.0\ses\siebsrvr\BIN\SmSiebelSSO.conf
Calling SecurityLogin()...OK
pUser is NULL
Provider test failed

ERR: SmAgentConnection::SetResource Agent API Error (No Connection)

Trouble shoot
restarted the policy server
corrected the config file C:\Siebel\8.1.1.14.0\ses\siebsrvr\BIN\SmSiebelSSO.conf

correct conf file as below.
#ClusterThreshold=50
AgentName=agent
SharedSecret=****
Resource=/SiebelConnector/

testprovider correct output


C:\Program Files (x86)\CA\erpconn\siebel\bin>ProviderTest75.exe
Loading Security Adapter
OK
Security Adapter API Version is correct
Enter username: user1   (This is ldap user, not the siebel admin user)
Enter password: ****  
Testing provider with username 'user1' and password '****'
Enter Config File: C:\Siebel\8.1.1.14.0\ses\siebsrvr\BIN\SmSiebelSSO.conf
Calling SecurityLogin()...Number of roles to save is 0OK
Return code is OK
Test 1: SecurityGetUsername8()
        Username: user1
Test 2: SecurityGetAccountStatus8()
        Account state: ACTIVE
Test 3: SecurityGetCredentials8()
        pCred->m_pType: Test1
        pCred->m_pUsername: sadmin
        pCred->m_pPassword: 6 characters long
Test 4: GetUserInfo:
        m_accountStatus: ACTIVE
        m_bPasswordSet: 0
        m_pCredentialsArray
                #:       Type |   Username |   Password
                --------------+------------+-----------
                0:            |     sadmin |    6 chars
        No further credentials
        m_pNewUsername: (None)
        m_pPassword: (None)
Test 5: GetRoles()
        SecurityGetRoles8 returned SecurityErrOK
        Total: 0 roles

Friday, June 9, 2017

gmake[4]: ../../../config/./nsinstall: Command not found

solution:
If you start compilation with NSPR then this error will through 

so don't do first nspr build ,

Do NSS build only from nss folder.
cd nss
gmake BUILD_OPT=1 NSPR_INCLUDE_DIR=/root/nss/ USE_SYSTEM_ZLIB=1 ZLIB_LIBS=-lz nss_build_all

ld: fatal: Symbol referencing errors. No output written to libnspr4.so

Solution:
Go to nspr folder and Build nspr with 
./Configure

ld: fatal: library -lplc4: not found

ld: fatal: library -lplc4: not found
ld: fatal: library -lplds4: not found

Solution:
Goto 
nss-3.20/dist/SunOS5.10_DBG.OBJ/lib/
bash-3.2# ldd libplc4.so
ldd: libplc4.so: cannot open file: No such file or directory
bash-3.2# ls -ltr
total 112
drwxr-xr-x   3 root     root         185 Nov 10 11:53 cpu
lrwxrwxrwx   1 root     root          51 Nov 10 12:11 libnspr4.a -> ../../../nspr/SunOS5.10_DBG.OBJ/pr/src/./libnspr4.a
lrwxrwxrwx   1 root     root          52 Nov 10 12:11 libnspr4.so -> ../../../nspr/SunOS5.10_DBG.OBJ/pr/src/./libnspr4.so
lrwxrwxrwx   1 root     root          51 Nov 10 12:11 libplds4.a -> ../../../nspr/SunOS5.10_DBG.OBJ/lib/ds/./libplds4.a
lrwxrwxrwx   1 root     root          52 Nov 10 12:11 libplds4.so -> ../../../nspr/SunOS5.10_DBG.OBJ/lib/ds/./libplds4.so
lrwxrwxrwx   1 root     root          56 Nov 10 12:11 libplc4.a -> ../../../nspr/SunOS5.10_DBG.OBJ/lib/libc/src/./libplc4.a
lrwxrwxrwx   1 root     root          57 Nov 10 12:11 libplc4.so -> ../../../nspr/SunOS5.10_DBG.OBJ/lib/libc/src/./libplc4.so

All are soft links here and soft links path are incorrect here. please copy the original so files created in below.
cd nss-3.20
bash-3.2# cp nspr/lib/libc/src/libplc4.so dist/SunOS5.10_DBG.OBJ/lib/
bash-3.2# cp nspr/lib/ds/libplds4.so dist/SunOS5.10_DBG.OBJ/lib/
cp nspr/pr/src/libnspr4.so dist/SunOS5.10_DBG.OBJ/lib/

configure: error: C compiler cannot create executables

Issue 2:
checking whether the C compiler works... no
configure: error: in `/home/kanmu03/nss-3.20/nspr':
configure: error: C compiler cannot create executables

Solution:
You need CC or gcc compiler when you compiling the NSS

We prefer the CC or cc compiler wich comes with solaris studio, you can download solaris studio from oracle site.

Un zip the solaris studio and set path to compiler CC or cc

export PATH=/usr/ccs/bin:/usr/sfw/bin:/opt/SolarisStudio12.3-solaris-sparc-bin/solarisstudio12.3/bin:$PATH

ld.so.1: certutil: fatal: libssl3.so: open failed: No such file or directory

Solution:
reinevm01: # ldd certutil
        libssl3.so =>    /lib/libssl3.so
        libsmime3.so => /lib/libsmime3.so
        libnss3.so =>    /lib/libnss3.so

check the symbolic link for the certuitl and add the lib path to LD_LIBRARY_PATH

NSS Compilation on Solaris

You need CC or gcc compiler when you compiling the NSS

We prefer the CC or cc compiler wich comes with solaris studio, you can download solaris studio from oracle site.

Un zip the solaris studio and set path to compiler CC or cc

export PATH=/usr/ccs/bin:/usr/sfw/bin:/opt/SolarisStudio12.3-solaris-sparc-bin/solarisstudio12.3/bin:$PATH

export CFLAGS=-m32

export CXX=CC

export CC=cc

Go to nss folder
cd nss

Compilation command :

gmake nss_build_all 
or
gmake BUILD_OPT=1 NSPR_INCLUDE_DIR=/root/nss/ USE_SYSTEM_ZLIB=1 ZLIB_LIBS=-lz nss_build_all



Trouble shoot issues while compilation

Issue 1:

ld.so.1: certutil: fatal: libssl3.so: open failed: No such file or directory

Solution:
reinevm01: # ldd certutil
        libssl3.so =>    /lib/libssl3.so
        libsmime3.so => /lib/libsmime3.so
        libnss3.so =>    /lib/libnss3.so

check the symbolic link for the certuitl and add the lib path to LD_LIBRARY_PATH

Issue 2:
checking whether the C compiler works... no
configure: error: in `/home/kanmu03/nss-3.20/nspr':
configure: error: C compiler cannot create executables

Solution:
Add the solaris studio bin folder path in $PATH


Issue 3:
ld: fatal: library -lplc4: not found
ld: fatal: library -lplds4: not found

Solution:
Goto 
nss-3.20/dist/SunOS5.10_DBG.OBJ/lib/
bash-3.2# ldd libplc4.so
ldd: libplc4.so: cannot open file: No such file or directory
bash-3.2# ls -ltr
total 112
drwxr-xr-x   3 root     root         185 Nov 10 11:53 cpu
lrwxrwxrwx   1 root     root          51 Nov 10 12:11 libnspr4.a -> ../../../nspr/SunOS5.10_DBG.OBJ/pr/src/./libnspr4.a
lrwxrwxrwx   1 root     root          52 Nov 10 12:11 libnspr4.so -> ../../../nspr/SunOS5.10_DBG.OBJ/pr/src/./libnspr4.so
lrwxrwxrwx   1 root     root          51 Nov 10 12:11 libplds4.a -> ../../../nspr/SunOS5.10_DBG.OBJ/lib/ds/./libplds4.a
lrwxrwxrwx   1 root     root          52 Nov 10 12:11 libplds4.so -> ../../../nspr/SunOS5.10_DBG.OBJ/lib/ds/./libplds4.so
lrwxrwxrwx   1 root     root          56 Nov 10 12:11 libplc4.a -> ../../../nspr/SunOS5.10_DBG.OBJ/lib/libc/src/./libplc4.a
lrwxrwxrwx   1 root     root          57 Nov 10 12:11 libplc4.so -> ../../../nspr/SunOS5.10_DBG.OBJ/lib/libc/src/./libplc4.so

All are soft links here and soft links path are incorrect here. please copy the original so files created in below.
cd nss-3.20
bash-3.2# cp nspr/lib/libc/src/libplc4.so dist/SunOS5.10_DBG.OBJ/lib/
bash-3.2# cp nspr/lib/ds/libplds4.so dist/SunOS5.10_DBG.OBJ/lib/
cp nspr/pr/src/libnspr4.so dist/SunOS5.10_DBG.OBJ/lib/



Issue 4:

ld: fatal: Symbol referencing errors. No output written to libnspr4.so

Solution:
Go to nspr folder and Build nspr with 
./Configure

Issue 5:

gmake[4]: ../../../config/./nsinstall: Command not found

solution:
If you start compilation with NSPR then this error will through 

so don't do first nspr build ,

Do NSS build only from nss folder.
cd nss
gmake BUILD_OPT=1 NSPR_INCLUDE_DIR=/root/nss/ USE_SYSTEM_ZLIB=1 ZLIB_LIBS=-lz nss_build_all

Create cert8.db from certutil

Run the below commands to create cert8.db and key3.db and second.db

       
./certutil -A -n "My Root CA" -t "C,," -i "/root/caroot.cer" -d "/root/"
./certutil -A -n "My Server Cert" -t "P,," -i "/root/servercert.cer" -d "/root/"