plain text document attachment (rbce_rm_old_cmd_path_term.patch)
Patch: rbce_rm_old_cmd_path_term.patch
Description:

Remove the old command path term support from RBCE.

Signed-Off-By: Matt Helsley <[EMAIL PROTECTED]>

%patch
Index: linux-2.6.12-rc3/kernel/ckrm/ckrmutils.c
===================================================================
--- linux-2.6.12-rc3.orig/kernel/ckrm/ckrmutils.c       2005-05-09 
18:11:09.000000000 -0700
+++ linux-2.6.12-rc3/kernel/ckrm/ckrmutils.c    2005-05-10 17:19:11.000000000 
-0700
@@ -12,52 +12,15 @@
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  *  published by the Free Software Foundation.
  */
 
-#include <linux/mm.h>
 #include <linux/err.h>
 #include <linux/mount.h>
 #include <linux/module.h>
 #include <linux/ckrm_rc.h>
 
-int get_exe_path_name(struct task_struct *tsk, char *buf, int buflen)
-{
-       struct vm_area_struct *vma;
-       struct vfsmount *mnt;
-       struct mm_struct *mm = get_task_mm(tsk);
-       struct dentry *dentry;
-       char *lname;
-       int rc = 0;
-
-       *buf = '\0';
-       if (!mm) {
-               return -EINVAL;
-       }
-       down_read(&mm->mmap_sem);
-       vma = mm->mmap;
-       while (vma) {
-               if ((vma->vm_flags & VM_EXECUTABLE) && vma->vm_file) {
-                       dentry = dget(vma->vm_file->f_dentry);
-                       mnt = mntget(vma->vm_file->f_vfsmnt);
-                       lname = d_path(dentry, mnt, buf, buflen);
-                       if (!IS_ERR(lname)) {
-                               strncpy(buf, lname, strlen(lname) + 1);
-                       } else {
-                               rc = (int)PTR_ERR(lname);
-                       }
-                       mntput(mnt);
-                       dput(dentry);
-                       break;
-               }
-               vma = vma->vm_next;
-       }
-       up_read(&mm->mmap_sem);
-       mmput(mm);
-       return rc;
-}
-
 /*
  * TODO:  Use sparce to enforce cnt_lock.
  *
  * must be called with cnt_lock of parres held
  * Caller is responsible for making sure that the new guarantee doesn't
@@ -185,9 +148,8 @@ set_shares(struct ckrm_shares *new, stru
        rc = 0;
 set_share_err:
        return rc;
 }
 
-EXPORT_SYMBOL_GPL(get_exe_path_name);
 EXPORT_SYMBOL_GPL(child_guarantee_changed);
 EXPORT_SYMBOL_GPL(child_maxlimit_changed);
 EXPORT_SYMBOL_GPL(set_shares);
Index: linux-2.6.12-rc3/kernel/ckrm/rbce/rbce_core.c
===================================================================
--- linux-2.6.12-rc3.orig/kernel/ckrm/rbce/rbce_core.c  2005-05-10 
16:26:51.000000000 -0700
+++ linux-2.6.12-rc3/kernel/ckrm/rbce/rbce_core.c       2005-05-10 
17:19:11.000000000 -0700
@@ -318,30 +318,13 @@ __evaluate_rule(struct task_struct *tsk,
 
                        switch (term->op) {
 
                        case RBCE_RULE_CMD_PATH:
                        case RBCE_RULE_CMD:
-#if __NOT_YET__
-                               if (!*filename) {       /* get this once */
-                                       if (((*filename =
-                                             kmalloc(NAME_MAX,
-                                                     GFP_ATOMIC)) == NULL)
-                                           ||
-                                           (get_exe_path_name
-                                            (tsk, *filename, NAME_MAX) < 0)) {
-                                               rc = 0;
-                                               break;
-                                       }
-                               }
-                               rc = match_cmd(*filename, term->u.string,
-                                              (term->op ==
-                                               RBCE_RULE_CMD_PATH));
-#else
                                rc = match_cmd(tsk->comm, term->u.string,
                                               (term->op ==
                                                RBCE_RULE_CMD_PATH));
-#endif
                                break;
                        case RBCE_RULE_REAL_UID:
                                if (term->operator == RBCE_LESS_THAN) {
                                        rc = (tsk->uid < term->u.id);
                                } else if (term->operator == RBCE_GREATER_THAN){

--



-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
ckrm-tech mailing list
https://lists.sourceforge.net/lists/listinfo/ckrm-tech

Reply via email to