[Pvfs2-cvs] commit by nlmills in pvfs2/src/server: job-timer.sm list-attr.sm list-eattr.sm lookup.sm noop.sm proto-error.sm set-attr.sm set-eattr.sm small-io.sm statfs.sm

CVS commit program cvs at parl.clemson.edu
Sat Jun 14 18:44:49 EDT 2008


Update of /anoncvs/pvfs2/src/server
In directory parlweb1:/tmp/cvs-serv29812/src/server

Modified Files:
      Tag: cu-security-branch
	job-timer.sm list-attr.sm list-eattr.sm lookup.sm noop.sm 
	proto-error.sm set-attr.sm set-eattr.sm small-io.sm statfs.sm 
Log Message:
state machine permission checking code cleanup


Index: job-timer.sm
===================================================================
RCS file: /anoncvs/pvfs2/src/server/job-timer.sm,v
diff -p -u -r1.7.2.2 -r1.7.2.3
--- job-timer.sm	13 Jun 2008 19:49:57 -0000	1.7.2.2
+++ job-timer.sm	14 Jun 2008 22:44:45 -0000	1.7.2.3
@@ -81,22 +81,6 @@ static PINT_sm_action job_timer_do_work(
 	    server_job_context));
 }
 
-static int perm_chdirent(PINT_server_op *s_op)
-{
-    int ret;
-
-    if (s_op->req->capability.op_mask & PINT_CAP_WRITE & PINT_CAP_EXEC)
-    {
-        ret = 0;
-    }
-    else
-    {
-        ret = -PVFS_EACCES;
-    }
-
-    return ret;
-}
-
 static int perm_job_timer(PINT_server_op *s_op)
 {
     int ret;
@@ -119,8 +103,6 @@ struct PINT_server_req_params pvfs2_job_
     .perm = perm_job_timer,
     .state_machine = &pvfs2_job_timer_sm
 };
