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

Subversion リポジトリの参照

Diff of /trunk/1.5.x/ccs-patch/fs/tomoyo_signal.c

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

revision 512 by kumaneko, Thu Sep 27 08:52:16 2007 UTC revision 514 by kumaneko, Fri Sep 28 05:08:39 2007 UTC
# Line 39  static int AuditSignalLog(const int sign Line 39  static int AuditSignalLog(const int sign
39    
40  /*************************  SIGNAL ACL HANDLER  *************************/  /*************************  SIGNAL ACL HANDLER  *************************/
41    
42  static int AddSignalEntry(const int sig, const char *dest_pattern, struct domain_info *domain, const u8 is_add, const struct condition_list *condition)  static int AddSignalEntry(const int sig, const char *dest_pattern, struct domain_info *domain, const struct condition_list *condition, const u8 is_delete)
43  {  {
44          struct acl_info *ptr;          struct acl_info *ptr;
45          const struct path_info *saved_dest_pattern;          const struct path_info *saved_dest_pattern;
# Line 49  static int AddSignalEntry(const int sig, Line 49  static int AddSignalEntry(const int sig,
49          if (!dest_pattern || !IsCorrectDomain(dest_pattern, __FUNCTION__)) return -EINVAL;          if (!dest_pattern || !IsCorrectDomain(dest_pattern, __FUNCTION__)) return -EINVAL;
50          if ((saved_dest_pattern = SaveName(dest_pattern)) == NULL) return -ENOMEM;          if ((saved_dest_pattern = SaveName(dest_pattern)) == NULL) return -ENOMEM;
51          down(&domain_acl_lock);          down(&domain_acl_lock);
52          if (is_add) {          if (!is_delete) {
53                  if ((ptr = domain->first_acl_ptr) == NULL) goto first_entry;                  if ((ptr = domain->first_acl_ptr) == NULL) goto first_entry;
54                  while (1) {                  while (1) {
55                          struct signal_acl_record *new_ptr = (struct signal_acl_record *) ptr;                          struct signal_acl_record *new_ptr = (struct signal_acl_record *) ptr;
# Line 135  int CheckSignalACL(const int sig, const Line 135  int CheckSignalACL(const int sig, const
135          }          }
136          AuditSignalLog(sig, dest->domainname, 0);          AuditSignalLog(sig, dest->domainname, 0);
137          if (is_enforce) return CheckSupervisor("%s\n" KEYWORD_ALLOW_SIGNAL "%d %s\n", domain->domainname->name, sig, dest_pattern);          if (is_enforce) return CheckSupervisor("%s\n" KEYWORD_ALLOW_SIGNAL "%d %s\n", domain->domainname->name, sig, dest_pattern);
138          if (CheckCCSAccept(CCS_TOMOYO_MAC_FOR_SIGNAL, domain)) AddSignalEntry(sig, dest_pattern, domain, 1, NULL);          if (CheckCCSAccept(CCS_TOMOYO_MAC_FOR_SIGNAL, domain)) AddSignalEntry(sig, dest_pattern, domain, NULL, 0);
139          return 0;          return 0;
140  }  }
141  EXPORT_SYMBOL(CheckSignalACL);  EXPORT_SYMBOL(CheckSignalACL);
# Line 148  int AddSignalPolicy(char *data, struct d Line 148  int AddSignalPolicy(char *data, struct d
148                  const struct condition_list *condition = NULL;                  const struct condition_list *condition = NULL;
149                  const char *cp = FindConditionPart(domainname + 1);                  const char *cp = FindConditionPart(domainname + 1);
150                  if (cp && (condition = FindOrAssignNewCondition(cp)) == NULL) return -EINVAL;                  if (cp && (condition = FindOrAssignNewCondition(cp)) == NULL) return -EINVAL;
151                  return AddSignalEntry(sig, domainname + 1, domain, is_delete ? 0 : -1, condition);                  return AddSignalEntry(sig, domainname + 1, domain, condition, is_delete);
152          }          }
153          return -EINVAL;          return -EINVAL;
154  }  }

Legend:
Removed from v.512  
changed lines
  Added in v.514

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