5 |
* |
* |
6 |
* Copyright (C) 2005-2007 NTT DATA CORPORATION |
* Copyright (C) 2005-2007 NTT DATA CORPORATION |
7 |
* |
* |
8 |
* Version: 1.5.0-pre 2007/08/17 |
* Version: 1.5.0-pre 2007/09/13 |
9 |
* |
* |
10 |
* This file is applicable to both 2.4.30 and 2.6.11 and later. |
* This file is applicable to both 2.4.30 and 2.6.11 and later. |
11 |
* See README.ccs for ChangeLog. |
* See README.ccs for ChangeLog. |
85 |
|
|
86 |
/************************* UTILITY FUNCTIONS *************************/ |
/************************* UTILITY FUNCTIONS *************************/ |
87 |
|
|
|
int IsDomainDef(const unsigned char *buffer) |
|
|
{ |
|
|
/* while (*buffer && (*buffer <= ' ' || *buffer >= 127)) buffer++; */ |
|
|
return strncmp(buffer, ROOT_NAME, ROOT_NAME_LEN) == 0; |
|
|
} |
|
|
|
|
88 |
const char *GetLastName(const struct domain_info *domain) |
const char *GetLastName(const struct domain_info *domain) |
89 |
{ |
{ |
90 |
const char *cp0 = domain->domainname->name, *cp1; |
const char *cp0 = domain->domainname->name, *cp1; |
92 |
return cp0; |
return cp0; |
93 |
} |
} |
94 |
|
|
|
int ReadSelfDomain(struct io_buffer *head) |
|
|
{ |
|
|
if (!head->read_eof) { |
|
|
io_printf(head, "%s", current->domain_info->domainname->name); |
|
|
head->read_eof = 1; |
|
|
} |
|
|
return 0; |
|
|
} |
|
|
|
|
95 |
int AddDomainACL(struct acl_info *ptr, struct domain_info *domain, struct acl_info *new_ptr) |
int AddDomainACL(struct acl_info *ptr, struct domain_info *domain, struct acl_info *new_ptr) |
96 |
{ |
{ |
97 |
mb(); /* Instead of using spinlock. */ |
mb(); /* Instead of using spinlock. */ |
520 |
|
|
521 |
/************************* DOMAIN TRANSITION HANDLER *************************/ |
/************************* DOMAIN TRANSITION HANDLER *************************/ |
522 |
|
|
|
struct domain_info *FindDomain(const char *domainname0) |
|
|
{ |
|
|
struct domain_info *domain; |
|
|
static int first = 1; |
|
|
struct path_info domainname; |
|
|
domainname.name = domainname0; |
|
|
fill_path_info(&domainname); |
|
|
if (first) { |
|
|
KERNEL_DOMAIN.domainname = SaveName(ROOT_NAME); |
|
|
first = 0; |
|
|
} |
|
|
for (domain = &KERNEL_DOMAIN; domain; domain = domain->next) { |
|
|
if (!domain->is_deleted && !pathcmp(&domainname, domain->domainname)) return domain; |
|
|
} |
|
|
return NULL; |
|
|
} |
|
|
|
|
523 |
struct domain_info *FindOrAssignNewDomain(const char *domainname, const u8 profile) |
struct domain_info *FindOrAssignNewDomain(const char *domainname, const u8 profile) |
524 |
{ |
{ |
525 |
struct domain_info *domain = NULL; |
struct domain_info *domain = NULL; |