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

Subversion リポジトリの参照

Diff of /branches/ccs-patch/security/ccsecurity/policy_io.c

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

revision 3747 by kumaneko, Wed Jun 9 13:58:57 2010 UTC revision 3748 by kumaneko, Thu Jun 10 03:54:43 2010 UTC
# Line 40  static unsigned int ccs_profile_version; Line 40  static unsigned int ccs_profile_version;
40  static struct ccs_profile *ccs_profile_ptr[CCS_MAX_PROFILES];  static struct ccs_profile *ccs_profile_ptr[CCS_MAX_PROFILES];
41    
42  /* String table for functionality that takes 4 modes. */  /* String table for functionality that takes 4 modes. */
43  static const char *ccs_mode_4[4] = {  static const char *ccs_mode[CCS_CONFIG_MAX_MODE] = {
44          "disabled", "learning", "permissive", "enforcing"          [CCS_CONFIG_DISABLED] = "disabled",
45            [CCS_CONFIG_LEARNING] = "learning",
46            [CCS_CONFIG_PERMISSIVE] = "permissive",
47            [CCS_CONFIG_ENFORCING] = "enforcing"
48  };  };
49    
50  /* String table for /proc/ccs/profile */  /* String table for /proc/ccs/profile */
# Line 452  static int ccs_set_mode(const char *cp, Line 455  static int ccs_set_mode(const char *cp,
455                  config = CCS_CONFIG_USE_DEFAULT;                  config = CCS_CONFIG_USE_DEFAULT;
456          } else {          } else {
457                  u8 mode;                  u8 mode;
458                  for (mode = 0; mode <= 3; mode--)                  for (mode = 0; mode < CCS_CONFIG_MAX_MODE; mode--)
459                          if (strstr(cp, ccs_mode_4[mode]))                          if (strstr(cp, ccs_mode[mode]))
460                                  /*                                  /*
461                                   * Update lower 3 bits in order to distinguish                                   * Update lower 3 bits in order to distinguish
462                                   * 'config' from 'CCS_CONFIG_USE_DEAFULT'.                                   * 'config' from 'CCS_CONFIG_USE_DEAFULT'.
# Line 635  static void ccs_read_profile(struct ccs_ Line 638  static void ccs_read_profile(struct ccs_
638  #ifdef CONFIG_CCSECURITY_AUDIT  #ifdef CONFIG_CCSECURITY_AUDIT
639                  if (!ccs_io_printf(head, "%u-%s%s={ mode=%s "                  if (!ccs_io_printf(head, "%u-%s%s={ mode=%s "
640                                     "grant_log=%s reject_log=%s }\n", index,                                     "grant_log=%s reject_log=%s }\n", index,
641                                     "CONFIG", "", ccs_mode_4[config & 3],                                     "CONFIG", "", ccs_mode[config & 3],
642                                     ccs_yesno(config &                                     ccs_yesno(config &
643                                               CCS_CONFIG_WANT_GRANT_LOG),                                               CCS_CONFIG_WANT_GRANT_LOG),
644                                     ccs_yesno(config &                                     ccs_yesno(config &
# Line 643  static void ccs_read_profile(struct ccs_ Line 646  static void ccs_read_profile(struct ccs_
646                          goto out;                          goto out;
647  #else  #else
648                  if (!ccs_io_printf(head, "%u-%s%s={ mode=%s }\n", index,                  if (!ccs_io_printf(head, "%u-%s%s={ mode=%s }\n", index,
649                                     "CONFIG", "", ccs_mode_4[config & 3]))                                     "CONFIG", "", ccs_mode[config & 3]))
650                          goto out;                          goto out;
651  #endif  #endif
652                  for (i = 0; i < CCS_MAX_MAC_INDEX + CCS_MAX_CAPABILITY_INDEX                  for (i = 0; i < CCS_MAX_MAC_INDEX + CCS_MAX_CAPABILITY_INDEX
# Line 662  static void ccs_read_profile(struct ccs_ Line 665  static void ccs_read_profile(struct ccs_
665                                             "grant_log=%s reject_log=%s }\n",                                             "grant_log=%s reject_log=%s }\n",
666                                             index, "CONFIG::",                                             index, "CONFIG::",
667                                             ccs_mac_keywords[i],                                             ccs_mac_keywords[i],
668                                             ccs_mode_4[config & 3], g, r))                                             ccs_mode[config & 3], g, r))
669                                  goto out;                                  goto out;
670  #else  #else
671                          if (!ccs_io_printf(head, "%u-%s%s={ mode=%s }\n",                          if (!ccs_io_printf(head, "%u-%s%s={ mode=%s }\n",
672                                             index, "CONFIG::",                                             index, "CONFIG::",
673                                             ccs_mac_keywords[i],                                             ccs_mac_keywords[i],
674                                             ccs_mode_4[config & 3]))                                             ccs_mode[config & 3]))
675                                  goto out;                                  goto out;
676  #endif  #endif
677                  }                  }

Legend:
Removed from v.3747  
changed lines
  Added in v.3748

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