817 |
{ |
{ |
818 |
struct ccs_request_info *r = &ee->r; |
struct ccs_request_info *r = &ee->r; |
819 |
const struct ccs_path_info *handler = ee->handler; |
const struct ccs_path_info *handler = ee->handler; |
820 |
|
struct ccs_domain_info *domain = NULL; |
821 |
const char *old_domain_name = r->domain->domainname->name; |
const char *old_domain_name = r->domain->domainname->name; |
822 |
struct linux_binprm *bprm = ee->bprm; |
struct linux_binprm *bprm = ee->bprm; |
823 |
const u8 mode = r->mode; |
const u8 mode = r->mode; |
824 |
const bool is_enforce = (mode == 3); |
const bool is_enforce = (mode == 3); |
825 |
const u32 ccs_flags = current->ccs_flags; |
const u32 ccs_flags = current->ccs_flags; |
826 |
char *new_domain_name = NULL; |
char *new_domain_name = NULL; |
|
struct ccs_domain_info *domain = NULL; |
|
827 |
struct ccs_path_info rn; /* real name */ |
struct ccs_path_info rn; /* real name */ |
828 |
struct ccs_path_info sn; /* symlink name */ |
struct ccs_path_info sn; /* symlink name */ |
829 |
struct ccs_path_info ln; /* last name */ |
struct ccs_path_info ln; /* last name */ |
958 |
if (domain) |
if (domain) |
959 |
ccs_audit_domain_creation_log(r->domain); |
ccs_audit_domain_creation_log(r->domain); |
960 |
done: |
done: |
961 |
if (domain) { |
if (!domain) { |
962 |
retval = 0; |
printk(KERN_WARNING "TOMOYO-ERROR: Domain '%s' not defined.\n", |
963 |
goto out; |
new_domain_name); |
964 |
} |
if (is_enforce) |
965 |
printk(KERN_WARNING "TOMOYO-ERROR: Domain '%s' not defined.\n", |
retval = -EPERM; |
966 |
new_domain_name); |
else { |
967 |
if (is_enforce) |
retval = 0; |
968 |
retval = -EPERM; |
r->domain->domain_transition_failed = true; |
969 |
else { |
} |
970 |
|
} else { |
971 |
retval = 0; |
retval = 0; |
|
r->domain->domain_transition_failed = true; |
|
972 |
} |
} |
973 |
out: |
out: |
974 |
|
if (domain) |
975 |
|
r->domain = domain; |
976 |
return retval; |
return retval; |
977 |
} |
} |
978 |
|
|