NT_STATUS_ACCESS_DENIED listing

Posted by Steve Racanovic | Posted in | Posted on 11:07 AM

0

My samba server stop working the other day and which left me stump and unable to connect.

[oracle@beast /]$  smbclient -L //sracanov-au3/My.Contents
Password:
Domain=[SRACANOV-AU3] OS=[Unix] Server=[Samba 3.0.33-3.39.el5_8]

        Sharename       Type      Comment
        ---------       ----      -------
        My.Contents     Disk      My Files
        IPC$            IPC       IPC Service (Samba Server Version 3.0.33-3.39.el5_8)
        oracle          Disk      Home Directories
Domain=[SRACANOV-AU3] OS=[Unix] Server=[Samba 3.0.33-3.39.el5_8]

        Server               Comment
        ---------            -------

        Workgroup            Master
        ---------            -------
        AU-ORACLE            EDJONES
[oracle@beast /]$ smbclient //sracanov-au3/My.Contents -Uoracle%password
Domain=[SRACANOV-AU3] OS=[Unix] Server=[Samba 3.0.33-3.39.el5_8]
smb: \> dir
NT_STATUS_ACCESS_DENIED listing \*

                58681 blocks of size 16777216. 33764 blocks available
smb: \>

After thoroughly checking the configuration files again and user details I was still in the same place. I eventually found the issue was in SELinux, and once I'd disable it, it worked again.

[root@sracanov-au3 My.Contents]# setsebool -P smbd_disable_trans 1
[root@sracanov-au3 My.Contents]# service smb restart
Shutting down SMB services:                                [  OK  ]
Shutting down NMB services:                                [  OK  ]
Starting SMB services:                                     [  OK  ]
Starting NMB services:                                     [  OK  ]
[root@sracanov-au3 My.Contents]#

[oracle@beast /]$ smbclient //sracanov-au3/My.Contents -Uoracle%password
Domain=[SRACANOV-AU3] OS=[Unix] Server=[Samba 3.0.33-3.39.el5_8]
smb: \> dir
  .                                   D        0  Fri Apr 13 12:36:46 2012
  ..                                  D        0  Thu Apr 12 10:09:40 2012
  My.Software                         D        0  Tue May  1 10:46:18 2012
  My.Projects                         D        0  Fri Apr 13 11:35:45 2012
  My.Technical.Docs                   D        0  Fri Apr 13 12:36:44 2012
  My.Registry                         D        0  Fri Apr 13 11:23:37 2012
  My.VMWare.Images                    D        0  Thu Apr 12 11:00:59 2012
  My.Thunderbird                      D        0  Fri Apr 13 11:22:39 2012
  My.Music                            D        0  Fri Apr 13 11:35:58 2012
  My.Bookmarks                        D        0  Fri Apr 13 12:36:46 2012
  My.Docs                             D        0  Fri Apr 13 10:30:31 2012
  My.Pictures                         D        0  Fri Apr 13 12:36:45 2012
  My.Backups                          D        0  Tue May  1 15:59:25 2012

                58681 blocks of size 16777216. 33764 blocks available
smb: \>

A Connection Example of JDBC THIN, THICK or SQLPLUS using Oracle Instant Client

Posted by Steve Racanovic | Posted in | Posted on 12:10 PM

0

First, download the instant client you which to use from - http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html

The following steps demonstrate how to use it with simple connection.

1. I downloaded and extracted the following zips file;

- instantclient-basic-win-x86-64-11.1.0.7.0.zip
- instantclient-sqlplus-win-x86-64-11.1.0.7.0.zip

to: D:\Oracle\JDBC\instantclient\x86-64\11.1.0.7.0


[sracanov@SRACANOV-AU D]$ ll
 Volume in drive D is Data
 Volume Serial Number is 12FC-9B4B

 Directory of D:\Oracle\JDBC\instantclient\x86-64\11.1.0.7.0

