Project

General

Profile

Bug #8089

RPC: RQCRED_SIZE is not a public interface

Added by Marcel Telka almost 3 years ago. Updated almost 3 years ago.

Status:
In Progress
Priority:
Normal
Assignee:
Category:
lib - userland libraries
Start date:
2017-04-21
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

The RQCRED_SIZE macro is internal for libnsl(3lib) and it should not be used by the libnsl(3lib) consumers.

In the rpc(3nsl) man page it is documented that rq_clntcred is a pointer to the read only cooked cred. IOW it means that the rq_clntcred field contains a valid pointer to the appropriate structure with the auth parameters. The libnsl(3lib) consumers have no reason to check (or assert) the size of such structures against any (arbitrary) values, like RQCRED_SIZE. Unfortunately, with the #8085 fix many (if not all) libnsl(3lib) consumers were modified to do such asserts. This is plain wrong. If there is any problem with the size of the auth parameters structure(s) the libnsl(3lib) should act appropriately internally. If it does not, it should be fixed, similarly as it was done in #8085 by increasing of the RQCRED_SIZE value from 400 to 700.


Related issues

Related to illumos gate - Bug #8085: Handle RPC groups betterClosed2017-04-19

Actions

History

#1

Updated by Marcel Telka almost 3 years ago

  • Related to Bug #8085: Handle RPC groups better added
#2

Updated by Joshua M. Clulow almost 3 years ago

In this case, it seems like it's an invariant that the backing storage for rq_clntcred needs to be big enough for all of the consumers which cast that storage to a particular type. Why would we not want to assert, at build time, that the code is correct?

The header file into which RQCRED_SIZE was moved is probably not the best venue, and we could move it into an internal header file which we do not ship. But the software is otherwise entirely in-gate -- can you explain why we can't check, at compile time, that the invariant holds?

#3

Updated by Gordon Ross almost 3 years ago

Would prepending an underscore to the name satisfy your concerns?

#4

Updated by Marcel Telka almost 3 years ago

Joshua, Gordon, redmine bug report is not a good tool for discussions. Please raise your questions and/or concerns using some better channel, like the illumos-dev mailing list. Thanks.

#5

Updated by Joshua M. Clulow almost 3 years ago

We've asked you to better explain the justification for your bug report, which is here. If this is still a bug, please just answer the questions.

#6

Updated by Marcel Telka almost 3 years ago

  • Description updated (diff)

Also available in: Atom PDF