Re: dynamic lib ignored even after "found" in "install_driver(Oracle)failed: Can"t lo

Re: dynamic lib ignored even after "found" in "install_driver(Oracle)failed: Can"t lo

am 31.08.2007 20:35:24 von bsears

--------------080500070607080809070202
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

ahhh... we are getting closer (?)

after running

strace -fFo trace_file /usr/sbin/httpd -X

it looks like it is some sort of permissions problem after all (?)

..
..
..
6177
open("/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /auto/DBD/Oracle/Oracle.so",
O_RDONLY) = 3
6177 read(3,
"\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\360@\0"..., 512) = 512
6177 fstat64(3, {st_mode=S_IFREG|0555, st_size=386943, ...}) = 0
6177 old_mmap(NULL, 194448, PROT_READ|PROT_EXEC,
MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x111000
6177 old_mmap(0x140000, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2e000) = 0x140000
6177 close(3) = 0
6177
open("/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libc lntsh.so.10.1",
O_RDONLY) = -1 ENOENT (No such file or directory)
6177 open("/etc/ld.so.cache", O_RDONLY) = 3
6177 fstat64(3, {st_mode=S_IFREG|0644, st_size=82246, ...}) = 0
6177 old_mmap(NULL, 82246, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7ecf000
6177 close(3) = 0
6177 open("/usr/local/instantclient_10_2/libclntsh.so.10.1", O_RDONLY)
= -1 EACCES (Permission denied)
6177 open("/lib/tls/i686/sse2/libclntsh.so.10.1", O_RDONLY) = -1 ENOENT
(No such file or directory)
..
..
..

weird. it looks to me like apache SHOULD have read access to this file,
but it doesn't. am i missing some sort of configuration detail
regarding apache and permissions granted a cgi? i thought once the
server started a cgi, it basically had the run of the place (as much
access to the system as the apache user itself...)

okay, different tack. i edited the /etc/passwd file to set a login
shell for apache so i could su apache. i did this, and i am able to
read libclntsh.so.10.1 (i ran 'od libclntsh.so.10.1', and was not denied
permission. got lots of digits <8 :)

so, at least as a logged in user, apache does have read access to this
library. so why the "Permission denied" when trying to open it for my
test cgi?

big clue finally... i found that if i copied libclntsh.so.10.1 into a
"trusted" library location (/lib in this case, it does load. (and just
making a link to the library in /usr/local/instantclient_10_2/ does not
work, not surprisingly.)) now the failure is at the loading of another
lib in /usr/local/instantclient_10_2/. i'm guessing this must be part
of the apache configuration, so i'll look more carefully in the apache
conf file now...

okay, i found nothing obvious there. but somewhere, something is
configuring these permissions restrictions into the httpd executables.
any ideas anyone? do i really have to move all my libraries into /lib
(or /usr/lib probably works, too... ??)


thanks again for the help,

bruce



Bruce Sears wrote:
> thanks for the input tim (and charles),
>
> i have checked all the permissions, and these should be fine for
> access by the apache user. and when i ran as myself (not root), the
> command line execution did fine, too.
>
> -rwxrwxr-x 1 root root 18825267 Nov 15 2006
> /usr/local/instantclient_10_2/libclntsh.so.10.1
> drwxr-xr-x 4 root root 4096 Aug 30 16:56 /usr/local/instantclient_10_2/
> drwxr-xr-x 20 root root 4096 Aug 30 17:26 /usr/local
> drwxr-xr-x 15 root root 4096 Jun 14 18:03 /usr
> drwxr-xr-x 23 root root 4096 Aug 27 14:38 /
>
> i will try the strace and see what i can see...
>
> thanks again,
>
> bruce
>
>
> Tim Kirby wrote:
>> On 8/30/07 4:51 PM, "Bruce Sears" wrote:
>>
>>
>>> thanks for bearing with this. it's too much detail, but perhaps not
>>> enough (sigh).
>>>
>>
>> Just glancing at this before retiring for the night; someone else will
>> probably give you a real answer, but two things come to mind/might be
>> worth looking at/whatever...
>>
>> (1) have you verified permissions for the library in question for whatever
>> user the CGI is running as? I know the error didn't say permission
>> denied, but you never know...
>>
>> (2) I would feel inclined to run the web server under strace, feeding the
>> output to a file somewhere (make sure you're following children) and
>> run your test case. There you will see the actual system calls that
>> are being invoked and you should see a 'stat' and a real errno as to
>> why it didn't open the library when it should have done. The trouble
>> with debug aids of the kind you're using is it really depends on the
>> people who wrote the debug code to have done the right thing everywhere.
>>
>> Color me cynical.
>>
>> So, there's my $0.02 FWIW. I may be in lala land, but that's what I would
>> be looking at assuming I didn't misread what you posted.
>>
>> Good luck
>>
>> Tim
>>
>


--------------080500070607080809070202--