Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 113653
b: refs/heads/master
c: 99d854d
h: refs/heads/master
i:
  113651: 000929c
v: v3
  • Loading branch information
Paul Moore committed Oct 10, 2008
1 parent e039d72 commit d445deb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d8395c876bb8a560c8a032887e191b95499a25d6
refs/heads/master: 99d854d231ce141850b988bdc7e2e7c78f49b03a
10 changes: 8 additions & 2 deletions trunk/security/selinux/ss/services.c
Original file line number Diff line number Diff line change
Expand Up @@ -2785,18 +2785,24 @@ int security_netlbl_secattr_to_sid(struct netlbl_lsm_secattr *secattr,
*/
int security_netlbl_sid_to_secattr(u32 sid, struct netlbl_lsm_secattr *secattr)
{
int rc = -ENOENT;
int rc;
struct context *ctx;

if (!ss_initialized)
return 0;

read_lock(&policy_rwlock);
ctx = sidtab_search(&sidtab, sid);
if (ctx == NULL)
if (ctx == NULL) {
rc = -ENOENT;
goto netlbl_sid_to_secattr_failure;
}
secattr->domain = kstrdup(policydb.p_type_val_to_name[ctx->type - 1],
GFP_ATOMIC);
if (secattr->domain == NULL) {
rc = -ENOMEM;
goto netlbl_sid_to_secattr_failure;
}
secattr->flags |= NETLBL_SECATTR_DOMAIN_CPY;
mls_export_netlbl_lvl(ctx, secattr);
rc = mls_export_netlbl_cat(ctx, secattr);
Expand Down

0 comments on commit d445deb

Please sign in to comment.