diff options
author | Nathan Scott <nathans@sgi.com> | 2003-02-27 02:41:22 +0000 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2003-02-27 02:41:22 +0000 |
commit | 1b200578a5ef4241a4c91a82bd5898a9230d06c5 (patch) | |
tree | 49a5b32c25407cde4477f724b2c7b071fc95076a /libacl | |
parent | 94e247b50e006004dbc1e3345bc4ec7dfbf03b1d (diff) | |
download | acl-1b200578a5ef4241a4c91a82bd5898a9230d06c5.tar.gz |
Make libacl routines more robust in the presence of callers who don't
check for failed function return codes and then call back into libacl.
Diffstat (limited to 'libacl')
-rw-r--r-- | libacl/acl_create_entry.c | 2 | ||||
-rw-r--r-- | libacl/acl_get_entry.c | 5 | ||||
-rw-r--r-- | libacl/acl_get_permset.c | 5 |
3 files changed, 10 insertions, 2 deletions
diff --git a/libacl/acl_create_entry.c b/libacl/acl_create_entry.c index d750465..c4ef77f 100644 --- a/libacl/acl_create_entry.c +++ b/libacl/acl_create_entry.c @@ -56,6 +56,8 @@ acl_create_entry(acl_t *acl_p, acl_entry_t *entry_p) acl_obj *acl_obj_p; acl_entry_obj *entry_obj_p; if (!acl_p || !entry_p) { + if (entry_p) + *entry_p = NULL; errno = EINVAL; return -1; } diff --git a/libacl/acl_get_entry.c b/libacl/acl_get_entry.c index 05a84d0..cc49764 100644 --- a/libacl/acl_get_entry.c +++ b/libacl/acl_get_entry.c @@ -27,8 +27,11 @@ int acl_get_entry(acl_t acl, int entry_id, acl_entry_t *entry_p) { acl_obj *acl_obj_p = ext2int(acl, acl); - if (!acl_obj_p) + if (!acl_obj_p) { + if (entry_p) + *entry_p = NULL; return -1; + } if (!entry_p) { errno = EINVAL; return -1; diff --git a/libacl/acl_get_permset.c b/libacl/acl_get_permset.c index f1921c4..cd3a666 100644 --- a/libacl/acl_get_permset.c +++ b/libacl/acl_get_permset.c @@ -27,8 +27,11 @@ int acl_get_permset(acl_entry_t entry_d, acl_permset_t *permset_p) { acl_entry_obj *entry_obj_p = ext2int(acl_entry, entry_d); - if (!entry_obj_p) + if (!entry_obj_p) { + if (permset_p) + *permset_p = NULL; return -1; + } if (!permset_p) { errno = EINVAL; return -1; |