Issue 105738 - ucb: suspicious && || in NeonSession.cxx
Summary: ucb: suspicious && || in NeonSession.cxx
Status: CLOSED FIXED
Alias: None
Product: ucb
Classification: Code
Component: code (show other issues)
Version: DEV300m61
Hardware: All Linux, all
: P3 Trivial (vote)
Target Milestone: OOo 3.3
Assignee: caolanm
QA Contact: issues@ucb
URL:
Keywords:
Depends on:
Blocks: 96084
  Show dependency tree
 
Reported: 2009-10-08 17:09 UTC by caolanm
Modified: 2010-01-08 09:30 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
silence warnings, if what we have is what we want (774 bytes, patch)
2009-10-08 17:11 UTC, caolanm
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description caolanm 2009-10-08 17:09:51 UTC
in NeonSession.cxx we've got...

bCanUseSystemCreds = (attempt == 0) && 
   ne_has_support( NE_FEATURE_SSPI ) && 
   ( ne_strcasecmp( inAuthProtocol, "NTLM" ) == 0 ) ||
   ( ne_strcasecmp( inAuthProtocol, "Negotiate" ) == 0 );

i.e. this is parsed as...

bCanUseSystemCreds = ((attempt == 0) && 
   ne_has_support( NE_FEATURE_SSPI ) && 
   ( ne_strcasecmp( inAuthProtocol, "NTLM" ) == 0 )) ||
   ( ne_strcasecmp( inAuthProtocol, "Negotiate" ) == 0 );

is that definitely the intent ? If so patch to remove new gcc warning attached.
Comment 1 caolanm 2009-10-08 17:11:20 UTC
Created attachment 65252 [details]
silence warnings, if what we have is what we want
Comment 2 kai.sommerfeld 2009-10-09 08:28:10 UTC
cmc: Good catch. The current logic is indeed *not* intended. Thanks for the patch.
Comment 3 kai.sommerfeld 2009-10-09 08:32:24 UTC
cmc: Forgot to mention that I will not apply your patch (because it implements
the wrong logic - just without compiler warnings), but will fix the code myself.
Comment 4 kai.sommerfeld 2009-10-09 08:34:53 UTC
-> DEFECT.
Comment 5 kai.sommerfeld 2009-10-13 12:32:41 UTC
Fixed. =>

bCanUseSystemCreds = (attempt == 0) && 
   ne_has_support( NE_FEATURE_SSPI ) && 
   ( ( ne_strcasecmp( inAuthProtocol, "NTLM" ) == 0 ) ||
     ( ne_strcasecmp( inAuthProtocol, "Negotiate" ) == 0 ) );
Comment 6 Stephan Bergmann 2009-12-11 08:22:46 UTC
@cmc: please verify on CWS sb116
Comment 7 caolanm 2009-12-11 09:00:38 UTC
sane in sb116
Comment 8 caolanm 2010-01-08 09:30:28 UTC
integrated m69, closing