07/02/2012  01:47 PM              .
07/02/2012  01:47 PM              ..
29/10/2008  07:09 AM            14,336 adrci.exe
29/10/2008  07:09 AM             4,648 adrci.sym
29/10/2008  07:09 AM               335 BASIC_README
29/10/2008  07:09 AM            47,104 genezi.exe
29/10/2008  07:09 AM            26,272 genezi.sym
12/01/2006  11:36 PM               342 glogin.sql
15/10/2008  07:11 AM         1,060,864 mfc71.dll
15/10/2008  07:11 AM           348,160 msvcr71.dll
29/10/2008  07:06 AM           659,968 oci.dll
29/10/2008  07:06 AM           426,200 oci.sym
07/10/2008  11:58 PM           132,608 ocijdbc11.dll
07/10/2008  11:58 PM            22,712 ocijdbc11.sym
26/10/2008  01:10 PM           468,480 ociw32.dll
26/10/2008  01:10 PM            73,024 ociw32.sym
07/10/2008  11:00 PM         1,890,262 ojdbc5.jar
07/10/2008  11:00 PM         1,988,193 ojdbc6.jar
14/10/2008  11:47 PM         1,527,296 orannzsbb11.dll
14/10/2008  11:47 PM           382,728 orannzsbb11.sym
27/10/2008  01:41 PM         1,330,176 oraocci11.dll
29/10/2008  07:09 AM           421,472 oraocci11.sym
29/10/2008  07:08 AM       126,414,336 oraociei11.dll
29/10/2008  07:08 AM         7,200,336 oraociei11.sym
29/10/2008  07:09 AM           426,496 orasql11.dll
29/10/2008  07:09 AM            35,744 orasql11.sym
02/10/2008  11:24 PM         1,685,504 Orasqlplusic11.dll
02/10/2008  11:24 PM           757,760 sqlplus.exe
29/10/2008  07:10 AM           135,976 sqlplus.sym
29/10/2008  07:10 AM               339 SQLPLUS_README
29/10/2008  07:09 AM              vc71
07/02/2012  01:47 PM              vc8
              28 File(s)    147,481,671 bytes
               4 Dir(s)  41,876,062,208 bytes free


2. Use sqlplus.exe and connect to the database.


[sracanov@SRACANOV-AU D]$ sqlplus scott/tiger@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=sracanov-au3.au.oracle.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=linux11gr2.au.oracle.com)))

SQL*Plus: Release 11.1.0.7.0 - Production on Wed Mar 14 11:10:17 2012

Copyright (c) 1982, 2008, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

[sracanov@SRACANOV-AU D]$

This is how my database listener looks like:


[oracle@sracanov-au3 dbhome_1]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 14-MAR-2012 11:17:49

Copyright (c) 1991, 2011, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date                13-MAR-2012 10:22:16
Uptime                    1 days 0 hr. 49 min. 33 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Log File         /u01/app/oracle/product/11.2.0/dbhome_1/log/diag/tnslsnr/sracanov-au3/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=sracanov-au3.au.oracle.com)(PORT=1521)))
Services Summary...
Service "linux11gr2.au.oracle.com" has 1 instance(s).
  Instance "linux11gr2", status READY, has 1 handler(s) for this service...
Service "linux11gr2XDB.au.oracle.com" has 1 instance(s).
  Instance "linux11gr2", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@sracanov-au3 dbhome_1]$


3. Download the simple standalone java client from Doc 467804.1 - How To Determine The Exact JDBC Driver Version (9.x - 11.x) For Standalone Programs (Doc ID 467804.1)


[sracanov@SRACANOV-AU D]$ cd /d C:\Users\sracanov\Downloads

[sracanov@SRACANOV-AU C]$ ll
 Volume in drive C is System
 Volume Serial Number is 3E06-1C2F

 Directory of C:\Users\sracanov\Downloads

07/02/2012  11:47 AM              .
07/02/2012  11:47 AM              ..
07/02/2012  11:45 AM             3,401 JDBCInfo.java
               1 File(s)          3,401 bytes
               2 Dir(s)  146,445,778,944 bytes free

[sracanov@SRACANOV-AU C]$ java -version
java version "1.6.0_30"
Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)

[sracanov@SRACANOV-AU C]$

