Bug 689952 - Incorrect bit check in replication connection code
Summary: Incorrect bit check in replication connection code
Status: CLOSED CURRENTRELEASE
Alias: None
Product: 389
Classification: Retired
Component: Replication - General
Version: 1.2.8
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: ---
Assignee: Nathan Kinder
QA Contact: Viktor Ashirov
URL:
Whiteboard:
Keywords:
Depends On:
Blocks: 389_1.2.8 690319
TreeView+ depends on / blocked
 
Reported: 2011-03-22 20:45 UTC by Nathan Kinder
Modified: 2015-12-07 16:48 UTC (History)
1 user (show)

(edit)
Clone Of:
(edit)
Last Closed: 2015-12-07 16:48:12 UTC


Attachments (Terms of Use)
Patch for cov#10581 (1.61 KB, patch)
2011-03-22 20:50 UTC, Nathan Kinder
nhosoi: review+
Details | Diff

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.


Note You need to log in before you can comment on or make changes to this bug.