-
-
 
 
 /*

Index: list-attr.sm
===================================================================
RCS file: /anoncvs/pvfs2/src/server/list-attr.sm,v
diff -p -u -r1.10.2.3 -r1.10.2.4
--- list-attr.sm	13 Jun 2008 19:49:57 -0000	1.10.2.3
+++ list-attr.sm	14 Jun 2008 22:44:45 -0000	1.10.2.4
@@ -283,14 +283,11 @@ static inline int PINT_get_object_ref_li
     return 0;
 };
 
-static int perm_list_attr(PINT_server_op *s_op)
+static int perm_listattr(PINT_server_op *s_op)
 {
     int ret;
 
-    if (1)
-    {
-        ret = 0;
-    }
+    ret = 0;
     
     return ret;
 }
@@ -298,7 +295,7 @@ static int perm_list_attr(PINT_server_op
 struct PINT_server_req_params pvfs2_list_attr_params =
 {
     .string_name = "list_attr",
-    .perm = perm_list_attr,
+    .perm = perm_listattr,
     .access_type = PINT_server_req_readonly,
     .sched_policy = PINT_SERVER_REQ_SCHEDULE,
     .get_object_ref = PINT_get_object_ref_listattr,

Index: list-eattr.sm
===================================================================
RCS file: /anoncvs/pvfs2/src/server/list-eattr.sm,v
diff -p -u -r1.13.2.3 -r1.13.2.4
--- list-eattr.sm	13 Jun 2008 19:49:57 -0000	1.13.2.3
+++ list-eattr.sm	14 Jun 2008 22:44:45 -0000	1.13.2.4
@@ -241,14 +241,11 @@ static PINT_sm_action listeattr_cleanup(
 
 PINT_GET_OBJECT_REF_DEFINE(listeattr);
 
-static int perm_list_eattr(PINT_server_op *s_op)
+static int perm_listeattr(PINT_server_op *s_op)
 {
     int ret;
 
-    if (1)
-    {
-        ret = 0;
-    }
+    ret = 0;
 
     return ret;
 }
@@ -256,7 +253,7 @@ static int perm_list_eattr(PINT_server_o
 struct PINT_server_req_params pvfs2_list_eattr_params =
 {
     .string_name = "listeattr",
-    .perm = perm_list_eattr,
+    .perm = perm_listeattr,
     .sched_policy = PINT_SERVER_REQ_SCHEDULE,
     .get_object_ref = PINT_get_object_ref_listeattr,
     .state_machine = &pvfs2_list_eattr_sm

Index: lookup.sm
===================================================================
RCS file: /anoncvs/pvfs2/src/server/lookup.sm,v
diff -p -u -r1.57.2.4 -r1.57.2.5
--- lookup.sm	13 Jun 2008 19:49:58 -0000	1.57.2.4
+++ lookup.sm	14 Jun 2008 22:44:45 -0000	1.57.2.5
@@ -20,6 +20,7 @@
 #include "pint-util.h"
 #include "pvfs2-internal.h"
 #include "check.h"
+#include "pint-security.h"
 
 enum 
 {
@@ -655,22 +656,6 @@ static PINT_sm_action lookup_cleanup(
 }
 
 PINT_GET_OBJECT_REF_DEFINE(lookup_path);
-
-static int perm_chdirent(PINT_server_op *s_op)
-{
-    int ret;
-
-    if (s_op->req->capability.op_mask & PINT_CAP_WRITE & PINT_CAP_EXEC)
-    {
-        ret = 0;
-    }
-    else
-    {
-        ret = -PVFS_EACCES;
-    }
-
-    return ret;
-}
 
 struct PINT_server_req_params pvfs2_lookup_params =
 {

Index: noop.sm
===================================================================
RCS file: /anoncvs/pvfs2/src/server/noop.sm,v
diff -p -u -r1.9.2.2 -r1.9.2.3
--- noop.sm	13 Jun 2008 19:49:58 -0000	1.9.2.2
+++ noop.sm	14 Jun 2008 22:44:45 -0000	1.9.2.3
@@ -53,10 +53,7 @@ static int perm_noop(PINT_server_op *s_o
 {
     int ret;
 
-    if (1)
-    {
-        ret = 0;
-    }
+    ret = 0;
     
     return ret;
 }

Index: proto-error.sm
===================================================================
RCS file: /anoncvs/pvfs2/src/server/proto-error.sm,v
diff -p -u -r1.8.2.2 -r1.8.2.3
--- proto-error.sm	13 Jun 2008 19:49:58 -0000	1.8.2.2
+++ proto-error.sm	14 Jun 2008 22:44:45 -0000	1.8.2.3
@@ -100,10 +100,7 @@ static int perm_proto_error(PINT_server_
 {
     int ret;
 
-    if (1)
-    {
-        ret = 0;
-    }
+    ret = 0;
 
     return ret;
 }

Index: set-attr.sm
===================================================================
RCS file: /anoncvs/pvfs2/src/server/set-attr.sm,v
diff -p -u -r1.73.2.3 -r1.73.2.4
--- set-attr.sm	13 Jun 2008 19:49:58 -0000	1.73.2.3
+++ set-attr.sm	14 Jun 2008 22:44:45 -0000	1.73.2.4
@@ -487,7 +487,7 @@ static PINT_sm_action setattr_cleanup(
     return(server_state_machine_complete(smcb));
 }
 
-static int perm_set_attr(PINT_server_op *s_op)
+static int perm_setattr(PINT_server_op *s_op)
 {
     int ret;
 
@@ -508,7 +508,7 @@ PINT_GET_OBJECT_REF_DEFINE(setattr);
 struct PINT_server_req_params pvfs2_set_attr_params =
 {
     .string_name = "setattr",
-    .perm = perm_set_attr,
+    .perm = perm_setattr,
     .access_type = PINT_server_req_modify,
     .sched_policy = PINT_SERVER_REQ_SCHEDULE,
     .get_object_ref = PINT_get_object_ref_setattr,

Index: set-eattr.sm
===================================================================
RCS file: /anoncvs/pvfs2/src/server/set-eattr.sm,v
diff -p -u -r1.20.2.3 -r1.20.2.4
--- set-eattr.sm	13 Jun 2008 19:49:58 -0000	1.20.2.3
+++ set-eattr.sm	14 Jun 2008 22:44:45 -0000	1.20.2.4
@@ -166,7 +166,7 @@ static int seteattr_cleanup(
     return(server_state_machine_complete(smcb));
 }
 
-static int perm_set_eattr(PINT_server_op *s_op)
+static int perm_seteattr(PINT_server_op *s_op)
 {
     int ret;
 
@@ -187,7 +187,7 @@ PINT_GET_OBJECT_REF_DEFINE(seteattr);
 struct PINT_server_req_params pvfs2_set_eattr_params =
 {
     .string_name = "set_eattr",
-    .perm = perm_set_eattr,
+    .perm = perm_seteattr,
     .access_type = PINT_server_req_modify,
     .sched_policy = PINT_SERVER_REQ_SCHEDULE,
     .get_object_ref = PINT_get_object_ref_seteattr,

Index: small-io.sm
===================================================================
RCS file: /anoncvs/pvfs2/src/server/small-io.sm,v
diff -p -u -r1.21.2.2 -r1.21.2.3
--- small-io.sm	13 Jun 2008 19:49:58 -0000	1.21.2.2
+++ small-io.sm	14 Jun 2008 22:44:45 -0000	1.21.2.3
@@ -245,16 +245,21 @@ static PINT_sm_action small_io_cleanup(
 static int perm_small_io(PINT_server_op *s_op)
 {
     int ret = -PVFS_EINVAL;
+    int mask = 0;
     enum PVFS_io_type type = s_op->req->u.small_io.io_type;
-     
-    if (type == PVFS_IO_READ && s_op->req->capability.op_mask & PINT_CAP_READ)
+
+    if (type == PVFS_IO_READ)
     {
-        ret = 0;
+        mask = PINT_CAP_READ;
+    }
+    else if (type == PVFS_IO_WRITE)
+    {
+        mask = PINT_CAP_WRITE;
     }
-    else if (type == PVFS_IO_WRITE && s_op->req->capability.op_mask & 
-                     PINT_CAP_WRITE)
+
+    if (s_op->req->capability.op_mask & mask)
     {
-    	ret = 0;
+        ret = 0;
     }
     else
     {

Index: statfs.sm
===================================================================
RCS file: /anoncvs/pvfs2/src/server/statfs.sm,v
diff -p -u -r1.17.2.2 -r1.17.2.3
--- statfs.sm	13 Jun 2008 19:49:58 -0000	1.17.2.2
+++ statfs.sm	14 Jun 2008 22:44:45 -0000	1.17.2.3
@@ -159,10 +159,7 @@ static int perm_statfs(PINT_server_op *s
 {
     int ret;
     
-    if (1) 
-    {
-        ret = 0;
-    }
+    ret = 0;
     
     return ret;
 }



More information about the Pvfs2-cvs mailing list