]> andersk Git - moira.git/blobdiff - server/qaccess.dc
needed to modify acces on host alias table as well
[moira.git] / server / qaccess.dc
index 5d13e27addf083a83e282512f74bb4ee8918e8d5..15632bf03f817aa0999d42bc5cdcb6af4ae4c1f5 100644 (file)
@@ -340,7 +340,7 @@ access_filesys(q, argv, cl)
 /* access_host - successful if owner of host, or subnet containing host
  */
 
-int host_access_level = 0;
+int host_access_level = 0;              /* 1 for network, 2 for host */
 
 access_host(q, argv, cl)
     struct query *q;
@@ -361,10 +361,7 @@ access_host(q, argv, cl)
          WHERE s.snet_id=:id;
        mid =0;
     } else if (q->type == RETRIEVE) {
-       name = argv[0];
-       EXEC SQL SELECT m.owner_type, m.owner_id, s.owner_type, s.owner_id
-         INTO :mtype, :mid, :stype, :sid FROM machine m, subnet s
-         WHERE m.name=:name and s.snet_id=m.snet_id;
+       return(MR_SUCCESS);
     } else {
        id = *(int *)argv[0];
        EXEC SQL SELECT m.owner_type, m.owner_id, s.owner_type, s.owner_id
@@ -408,6 +405,9 @@ access_ahal(q, argv, cl)
     char *client_type;
     int status, client_id;
 
+    if (q->type == RETRIEVE)
+      return(MR_SUCCESS);
+
     id = *(int *)argv[1];
 
     EXEC SQL SELECT count(name) INTO :cnt from hostalias WHERE mach_id = :id;
@@ -418,7 +418,6 @@ access_ahal(q, argv, cl)
      */
     if (q->type == APPEND && cnt >= 2)
       return(MR_PERM);
-
     EXEC SQL SELECT m.owner_type, m.owner_id, s.owner_type, s.owner_id
       INTO :mtype, :mid, :stype, :sid FROM machine m, subnet s
       WHERE m.mach_id=:id and s.snet_id=m.snet_id;
This page took 0.031973 seconds and 4 git commands to generate.