]> andersk Git - moira.git/commitdiff
Fixes to previous revision.
authorzacheiss <zacheiss>
Tue, 30 Dec 2003 07:13:05 +0000 (07:13 +0000)
committerzacheiss <zacheiss>
Tue, 30 Dec 2003 07:13:05 +0000 (07:13 +0000)
gen/dhcp.pc

index 2250a2eeb10bdbdcbc3496fac59b7685727783f6..8ece8a4778f4df141f4512b5b80745d070271bd8 100644 (file)
@@ -63,13 +63,15 @@ int main(int argc, char **argv)
   EXEC SQL WHENEVER SQLERROR DO sqlerr();
 
   /* Get print spoolers for allow lists. */
-  EXEC SQL SELECT COUNT(service) INTO :alcount FROM serverhosts
-    WHERE service = 'PRINT';
+  EXEC SQL SELECT COUNT(service) INTO :alcount FROM serverhosts sh, machine m
+    WHERE sh.service = 'PRINT' AND sh.mach_id = m.mach_id 
+    AND m.status = 1 AND m.address != 'unassigned';
   allowlist = malloc(alcount * sizeof(*allowlist));
 
   EXEC SQL DECLARE csr_spool CURSOR FOR
     SELECT m.address, sh.value3 FROM machine m, serverhosts sh
-    WHERE m.mach_id = sh.mach_id AND sh.service = 'PRINT';
+    WHERE m.mach_id = sh.mach_id AND sh.service = 'PRINT'
+    AND m.status = 1 AND m.address != 'unassigned';
   EXEC SQL OPEN csr_spool;
   for (i = 0; i < alcount; i++)
     {
@@ -96,7 +98,6 @@ int main(int argc, char **argv)
     FROM printers pr, machine m, machine m2
     WHERE pr.type != 'ALIAS' AND pr.mach_id != 0
     AND pr.mach_id = m.mach_id AND pr.loghost = m2.mach_id
-    AND m.status = 1 AND m.address != 'unassigned'
     ORDER BY m.hwaddr;
   EXEC SQL OPEN csr_boot;
   while (1)
This page took 0.040115 seconds and 5 git commands to generate.