オープンソース・ソフトウェアの開発とダウンロード

Subversion リポジトリの参照

Diff of /trunk/1.8.x/ccs-patch/security/ccsecurity/memory.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

branches/ccs-patch/security/ccsecurity/memory.c revision 3698 by kumaneko, Tue May 25 12:22:08 2010 UTC trunk/1.8.x/ccs-patch/security/ccsecurity/memory.c revision 3924 by kumaneko, Thu Aug 26 11:01:19 2010 UTC
# Line 3  Line 3 
3   *   *
4   * Copyright (C) 2005-2010  NTT DATA CORPORATION   * Copyright (C) 2005-2010  NTT DATA CORPORATION
5   *   *
6   * Version: 1.7.2+   2010/05/10   * Version: 1.8.0-pre   2010/08/01
7   *   *
8   * 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.
9   * See README.ccs for ChangeLog.   * See README.ccs for ChangeLog.
# Line 106  struct ccs_group *ccs_get_group(const ch Line 106  struct ccs_group *ccs_get_group(const ch
106          struct ccs_group e = { };          struct ccs_group e = { };
107          struct ccs_group *group = NULL;          struct ccs_group *group = NULL;
108          bool found = false;          bool found = false;
109          if (!ccs_correct_path(group_name, 0, 0, 0) ||          if (!ccs_correct_word(group_name) || idx >= CCS_MAX_GROUP)
             !group_name[0] || idx >= CCS_MAX_GROUP)  
110                  return NULL;                  return NULL;
111          e.group_name = ccs_get_name(group_name);          e.group_name = ccs_get_name(group_name);
112          if (!e.group_name)          if (!e.group_name)
# Line 241  void __init ccs_mm_init(void) Line 240  void __init ccs_mm_init(void)
240          int idx;          int idx;
241          for (idx = 0; idx < CCS_MAX_HASH; idx++)          for (idx = 0; idx < CCS_MAX_HASH; idx++)
242                  INIT_LIST_HEAD(&ccs_name_list[idx]);                  INIT_LIST_HEAD(&ccs_name_list[idx]);
243          INIT_LIST_HEAD(&ccs_global_domain.acl_info_list);          for (idx = 0; idx < CCS_MAX_ACL_GROUPS; idx++) {
244          INIT_LIST_HEAD(&ccs_kernel_domain.acl_info_list);                  INIT_LIST_HEAD(&ccs_acl_group[idx].acl_info_list[0]);
245          ccs_kernel_domain.domainname = ccs_get_name(ROOT_NAME);                  INIT_LIST_HEAD(&ccs_acl_group[idx].acl_info_list[1]);
246            }
247            INIT_LIST_HEAD(&ccs_kernel_domain.acl_info_list[0]);
248            INIT_LIST_HEAD(&ccs_kernel_domain.acl_info_list[1]);
249            ccs_kernel_domain.domainname = ccs_get_name(CCS_ROOT_NAME);
250          list_add_tail_rcu(&ccs_kernel_domain.list, &ccs_domain_list);          list_add_tail_rcu(&ccs_kernel_domain.list, &ccs_domain_list);
251          idx = ccs_read_lock();          idx = ccs_read_lock();
252          if (ccs_find_domain(ROOT_NAME) != &ccs_kernel_domain)          if (ccs_find_domain(CCS_ROOT_NAME) != &ccs_kernel_domain)
253                  panic("Can't register ccs_kernel_domain");                  panic("Can't register ccs_kernel_domain");
254          {          {
255                  /* Load built-in policy. */                  /* Load built-in policy. */
# Line 258  void __init ccs_mm_init(void) Line 261  void __init ccs_mm_init(void)
261                          char *cp2 = strchr(cp, ' ');                          char *cp2 = strchr(cp, ' ');
262                          if (cp2)                          if (cp2)
263                                  *cp2++ = '\0';                                  *cp2++ = '\0';
264                          ccs_write_domain_initializer(cp, false, false);                          ccs_write_transition_control(cp, false,
265                                         CCS_TRANSITION_CONTROL_INITIALIZE);
266                          cp = cp2;                          cp = cp2;
267                  }                  }
268          }          }
# Line 300  void ccs_read_memory_counter(struct ccs_ Line 304  void ccs_read_memory_counter(struct ccs_
304          };          };
305          unsigned int total = 0;          unsigned int total = 0;
306          int i;          int i;
307          if (head->read_eof)          if (head->r.eof)
308                  return;                  return;
309          for (i = 0; i < 3; i++) {          for (i = 0; i < 3; i++) {
310                  total += usage[i];                  total += usage[i];
# Line 310  void ccs_read_memory_counter(struct ccs_ Line 314  void ccs_read_memory_counter(struct ccs_
314                  ccs_io_printf(head, "\n");                  ccs_io_printf(head, "\n");
315          }          }
316          ccs_io_printf(head, "%s %10u\n", header[3], total);          ccs_io_printf(head, "%s %10u\n", header[3], total);
317          head->read_eof = true;          head->r.eof = true;
318  }  }
319    
320  /**  /**

Legend:
Removed from v.3698  
changed lines
  Added in v.3924

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26