[unixODBC-dev] problem with using ODBCINI env var

Chris Pinkenburg pinkenburg at bnl.gov
Wed Sep 17 14:50:32 BST 2008


Hi Nick,

will do. Thanks for checking

Chris

Nick Gorham wrote:
> Chris Pinkenburg wrote:
> 
>> Dear All,
>>
>> in our setup we have a few pre-canned odbc.ini files and users set the
>> ODBCINI variable if they need to use a different one from the default.
>>
>> The problem we encountered is that currently this file is opened in
>> append mode which fails if the file is read only. I tracked this down to
>> odbcinst/_odbcinst_UserINI.c in line 90:
>>
>> hFile = uo_fopen( pszFileName, "a" );
>>
>> I changed it to
>>
>> hFile = uo_fopen( pszFileName, "r" );
>>
>> and things work nicely (also new users don't end up with an empty
>> .odbc.ini file in their $HOME dir anymore). VMS is handled separately
>> and under VMS this file is already (has always been?) opened read only.
>> Is there a reason to open this file in append mode by default?
>>
>> Regards
>>
>> Chris
>>
>>
>>
>>
>>  
>>
> I just checked, its different in 2.2.13pre, you might like to try that. 
> It needs to open in a writable mode though, as the api allows writing to 
> the ini file. But I can see no problem for you if you alter your copy.
> 



-- 

*************************************************************

Christopher H. Pinkenburg       ;   pinkenburg at bnl.gov
                                 ;   http://www.phenix.bnl.gov/~pinkenbu/
Brookhaven National Laboratory  ;   phone: (631) 344-5692
Physics Department Bldg 510 C   ;   fax:   (631) 344-3253
Upton, NY 11973-5000

*************************************************************




More information about the unixODBC-dev mailing list