My problem, Cyrus-SASL via sql plugin with oracle

Woonsan Ko woon_san at yahoo.com
Thu Nov 23 02:22:11 EST 2006


Hi list,

I succeeded in integrating cyrus-sasl with oracle by using libsqlora8, and I attached diff files.

My changes are the followings:

1. cyrus-sasl-2.1.22
  - plugins/sql.c : plugin codes and engine info for oracle were added.
  - plugins/Makefile.am and plugins/Makefile.in : link information for libsqlora8 added.
  - configure.in : --with-oracle option added.
                   So, `configure' need to be regenerated with autoconf.

2. cyrus-imapd-2.3.7
  - master/master.h : #define macros for runtime environment variables added, which are used to
connect via OCI. (e.g. ORACLE_HOME, TNS_ADMIN, etc.) Therefore, before building, these #define
macros need to be modified for the specific environment.
  - master/master.c : some putenv() functions added to put the above environment variables.

The changes for cyrus-sasl-2.1.22 are definitely necessary, but those for cyrus-imapd-2.3.7 are
still in question, as I said in previous mail.

Note: libsqlora8 need to be built with threads option (e.g. `--with-threads=posix').

May it help some people.
Any comment welcomed.

Thanks.


Regards,

Woonsan Ko


--- Woon-San Ko <woon_san at yahoo.com> wrote:

> Hi, all.
> 
> I found the causes of my problems.
> One is that libsqlora8 need to be configured with '--with-threads=posix' option because cyrus
> imapd runs in multithreaded way.
> The other is that environment variables for OCI connection need to provided to the `master'
> process.
> 
> The first problem is very clear.
> However, the second problem is still in question.
> 
> When I tested some getenv() function in `master.c', I found that every environment variable such
> `ORACLE_HOME' or `LD_LIBRARY_PATH' was missing, though I set those variables for the cyrus user.
> 
> Therefore, I added some test codes in the main() function of master.c using `putenv()' function
> to
> add some environment variables ($ORA_HOME, $TNS_ADMIN, $LD_LIBRARY_PATH, etc.), then it finally
> worked fine!
> 
> My question is why `master' process eliminates the environment variables for the cyrus user.
> Is it intended for some reason?
> 
> Could anybody comment on my question?
> 
> Thanks in advance.
> 
> -Woonsan Ko
> 
> 
> --- Woon-San Ko <woon_san at yahoo.com> wrote:
> 
> > Hi, all.
> > 
> > I am going to explain my problem and want to hear some advices.
> > 
> > I have been modifying plugins/sql.c to use oracle.
> > So I changed sql.c, configure.in, and configure (by autoconf).
> > I adopted libsqlora8 (http://www.poitschke.de/libsqlora8/) library to easily use OCI.
> > 
> > When I tested with my stand alone test program using libsqlora8, it works very fine.
> > But when I added some valid code into sql.c, it does not work.
> > 
> > After tedious digging, I found that the OCIEnvCreate (in OCI) function failed returning -1.
> > So, the sqlo_server_attach (in libsqlora8) function could not succeed.
> > 
> > I am not advanced programmer in this field. I guessed the problem might be a security problem
> or
> > an environmental problem.
> > I tried to configure all environment variables for oracle for the cyrus user, by both shell
> > environment settings and programmatic way (by adding some putenv() codes in
> > cyrus-imapd/master/master.c, just for test.), but all failed.
> > 
> > I could not catch any clue. (I'm using cyrus-imapd-2.2.13, cyrus-sasl-2.1.22, GNU/Linux 2.6.11
> > and
> > Oracle 10g.)
> > 
> > Could anybody give me some advice?
> > 
> > TIA.
> > 
> > -Woonsan Ko
> > 
> > 
> >  
> > ____________________________________________________________________________________
> > Sponsored Link
> > 
> > Mortgage rates near 39yr lows. 
> > $310k for $999/mo. Calculate new payment! 
> > www.LowerMyBills.com/lre
> > 
> 
> 
> 
>  
> ____________________________________________________________________________________
> Sponsored Link
> 
> Online degrees - find the right program to advance your career. 
> www.nextag.com
> 


 
____________________________________________________________________________________
Cheap talk?
Check out Yahoo! Messenger's low PC-to-Phone call rates.
http://voice.yahoo.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diffs.zip
Type: application/zip
Size: 6949 bytes
Desc: 1821726-diffs.zip
Url : https://lists.andrew.cmu.edu/mailman/private/cyrus-sasl/attachments/20061122/5c47729a/diffs.zip


More information about the Cyrus-sasl mailing list