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

Subversion リポジトリの参照

Diff of /trunk/1.6.x/ccs-patch/fs/tomoyo_domain.c

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

revision 815 by kumaneko, Tue Dec 18 07:13:08 2007 UTC revision 816 by kumaneko, Tue Dec 18 08:01:32 2007 UTC
# Line 734  static int FindNextDomain(struct linux_b Line 734  static int FindNextDomain(struct linux_b
734          return retval;          return retval;
735  }  }
736    
737  static int CheckEnviron(struct linux_binprm *bprm, const u8 profile, const unsigned int mode)  static int CheckEnviron(struct linux_binprm *bprm)
738  {  {
739          char *arg_ptr = ccs_alloc(CCS_MAX_PATHNAME_LEN);          const u8 profile = current->domain_info->profile;
740            const unsigned int mode = CheckCCSFlags(CCS_TOMOYO_MAC_FOR_ENV);
741            char *arg_ptr;
742          int arg_len = 0;          int arg_len = 0;
743          unsigned long pos = bprm->p;          unsigned long pos = bprm->p;
744          int i = pos / PAGE_SIZE, offset = pos % PAGE_SIZE;          int i = pos / PAGE_SIZE, offset = pos % PAGE_SIZE;
# Line 744  static int CheckEnviron(struct linux_bin Line 746  static int CheckEnviron(struct linux_bin
746          int envp_count = bprm->envc;          int envp_count = bprm->envc;
747          //printk("start %d %d\n", argv_count, envp_count);          //printk("start %d %d\n", argv_count, envp_count);
748          int error = -ENOMEM;          int error = -ENOMEM;
749            if (!mode || !envp_count) return 0;
750            arg_ptr = ccs_alloc(CCS_MAX_PATHNAME_LEN);
751          if (!arg_ptr) goto out;          if (!arg_ptr) goto out;
         if (!envp_count) {  
                 error = 0;  
                 goto out;  
         }  
752          while (error == -ENOMEM) {          while (error == -ENOMEM) {
753                  struct page *page;                  struct page *page;
754                  const char *kaddr;                  const char *kaddr;
# Line 904  int search_binary_handler_with_transitio Line 904  int search_binary_handler_with_transitio
904                  current->tomoyo_flags &= ~CCS_DONT_SLEEP_ON_ENFORCE_ERROR;                  current->tomoyo_flags &= ~CCS_DONT_SLEEP_ON_ENFORCE_ERROR;
905          }          }
906          if (retval == 0) {          if (retval == 0) {
                 const u8 profile = next_domain->profile;  
                 unsigned int mode;  
907                  current->domain_info = next_domain;                  current->domain_info = next_domain;
908                  mode = CheckCCSFlags(CCS_TOMOYO_MAC_FOR_ENV);                  retval = CheckEnviron(bprm);
                 if (mode) retval = CheckEnviron(bprm, profile, mode);  
909                  current->tomoyo_flags |= TOMOYO_CHECK_READ_FOR_OPEN_EXEC;                  current->tomoyo_flags |= TOMOYO_CHECK_READ_FOR_OPEN_EXEC;
910                  if (!retval) retval = search_binary_handler(bprm, regs);                  if (!retval) retval = search_binary_handler(bprm, regs);
911                  current->tomoyo_flags &= ~TOMOYO_CHECK_READ_FOR_OPEN_EXEC;                  current->tomoyo_flags &= ~TOMOYO_CHECK_READ_FOR_OPEN_EXEC;

Legend:
Removed from v.815  
changed lines
  Added in v.816

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