There are 2 crucial points here:
A) - I'am using JDK 1.6, so I must use ojdbc6.jar driver.
B) - I am using 64bit JDK. My platform is 64bit. As per the files downloaded *win-x86-64-11.1.0.7.0*. (If platform is 64bit, use 64bit JDK and Client. This needs to be correct for OCI to work. Due to dll's. Thin will run with 32bit).

My platform:


[sracanov@SRACANOV-AU C]$ systeminfo | findstr /B /C:"OS Name" /C:"System Type"
OS Name:                   Microsoft Windows 7 Professional
System Type:               x64-based PC

If you dont have the correct JDK as per your platform, you can download it from here - http://www.oracle.com/technetwork/java/javase/downloads/index.html

4. Now compile and run using JDBC THIN to connect.


[sracanov@SRACANOV-AU C]$ javac -cp .;D:\Oracle\JDBC\instantclient\x86-64\11.1.0.7.0\ojdbc6.jar JDBCInfo.java

[sracanov@SRACANOV-AU C]$ java -cp .;D:\Oracle\JDBC\instantclient\x86-64\11.1.0.7.0\ojdbc6.jar JDBCInfo jdbc:oracle:thin:scott/tiger@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(PORT=1521)
(HOST=sracanov-au3.au.oracle.com))(CONNECT_DATA=(SERVICE_NAME=linux11gr2.au.oracle.com)))

Database
==============
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

JDBC
==============
Oracle JDBC driver: 11.1.0.7.0-Production

Connection URL
==============
jdbc:oracle:thin:scott/tiger@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(PORT=1521)(HOST=sracanov-au3.au.oracle.com))(CONNECT_DATA=(SERVICE_NAME=linux11gr2.au.oracle.com)))

JVM
===
Sun Microsystems Inc.
Java HotSpot(TM) 64-Bit Server VM
20.5-b03
1.6.0_30

LOCALE
===========
en_AU

CLASSPATH
=========
.
D:\Oracle\JDBC\instantclient\x86-64\11.1.0.7.0\ojdbc6.jar

LIBRARYPATH
===========
C:\Program Files\Java\jdk1.6.0_30\bin
C:\windows\Sun\Java\bin
C:\windows\system32
C:\windows
.
C:\windows\SYSTEM_BIN
C:\windows\SYSTEM_EXE
C:\Program Files\Windows Resource Kits\Tools
C:\windows\SYSTEM_EXE\unixutils\bin
C:\windows\SYSTEM_EXE\unixutils\usr\local\wbin
C:\Program Files\WinSCP3
C:\Program Files\cvsnt
C:\Program Files\GNU\WinCvs 2.0\
C:\Program Files\GnuWin32\bin
C:\Program Files\Java\jdk1.6.0_30\bin
C:\Program Files (x86)\apache-ant-1.7.0\bin
\bin
\bin
C:\windows
C:\windows\system32
.

[sracanov@SRACANOV-AU C]$

5. Now to use JDBC OCI to connect.


[sracanov@SRACANOV-AU C]$ set path=D:\Oracle\JDBC\instantclient\x86-64\11.1.0.7.0;%path%
[sracanov@SRACANOV-AU C]$ java -cp .;D:\Oracle\JDBC\instantclient\x86-64\11.1.0.7.0\ojdbc6.jar JDBCInfo jdbc:oracle:oci:scott/tiger@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(PORT=1521)(
HOST=sracanov-au3.au.oracle.com))(CONNECT_DATA=(SERVICE_NAME=linux11gr2.au.oracle.com)))

Database
==============
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

JDBC
==============
Oracle JDBC driver: 11.1.0.7.0-Production

Connection URL
==============
jdbc:oracle:oci:scott/tiger@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(PORT=1521)(HOST=sracanov-au3.au.oracle.com))(CONNECT_DATA=(SERVICE_NAME=linux11gr2.au.oracle.com)))

JVM
===
Sun Microsystems Inc.
Java HotSpot(TM) 64-Bit Server VM
20.5-b03
1.6.0_30

LOCALE
===========
en_AU

CLASSPATH
=========
.
D:\Oracle\JDBC\instantclient\x86-64\11.1.0.7.0\ojdbc6.jar

