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

Subversion リポジトリの参照

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

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

revision 2948 by kumaneko, Mon Aug 24 11:59:18 2009 UTC revision 2951 by kumaneko, Tue Aug 25 04:26:20 2009 UTC
# Line 541  static int ccs_write_manager_policy(stru Line 541  static int ccs_write_manager_policy(stru
541  static void ccs_read_manager_policy(struct ccs_io_buffer *head)  static void ccs_read_manager_policy(struct ccs_io_buffer *head)
542  {  {
543          struct list_head *pos;          struct list_head *pos;
         ccs_assert_read_lock();  
544          if (head->read_eof)          if (head->read_eof)
545                  return;                  return;
546          list_for_each_cookie(pos, head->read_var2, &ccs_policy_manager_list) {          list_for_each_cookie(pos, head->read_var2, &ccs_policy_manager_list) {
# Line 571  static bool ccs_is_policy_manager(void) Line 570  static bool ccs_is_policy_manager(void)
570          const struct ccs_path_info *domainname          const struct ccs_path_info *domainname
571                  = ccs_current_domain()->domainname;                  = ccs_current_domain()->domainname;
572          bool found = false;          bool found = false;
         ccs_assert_read_lock();  
573          if (!ccs_policy_loaded)          if (!ccs_policy_loaded)
574                  return true;                  return true;
575          if (task->ccs_flags & CCS_TASK_IS_POLICY_MANAGER)          if (task->ccs_flags & CCS_TASK_IS_POLICY_MANAGER)
# Line 652  static bool ccs_is_select_one(struct ccs Line 650  static bool ccs_is_select_one(struct ccs
650  {  {
651          unsigned int pid;          unsigned int pid;
652          struct ccs_domain_info *domain = NULL;          struct ccs_domain_info *domain = NULL;
         ccs_assert_read_lock();  
653          if (!strcmp(data, "allow_execute")) {          if (!strcmp(data, "allow_execute")) {
654                  head->read_execute_only = true;                  head->read_execute_only = true;
655                  return true;                  return true;
# Line 1546  static void ccs_read_domain_policy(struc Line 1543  static void ccs_read_domain_policy(struc
1543  {  {
1544          struct list_head *dpos;          struct list_head *dpos;
1545          struct list_head *apos;          struct list_head *apos;
         ccs_assert_read_lock();  
1546          if (head->read_eof)          if (head->read_eof)
1547                  return;                  return;
1548          if (head->read_step == 0)          if (head->read_step == 0)
# Line 1623  static int ccs_write_domain_profile(stru Line 1619  static int ccs_write_domain_profile(stru
1619          char *cp = strchr(data, ' ');          char *cp = strchr(data, ' ');
1620          struct ccs_domain_info *domain;          struct ccs_domain_info *domain;
1621          unsigned int profile;          unsigned int profile;
         ccs_assert_read_lock();  
1622          if (!cp)          if (!cp)
1623                  return -EINVAL;                  return -EINVAL;
1624          *cp = '\0';          *cp = '\0';
# Line 1653  static int ccs_write_domain_profile(stru Line 1648  static int ccs_write_domain_profile(stru
1648  static void ccs_read_domain_profile(struct ccs_io_buffer *head)  static void ccs_read_domain_profile(struct ccs_io_buffer *head)
1649  {  {
1650          struct list_head *pos;          struct list_head *pos;
         ccs_assert_read_lock();  
1651          if (head->read_eof)          if (head->read_eof)
1652                  return;                  return;
1653          list_for_each_cookie(pos, head->read_var1, &ccs_domain_list) {          list_for_each_cookie(pos, head->read_var1, &ccs_domain_list) {
# Line 1700  static void ccs_read_pid(struct ccs_io_b Line 1694  static void ccs_read_pid(struct ccs_io_b
1694          struct task_struct *p;          struct task_struct *p;
1695          struct ccs_domain_info *domain = NULL;          struct ccs_domain_info *domain = NULL;
1696          u32 ccs_flags = 0;          u32 ccs_flags = 0;
         ccs_assert_read_lock();  
1697          /* Accessing write_buf is safe because head->io_sem is held. */          /* Accessing write_buf is safe because head->io_sem is held. */
1698          if (!buf)          if (!buf)
1699                  return; /* Do nothing if open(O_RDONLY). */                  return; /* Do nothing if open(O_RDONLY). */
# Line 1785  static int ccs_write_exception_policy(st Line 1778  static int ccs_write_exception_policy(st
1778   */   */
1779  static void ccs_read_exception_policy(struct ccs_io_buffer *head)  static void ccs_read_exception_policy(struct ccs_io_buffer *head)
1780  {  {
         ccs_assert_read_lock();  
1781          if (head->read_eof)          if (head->read_eof)
1782                  return;                  return;
1783          switch (head->read_step) {          switch (head->read_step) {

Legend:
Removed from v.2948  
changed lines
  Added in v.2951

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