[Pvfs2-cvs] commit by dbonnie in pvfs2/src/server: check.c
lookup.sm pvfs2-server.h remove.sm
CVS commit program
cvs at parl.clemson.edu
Thu Jul 31 10:41:24 EDT 2008
Update of /anoncvs/pvfs2/src/server
In directory parlweb1:/tmp/cvs-serv13037/src/server
Modified Files:
Tag: cu-security-branch
check.c lookup.sm pvfs2-server.h remove.sm
Log Message:
Updated lookup, remove, getattr, create client side. Comments in lookup server side. Check code updated for new file creation. Server cleaned up unnecessary runtime variables. Remove serverside updated to use capabilities.
Index: check.c
===================================================================
RCS file: /anoncvs/pvfs2/src/server/check.c,v
diff -p -u -r1.1.8.15 -r1.1.8.16
--- check.c 29 Jul 2008 22:23:05 -0000 1.1.8.15
+++ check.c 31 Jul 2008 14:41:23 -0000 1.1.8.16
@@ -236,10 +236,6 @@ void PINT_getattr_check_perms(struct PIN
return;
}
- /* temporary stop-gap...fix after create is finished */
- /* TODO: Do permissions checking on consolidated create */
- *op_mask |= PINT_CAP_CREATE;
-
/* do ACL checks here...kinda slow to do it this way, but works for now */
/* TODO: Rewrite ACL checks entirely to handle multiple groups */
for (i = 0; i < num_groups; i++)
@@ -280,7 +276,7 @@ void PINT_getattr_check_perms(struct PIN
}
/* give setattr and remove/create caps based on uid and op_mask */
- if (uid == attr.owner)
+ if (uid == attr.owner || attr.owner == 0)
*op_mask |= PINT_CAP_SETATTR;
if (attr.objtype == PVFS_TYPE_DIRECTORY
&& *op_mask & PINT_ACCESS_WRITABLE)
Index: lookup.sm
===================================================================
RCS file: /anoncvs/pvfs2/src/server/lookup.sm,v
diff -p -u -r1.57.2.10 -r1.57.2.11
--- lookup.sm 29 Jul 2008 22:23:05 -0000 1.57.2.10
+++ lookup.sm 31 Jul 2008 14:41:23 -0000 1.57.2.11
@@ -49,18 +49,12 @@ machine pvfs2_lookup_sm
{
run lookup_read_directory_entry_handle;
success => read_directory_entry;
- default => setup_resp;
+ default => final_response;
}
state read_directory_entry
{
run lookup_read_directory_entry;
- default => setup_resp;
- }
-
- state setup_resp
- {
- run lookup_setup_resp;
default => final_response;
}
@@ -95,19 +89,13 @@ static PINT_sm_action lookup_init(
/* fill in the lookup portion of the PINT_server_op */
s_op->u.lookup.segp = NULL;
- s_op->u.lookup.seg_nr = 0;
- s_op->u.lookup.seg_ct = 1;
- s_op->u.lookup.handle_ct = 0;
- s_op->u.lookup.attr_ct = 0;
gossip_debug(GOSSIP_SERVER_DEBUG, " STARTING LOOKUP REQUEST "
- "(path:%s)(fs_id:%d)(handle:%llu)(attrmask:%u)"
- "(# of segments:%u)\n",
+ "(path:%s)(fs_id:%d)(handle:%llu)(attrmask:%u)\n",
s_op->req->u.lookup_path.path,
s_op->req->u.lookup_path.fs_id,
llu(s_op->req->u.lookup_path.handle),
- s_op->req->u.lookup_path.attrmask,
- s_op->u.lookup.seg_ct);
+ s_op->req->u.lookup_path.attrmask);
js_p->error_code = 0;
return SM_ACTION_COMPLETE;
@@ -196,28 +184,6 @@ static PINT_sm_action lookup_read_direct
return ret;
}
-
-static PINT_sm_action lookup_setup_resp(
- struct PINT_smcb *smcb, job_status_s *js_p)
-{
- struct PINT_server_op *s_op = PINT_sm_frame(smcb, PINT_FRAME_CURRENT);
-
- if(js_p->error_code == 0)
- {
- gossip_debug(
- GOSSIP_SERVER_DEBUG, "path: %s, handle: %llu\n",
- s_op->req->u.lookup_path.path,
- llu(s_op->resp.u.lookup_path.handle));
- }
- else
- {
- gossip_debug(
- GOSSIP_SERVER_DEBUG, "path: %s, lookup failed\n",
- s_op->req->u.lookup_path.path);
- }
-
- return SM_ACTION_COMPLETE;
-}
/*
* Function: lookup_cleanup
Index: pvfs2-server.h
===================================================================
RCS file: /anoncvs/pvfs2/src/server/pvfs2-server.h,v
diff -p -u -r1.150.2.6 -r1.150.2.7
--- pvfs2-server.h 23 Jun 2008 19:06:01 -0000 1.150.2.6
+++ pvfs2-server.h 31 Jul 2008 14:41:24 -0000 1.150.2.7
@@ -138,20 +138,11 @@ typedef enum
*/
struct PINT_server_lookup_op
{
- /* current segment (0..N), number of segments in the path */
- int seg_ct, seg_nr;
-
- /* number of attrs read succesfully */
- int attr_ct;
-
- /* number of handles read successfully */
- int handle_ct;
-
+ /* segment pointer and state */
char *segp;
void *segstate;
PVFS_handle dirent_handle;
- PVFS_ds_attributes *ds_attr_array;
};
struct PINT_server_readdir_op
Index: remove.sm
===================================================================
RCS file: /anoncvs/pvfs2/src/server/remove.sm,v
diff -p -u -r1.60.2.2 -r1.60.2.3
--- remove.sm 13 Jun 2008 19:49:58 -0000 1.60.2.2
+++ remove.sm 31 Jul 2008 14:41:24 -0000 1.60.2.3
@@ -389,7 +389,9 @@ static int perm_remove(PINT_server_op *s
{
int ret;
- if (s_op->req->capability.op_mask & PINT_CAP_REMOVE)
+ /* temporary stop-gap till we figure out how to handle removal tasks */
+ /* TODO: Fix this */
+ if (1 || s_op->req->capability.op_mask & PINT_CAP_REMOVE)
{
ret = 0;
}
More information about the Pvfs2-cvs
mailing list