LIBRARYPATH
===========
C:\Program Files\Java\jdk1.6.0_30\bin
C:\windows\Sun\Java\bin
C:\windows\system32
C:\windows
D:\Oracle\JDBC\instantclient\x86-64\11.1.0.7.0
.
C:\windows\SYSTEM_BIN
C:\windows\SYSTEM_EXE
C:\Program Files\Windows Resource Kits\Tools
C:\windows\SYSTEM_EXE\unixutils\bin
C:\windows\SYSTEM_EXE\unixutils\usr\local\wbin
C:\Program Files\WinSCP3
C:\Program Files\cvsnt
C:\Program Files\GNU\WinCvs 2.0\
C:\Program Files\GnuWin32\bin
C:\Program Files\Java\jdk1.6.0_30\bin
C:\Program Files (x86)\apache-ant-1.7.0\bin
\bin
\bin
C:\windows
C:\windows\system32
.

[sracanov@SRACANOV-AU C]$

NOTE:

- If I was using 32bit JDK:

[sracanov@SRACANOV-AU C]$ set path=C:\Program Files (x86)\Java\jdk1.6.0_26\bin

[sracanov@SRACANOV-AU C]$ java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)

[sracanov@SRACANOV-AU C]$ java -cp .;D:\Oracle\JDBC\instantclient\x86-64\11.1.0.7.0\ojdbc6.jar JDBCInfo jdbc:oracle:thin:scott/tiger@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(PORT=1521)
(HOST=sracanov-au3.au.oracle.com))(CONNECT_DATA=(SERVICE_NAME=linux11gr2.au.oracle.com)))

Database
==============
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

JDBC
==============
Oracle JDBC driver: 11.1.0.7.0-Production

Connection URL
==============
jdbc:oracle:thin:scott/tiger@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(PORT=1521)(HOST=sracanov-au3.au.oracle.com))(CONNECT_DATA=(SERVICE_NAME=linux11gr2.au.oracle.com)))

JVM
===
Sun Microsystems Inc.
Java HotSpot(TM) Client VM
20.1-b02
1.6.0_26

LOCALE
===========
en_AU

CLASSPATH
=========
.
D:\Oracle\JDBC\instantclient\x86-64\11.1.0.7.0\ojdbc6.jar

LIBRARYPATH
===========
C:\Program Files (x86)\Java\jdk1.6.0_26\bin
C:\windows\Sun\Java\bin
C:\windows\system32
C:\windows
C:\Program Files (x86)\Java\jdk1.6.0_26\bin
.

[sracanov@SRACANOV-AU C]$
[sracanov@SRACANOV-AU C]$
[sracanov@SRACANOV-AU C]$ set path=D:\Oracle\JDBC\instantclient\x86-64\11.1.0.7.0;C:\Program Files (x86)\Java\jdk1.6.0_26\bin

[sracanov@SRACANOV-AU C]$ java -cp .;D:\Oracle\JDBC\instantclient\x86-64\11.1.0.7.0\ojdbc6.jar JDBCInfo jdbc:oracle:oci:scott/tiger@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(PORT=1521)(
HOST=sracanov-au3.au.oracle.com))(CONNECT_DATA=(SERVICE_NAME=linux11gr2.au.oracle.com)))
Exception in thread "main" java.lang.UnsatisfiedLinkError: D:\Oracle\JDBC\instantclient\x86-64\11.1.0.7.0\ocijdbc11.dll: Can't find dependent libraries
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1807)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1732)
        at java.lang.Runtime.loadLibrary0(Runtime.java:823)
        at java.lang.System.loadLibrary(System.java:1028)
        at oracle.jdbc.driver.T2CConnection$1.run(T2CConnection.java:3178)
        at java.security.AccessController.doPrivileged(Native Method)
        at oracle.jdbc.driver.T2CConnection.loadNativeLibrary(T2CConnection.java:3174)
        at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:233)
        at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:508)
        at oracle.jdbc.driver.T2CConnection.(T2CConnection.java:133)
        at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:53)
        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:510)
        at oracle.jdbc.pool.OracleDataSource.getPhysicalConnection(OracleDataSource.java:275)
        at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:206)
        at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:156)
        at JDBCInfo.main(JDBCInfo.java:58)

[sracanov@SRACANOV-AU C]$

- Thin works fine.

- OCI will run into dependent libraries issue on the platform. So you need to use the correct JDK.

- Set the envionment variable for your library on the system used. http://www.oracle.com/technetwork/database/features/instant-client/index-100365.html

"Set the library loading path in your environment to the directory in Step 2 ("instantclient"). On many UNIX platforms, LD_LIBRARY_PATH is the appropriate environment variable. On Windows, PATH should be used."

