diff options
Diffstat (limited to 'security/selinux/ss')
-rw-r--r-- | security/selinux/ss/policydb.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c index fd62c50d6e7d..a493eae24e0a 100644 --- a/security/selinux/ss/policydb.c +++ b/security/selinux/ss/policydb.c | |||
@@ -2535,8 +2535,9 @@ static int cat_write(void *vkey, void *datum, void *ptr) | |||
2535 | return 0; | 2535 | return 0; |
2536 | } | 2536 | } |
2537 | 2537 | ||
2538 | static int role_trans_write(struct role_trans *r, void *fp) | 2538 | static int role_trans_write(struct policydb *p, void *fp) |
2539 | { | 2539 | { |
2540 | struct role_trans *r = p->role_tr; | ||
2540 | struct role_trans *tr; | 2541 | struct role_trans *tr; |
2541 | u32 buf[3]; | 2542 | u32 buf[3]; |
2542 | size_t nel; | 2543 | size_t nel; |
@@ -2556,6 +2557,12 @@ static int role_trans_write(struct role_trans *r, void *fp) | |||
2556 | rc = put_entry(buf, sizeof(u32), 3, fp); | 2557 | rc = put_entry(buf, sizeof(u32), 3, fp); |
2557 | if (rc) | 2558 | if (rc) |
2558 | return rc; | 2559 | return rc; |
2560 | if (p->policyvers >= POLICYDB_VERSION_ROLETRANS) { | ||
2561 | buf[0] = cpu_to_le32(tr->tclass); | ||
2562 | rc = put_entry(buf, sizeof(u32), 1, fp); | ||
2563 | if (rc) | ||
2564 | return rc; | ||
2565 | } | ||
2559 | } | 2566 | } |
2560 | 2567 | ||
2561 | return 0; | 2568 | return 0; |
@@ -3267,7 +3274,7 @@ int policydb_write(struct policydb *p, void *fp) | |||
3267 | if (rc) | 3274 | if (rc) |
3268 | return rc; | 3275 | return rc; |
3269 | 3276 | ||
3270 | rc = role_trans_write(p->role_tr, fp); | 3277 | rc = role_trans_write(p, fp); |
3271 | if (rc) | 3278 | if (rc) |
3272 | return rc; | 3279 | return rc; |
3273 | 3280 | ||