libselinux - return EINVAL if invalid role selected
PATCH 1/1 libselinux - return EINVAL if invalid role selected
For get_default_context_with_role(3) and get_default_context_with_rolelevel(3), return errno = EINVAL if invalid role.
--- libselinux/src/get_context_list.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
libselinux/src/get_context_list.c +3 -1
@@ -38,8 +38,10 @@ int get_default_context_with_role(const char *user, } rc =-1 ; -if (!(*ptr)) +if (!(*ptr)) { + errno =EINVAL ; goto out; + } *newcon =strdup (*ptr);if (!(*newcon)) goto out;
Signature · 10 lines
1.7.7.1 -- 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.
Eric Paris
AppliedApplied to my devel branch
Quoted 30 lines · Richard Haines
For
get_default_context_with_role(3)andget_default_context_with_rolelevel(3), return errno = EINVAL if invalid role.Signed-off-by Richard Haines <[email protected]>---
libselinux/src/get_context_list.c | 4 +++-1 files changed, 3 insertions(+), 1 deletions(-)libselinux/src/get_context_list.c +3
-2@@ -38,8 +38,10 @@ int get_default_context_with_role(const char *user, } rc = -1; - if (!(*ptr)) + if (!(*ptr)) { + errno = EINVAL; goto out; + } *newcon = strdup(*ptr); if (!(*newcon)) goto out; --1.7.7.1
Quoted 4 lines
--
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.
--
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.