Manually applying a JDBC patch for a Custom OC4J.

Posted by Steve Racanovic | Posted in , | Posted on 4:04 PM

0

If you have followed doc 420303.1 to upgrade your JDBC driver and found this driver has issues where you need to apply a patch for it. You may want to follow this example to apply the one off patch.

[oracle@beast JDBC_UPGRADE]$ pwd
/home/u01/app/oracle/product/1013AS_blue/j2ee/JDBC_UPGRADE
[oracle@beast JDBC_UPGRADE]$ ll
total 104
drwxr-xr-x  2 oracle oinstall  4096 Feb 21 11:25 applib
drwxr-x---  9 oracle oinstall  4096 Feb 21 11:26 application-deployments
drwxr-xr-x  2 oracle oinstall  4096 Feb 21 11:25 applications
drwxr-xr-x  3 oracle oinstall  4096 Feb 21 11:31 config
drwxr-xr-x  4 oracle oinstall  4096 Feb 21 11:25 connectors
drwxr-xr-x  3 oracle oinstall  4096 Feb 21 11:26 log
-rw-r--r--  1 oracle oinstall 26445 Feb 21  2012 p13403295_10205_Generic.zip
drwxr-xr-x  3 oracle oinstall  4096 Feb 21 11:26 persistence
drwxr-x---  3 oracle oinstall  4096 Feb 21 11:31 shared-lib
drwxr-x---  3 oracle oinstall  4096 Feb 21 11:26 tldcache
[oracle@beast JDBC_UPGRADE]$ unzip -d patches p13403295_10205_Generic.zip > /dev/null
[oracle@beast JDBC_UPGRADE]$ ll
total 112
drwxr-xr-x  2 oracle oinstall  4096 Feb 21 11:25 applib
drwxr-x---  9 oracle oinstall  4096 Feb 21 11:26 application-deployments
drwxr-xr-x  2 oracle oinstall  4096 Feb 21 11:25 applications
drwxr-xr-x  3 oracle oinstall  4096 Feb 21 12:07 config
drwxr-xr-x  4 oracle oinstall  4096 Feb 21 11:25 connectors
drwxr-xr-x  3 oracle oinstall  4096 Feb 21 11:26 log
-rw-r--r--  1 oracle oinstall 26445 Feb 21  2012 p13403295_10205_Generic.zip
drwxr-xr-x  3 oracle oinstall  4096 Feb 21 12:12 patches
drwxr-xr-x  3 oracle oinstall  4096 Feb 21 11:26 persistence
drwxr-x---  3 oracle oinstall  4096 Feb 21 11:31 shared-lib
drwxr-x---  3 oracle oinstall  4096 Feb 21 11:26 tldcache
[oracle@beast JDBC_UPGRADE]$
[oracle@beast JDBC_UPGRADE]$ cd shared-lib/oracle.jdbc/10.2.0.5.0/
[oracle@beast 10.2.0.5.0]$ ll
total 1544
-rw-r-----  1 oracle oinstall 1569316 Feb 21 11:31 ojdbc14.jar
[oracle@beast 10.2.0.5.0]$ cp ojdbc14.jar ojdbc14.p13403295.jar
[oracle@beast 10.2.0.5.0]$ ll
total 3088
-rw-r-----  1 oracle oinstall 1569316 Feb 21 11:31 ojdbc14.jar
-rw-r-----  1 oracle oinstall 1569316 Feb 21 11:35 ojdbc14.p13403295.jar
[oracle@beast 10.2.0.5.0]$ jar uvf ojdbc14.p13403295.jar ../../../patches/13403295/files/jdbc/lib/ojdbc14.jar/*
adding: ../../../patches/13403295/files/jdbc/lib/ojdbc14.jar/oracle/(in = 0) (out= 0)(stored 0%)
adding: ../../../patches/13403295/files/jdbc/lib/ojdbc14.jar/oracle/net/(in = 0) (out= 0)(stored 0%)
adding: ../../../patches/13403295/files/jdbc/lib/ojdbc14.jar/oracle/net/ns/(in = 0) (out= 0)(stored 0%)
adding:
 
../../../patches/13403295/files/jdbc/lib/ojdbc14.jar/oracle/net/ns/NetException.class(in
 = 4557) (out= 1969)(deflated 56%)
[oracle@beast 10.2.0.5.0]$ ll
total 3088
-rw-r-----  1 oracle oinstall 1569316 Feb 21 11:31 ojdbc14.jar
-rw-r--r--  1 oracle oinstall 1572093 Feb 21 11:39 ojdbc14.p13403295.jar
[oracle@beast 10.2.0.5.0]$ cd ../../../config
[oracle@beast config]$ cp server.xml server.xml.old.1
[oracle@beast config]$ opmnctl stopproc process-type=JDBC_UPGRADE
opmnctl: stopping opmn managed processes...
[oracle@beast config]$ grep -l ojdbc14.jar server.xml | xargs sed -i 's/ojdbc14.jar/ojdbc14.p13403295.jar/g'
[oracle@beast config]$ opmnctl startproc process-type=JDBC_UPGRADE
opmnctl: starting opmn managed processes...
[oracle@beast config]$ cd ..
[oracle@beast JDBC_UPGRADE]$ rm p13403295_10205_Generic.zip
[oracle@beast JDBC_UPGRADE]$ 

Note: 


1. The jar command will update the driver jar with the patches. If your using another driver i.e. ojdbc5.jar, then ensure you grab the classes from the ojdbc5.jar directory i.e. ../../../patches/13403295/files/jdbc/lib/ojdbc5.jar/*

2. In server.xml we simply make the following change:
[oracle@beast config]$ diff server.xml server.xml.old.1
125c125
<               <code-source path="ojdbc14.p13403295.jar"/>
---
>               <code-source path="ojdbc14.jar"/>
[oracle@beast config]$ 
 
Once the oc4j instance has started up again, it will use the patched jar - ojdbc14.p13403295.jar. We can simply switch back to original if needed.

Building sudo - make[1]: *** [visudo] Error 1

Posted by Steve Racanovic | Posted in | Posted on 2:20 PM

0

I needed to build sudo today and when I started building it, I received this fatal error:

-bash-3.00# echo $PATH
/usr/sbin:/usr/bin:/sbin:/bin:/usr/sfw/bin:/usr/ccs/bin:/usr/local/bin
-bash-3.00# make
for d in compat common  plugins/sudoers src include doc plugins/sample plugins/sample_group; \
    do (cd $d && exec make all) && continue; \
    exit $?; \
done
make[1]: Entering directory `/export/home/oracle/sudo-1.8.4/compat'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/export/home/oracle/sudo-1.8.4/compat'
make[1]: Entering directory `/export/home/oracle/sudo-1.8.4/common'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/export/home/oracle/sudo-1.8.4/common'
make[1]: Entering directory `/export/home/oracle/sudo-1.8.4/plugins/sudoers'
/bin/bash ../../libtool --mode=link gcc -o visudo visudo.o goodpath.o find_path.o error.o  libparsesudoers.la ../../common/libcommon.la ../../compat/libreplace.la  -lsocket -lnsl
libtool: link: gcc -o visudo visudo.o goodpath.o find_path.o error.o  ./.libs/libparsesudoers.a ../../common/.libs/libcommon.a ../../compat/.libs/libreplace.a -lsocket -lnsl
Undefined                       first referenced
 symbol                             in file
libintl_textdomain                  visudo.o
libintl_bindtextdomain              visudo.o
libintl_dgettext                    visudo.o
ld: fatal: Symbol referencing errors. No output written to visudo
collect2: ld returned 1 exit status
make[1]: *** [visudo] Error 1
make[1]: Leaving directory `/export/home/oracle/sudo-1.8.4/plugins/sudoers'
make: *** [all] Error 2
-bash-3.00# pwd
/export/home/oracle/sudo-1.8.4

After changing the path as follows, it worked:

-bash-3.00# export PATH=/usr/sbin:/usr/bin:/sbin:/bin:/usr/ccs/bin:/usr/ccs/lib:/usr/include:/usr/sfw/bin:/usr/local/sbin:/usr/local/bin

-bash-3.00# make

for d in compat common  plugins/sudoers src include doc plugins/sample plugins/sample_group; \

    do (cd $d && exec make all) && continue; \

    exit $?; \

done

-bash-3.00# make install

for d in compat common  plugins/sudoers src include doc; \

    do (cd $d && exec make pre-install) && continue; \

    exit $?; \

done

for d in compat common  plugins/sudoers src include doc; \

    do (cd $d && exec make install) && continue; \

    exit $?; \

done

/bin/bash ../../mkinstalldirs /usr/local/libexec \

    /usr/local/sbin /usr/local/bin \

    /etc /usr/local/share/doc/sudo \

    `echo /var/lib/sudo|sed 's,/[^/]*$,,'`

/bin/bash ../../install-sh -c -d -O 0 -G 0 -m 0700 /var/lib/sudo

if [ X".so" != X"" ]; then \

    /bin/bash ../../install-sh -c -b~ -O 0 -G 0 -m 0755 .libs/sudoers.so /usr/local/libexec; \

fi

/bin/bash ../../install-sh -c -b~ -O 0 -G 0 -M 0111 sudoreplay /usr/local/bin/sudoreplay

/bin/bash ../../install-sh -c -b~ -O 0 -G 0 -M 0111 visudo /usr/local/sbin/visudo

/bin/bash ../../install-sh -c -d -O 0 -G 0 -m 0750 \

    /etc/sudoers.d

test -r /etc/sudoers || \

    /bin/bash ../../install-sh -c -O 0 -G 0 -m 0440 \

        sudoers /etc/sudoers

#/bin/bash ../../install-sh -c -O 0 -G 0 -m 0555 ./sudoers2ldif /usr/local/share/doc/sudo

/bin/bash ../mkinstalldirs /usr/local/bin \

    /usr/local/libexec

/bin/bash ../install-sh -c -b~ -O 0 -G 0 -M 04111 sudo /usr/local/bin/sudo

rm -f /usr/local/bin/sudoedit

ln /usr/local/bin/sudo /usr/local/bin/sudoedit

if [ -f sesh ]; then /bin/bash ../install-sh -c -b~ -O 0 -G 0 -M 0111 sesh /usr/local/libexec/sesh; fi

if [ -f .libs/libsudo_noexec.so ]; then /bin/bash ../install-sh -c -b~ -O 0 -G 0 -m 0755 .libs/libsudo_noexec.so /usr/local/libexec/sudo_noexec.so; fi

/bin/bash ../mkinstalldirs /usr/local/include

/bin/bash ../install-sh -c -O 0 -G 0 -m 0444 ./sudo_plugin.h /usr/local/include

/bin/bash ../mkinstalldirs /usr/local/share/doc/sudo \

    /usr/local/man/man1m /usr/local/man/man4

mkdir /usr/local/man

mkdir /usr/local/man/man1m

mkdir /usr/local/man/man4

for f in ../ChangeLog ../README  ../NEWS ./HISTORY ./CONTRIBUTORS  ./LICENSE ./TROUBLESHOOTING ./UPGRADE  ./sample.*; do /bin/bash ../install-sh -c -O 0 -G 0 -m 0444 $f /usr/local/share/doc/sudo; done

#for f in ../README.LDAP ./schema.*; do /bin/bash ../install-sh -c -O 0 -G 0 -m 0444 $f /usr/local/share/doc/sudo; done

/bin/bash ../install-sh -c -O 0 -G 0 -m 0444 ./sudo.man /usr/local/man/man1m/sudo.1m

ln /usr/local/man/man1m/sudo.1m /usr/local/man/man1m/sudoedit.1m

/bin/bash ../install-sh -c -O 0 -G 0 -m 0444 ./sudo_plugin.man /usr/local/man/man1m/sudo_plugin.1m

/bin/bash ../install-sh -c -O 0 -G 0 -m 0444 ./sudoreplay.man /usr/local/man/man1m/sudoreplay.1m

/bin/bash ../install-sh -c -O 0 -G 0 -m 0444 ./visudo.man /usr/local/man/man1m/visudo.1m

/bin/bash ../install-sh -c -O 0 -G 0 -m 0444 ./sudoers.man /usr/local/man/man4/sudoers.4

#/bin/bash ../install-sh -c -O 0 -G 0 -m 0444 ./sudoers.ldap.man /usr/local/man/man4/sudoers.ldap.4

-bash-3.00# which sudo

/usr/local/bin/sudo

-bash-3.00# which visudo

/usr/local/sbin/visudo

-bash-3.00#