Bug 689952

Summary: Incorrect bit check in replication connection code
Product: [Retired] 389 Reporter: Nathan Kinder <nkinder>
Component: Replication - GeneralAssignee: Nathan Kinder <nkinder>
Status: CLOSED CURRENTRELEASE QA Contact: Viktor Ashirov <vashirov>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 1.2.8CC: rmeggins
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-07 16:48:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 656390, 690319    
Attachments:
Description Flags
Patch for cov#10581 nhosoi: review+

Description Nathan Kinder 2011-03-22 20:45:26 UTC
In the replication connection code, we do a bit check that is incorrect.  We currently have this in repl5_connection.c at line 540:

  } else if ((rc < 0) || ((polldesc.out_flags|PR_POLL_WRITE) == 0)) { /* error */
      slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
      ...

The problem is that "((polldesc.out_flags|PR_POLL_WRITE) == 0))" will always be false since PR_POLL_WRITE is defined as 2.  We should be using the following condition instead to check if out_flags does not have PR_POLL_WRITE set:

    (!(polldesc.out_flags&PR_POLL_WRITE))

Comment 1 Nathan Kinder 2011-03-22 20:50:44 UTC
Created attachment 486894 [details]
Patch for cov#10581

Comment 2 Nathan Kinder 2011-03-22 20:58:18 UTC
Pushed patch to master.  Thanks to Noriko for her review!

Counting objects: 13, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 931 bytes, done.
Total 7 (delta 5), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
   09bc822..b41338f  master -> master

Comment 3 Rich Megginson 2011-03-23 01:28:49 UTC
Do we want to get this into 1.2.8?

Comment 4 Nathan Kinder 2011-03-23 15:33:40 UTC
(In reply to comment #3)
> Do we want to get this into 1.2.8?

I'm not really sure if it's a critical issue or not, as I don't know how common it would be for the PR_POLL_WRITE flag to not be set in this case.  Do you think it should go into 1.2.8?

Comment 5 Rich Megginson 2011-03-23 15:39:22 UTC
I don't think it is critical.  It can wait.

Comment 6 Rich Megginson 2011-06-06 21:15:07 UTC
How can QE verify this bug?  Is there a bug that can be reproduced?  If not, I say we just mark this as verified by code inspection.

Comment 7 Nathan Kinder 2011-06-06 21:47:44 UTC
(In reply to comment #6)
> How can QE verify this bug?  Is there a bug that can be reproduced?  If not, I
> say we just mark this as verified by code inspection.

Yes, we should just mark it verified by code inspection.  This was found by a Coverity scan.