selinux: return proper error codes instead of -1
Get series with b4
b4 am 20100612184910.GO5483@bickerVersions newest first · linked by author and title
- v2 Latest7 patches 2 repliesIn review
- v17 patches 9 repliesSuperseded
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | selinux: cleanup return codes in avtab_read_item()security/ | +19 | 0 replies | |
| 2/7 | selinux: propagate error codes in cond_read_list()security/ | +6 | 0 replies | |
| 3/7 | selinux: fix error codes in cond_read_av_list()security/ | +8 | 0 replies | |
| 4/7 | selinux: fix error codes in cond_read_node()security/ | +12 | 0 replies | |
| 5/7 | selinux: fix error codes in cond_policydb_init()security/ | +6 | 0 replies | |
| 6/7 | selinux: fix error codes in cond_read_bool()security/ | +8 | 0 replies | |
| 7/7 | selinux: fix error codes in symtab_init()security/ | +1 | 2 replies |
Reviews trailers per patch
1 of 7 patches has a Reviewed-by or Acked-by.
| Patch | Eric Paris | Stephen D. Smalley |
|---|---|---|
| 1/7 | ||
| 2/7 | ||
| 3/7 | ||
| 4/7 | ||
| 5/7 | ||
| 6/7 | ||
| 7/7 | A-b | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [patch 0/7 v2] selinux: return proper error codes instead of -1
I've respun these patches based on Eric's feedback. It was mostly to use "rc" consistently instead of "ret" and also to use "if (rc)" instead of "if (rc < 0)".
One thing which I didn't really change was in [patch 3/7].
Quoted 5 lines · Eric Paris
I'm not in love with this one. The change in
cond_read_av_list()is fine, but the style and completeness incond_insertfI think is even worse. My biggest problem is the fact that you sent an error code at the top and just sorta leave it. There are still lots of
Quoted 9 lines
if (
function())goto err;which really should be
rc =
function()
if (rc)goto err;
The problem is those functions in cond_insertf() don't return error codes, they return pointers and NULL. I could put an:
rc = -EINVAL;
in front of each goto but that seems awkward. I did change one of the cond_insertf() returns to -ENOMEM where my first patch left it as -EINVAL, but otherwise I basically left that function the same.
Everything else should be OK though.
regards,
dan carpenter
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.