- actions renamed/added
authorDaniel Kouřil <kouril@ics.muni.cz>
Tue, 16 Mar 2010 17:03:06 +0000 (17:03 +0000)
committerDaniel Kouřil <kouril@ics.muni.cz>
Tue, 16 Mar 2010 17:03:06 +0000 (17:03 +0000)
- support for the .* wildcard

org.glite.lb.server/src/authz_policy.c
org.glite.lb.server/src/authz_policy.h
org.glite.lb.server/src/jobstat.c

index eeec762..8f8abfb 100644 (file)
@@ -23,7 +23,9 @@ limitations under the License.
 
 struct action_name action_names[] = {
     { READ_ALL,                "READ_ALL" },
-    { READ_RTM,                "READ_RTM" },
+    { STATUS_FOR_RTM,  "STATUS_FOR_RTM" },
+    { LOG_WMS_EVENTS,  "LOG_WMS_EVENTS" },
+    { LOG_GENERAL_EVENTS,      "LOG_GENERAL_EVENTS" },
 };
 
 static int num_actions =
@@ -52,7 +54,9 @@ check_authz_policy(edg_wll_Context ctx, edg_wll_authz_policy policy,
     for (i = 0; i < policy->num; i++) {
         r = policy->rules + i;
         if (r->action != action)
-            break;
+            continue;
+       if (strcmp(r->attr_value, ".*") == 0)
+           return 1;
         switch (r->attr_id) {
             case ATTR_SUBJECT:
                if (edg_wll_gss_equal_subj(r->attr_value, ctx->peerName))
index 6182b0d..50db197 100644 (file)
@@ -24,7 +24,9 @@ limitations under the License.
 typedef enum {
     ACTION_UNDEF       = 0,
     READ_ALL           = 2,
-    READ_RTM           = 4,
+    STATUS_FOR_RTM     = 4,
+    LOG_WMS_EVENTS     = 8,
+    LOG_GENERAL_EVENTS = 16,
 } authz_action;
 
 typedef struct action_name {
index 871886b..cd1e1df 100644 (file)
@@ -103,8 +103,8 @@ check_jobstat_authz(edg_wll_Context ctx,
        if (acl && edg_wll_CheckACL(ctx, acl, EDG_WLL_CHANGEACL_READ) == 0)
                return 1;
        edg_wll_ResetError(ctx);
-       if (check_authz_policy(ctx, &ctx->authz_policy, READ_RTM)) {
-               *flags |= READ_RTM;
+       if (check_authz_policy(ctx, &ctx->authz_policy, STATUS_FOR_RTM)) {
+               *flags |= STATUS_FOR_RTM;
                return 1;
        }
        return 0;
@@ -411,7 +411,7 @@ rollback:
        free(string_jobid);
        free(md5_jobid);
 
-       if (authz_flags && authz_flags & READ_RTM) {
+       if (authz_flags && authz_flags & STATUS_FOR_RTM) {
                edg_wll_JobStat new_stat;
 
                memset(&new_stat, 0, sizeof(new_stat));