]> andersk Git - moira.git/blobdiff - gen/aliases.qc
Used /bin/sh format instead of /bin/csh format, by accident.
[moira.git] / gen / aliases.qc
index 7045c40786fd1c9544c45fc0c3bd3b645cb75bbe..1b50e534b3c22f038737c328b75d0bfd55d4b101 100644 (file)
@@ -15,8 +15,8 @@
 #include <mit-copyright.h>
 #include <stdio.h>
 #include <string.h>
-#include <sms.h>
-#include <sms_app.h>
+#include <moira.h>
+#include <moira_site.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/time.h>
@@ -60,18 +60,18 @@ char **argv;
            if (flag1 < 0 && flag2 < 0 && flag3 < 0) {
                fprintf(stderr, "File %s does not need to be rebuilt.\n",
                        argv[1]);
-               exit(SMS_NO_CHANGE);
+               exit(MR_NO_CHANGE);
            }
        }
        targetfile = argv[1];
        sprintf(filename, "%s~", targetfile);
        if ((out = fopen(filename, "w")) == NULL) {
            fprintf(stderr, "unable to open %s for output\n", filename);
-           exit(SMS_OCONFIG);
+           exit(MR_OCONFIG);
        }
     } else if (argc != 1) {
        fprintf(stderr, "usage: %s [outfile]\n", argv[0]);
-       exit(SMS_ARGS);
+       exit(MR_ARGS);
     }
 
     fprintf(out, "%s\n# Aliases File Extract of %s", divide, ctime(&tm));
@@ -91,12 +91,12 @@ char **argv;
 
     if (fclose(out)) {
        perror("close failed");
-       exit(SMS_CCONFIG);
+       exit(MR_CCONFIG);
     }
 
     if (argc == 2)
       fix_file(targetfile);
-    exit(SMS_SUCCESS);
+    exit(MR_SUCCESS);
 }
 
 
@@ -110,17 +110,16 @@ char **argv;
 static int ingerr(num)
     int *num;
 {
-    char buf[256];
     int ingres_errno;
 
     switch (*num) {
     case INGRES_DEADLOCK:
-       ingres_errno = SMS_DEADLOCK;
+       ingres_errno = MR_DEADLOCK;
        break;
     default:
-       ingres_errno = SMS_INGRES_ERR;
+       ingres_errno = MR_INGRES_ERR;
     }
-    com_err(whoami, SMS_INGRES_ERR, " code %d\n", *num);
+    com_err(whoami, MR_INGRES_ERR, " code %d\n", *num);
     critical_alert("DCM", "Alias build encountered INGRES ERROR %d", *num);
     exit(ingres_errno);
 }
@@ -165,7 +164,9 @@ get_info()
 ##  retrieve (id = machine.mach_id, name = machine.#name) {
       if (s = index(name, '.'))
        *s = 0;
+#ifdef ATHENA
       strcat(name, ".LOCAL");
+#endif
       hash_store(machines, id, strsave(name));
 ##  }
 
@@ -268,29 +269,27 @@ int force;
        return;
     }
     l->maillist = 2;
-    output_mlist(id, l, out);
+    output_mlist(id, l);
 
     if (l->acl_t == 'L' && (l1 = (struct list *)hash_lookup(lists, l->acl_id)))
       save_mlist(0, l1, 1);
     
     for (m = l->m; m; m = m->next) {
        if (m->list_id && (l1 = (struct list *)hash_lookup(lists, m->list_id)))
-         save_mlist(0, l1, 0);
+         save_mlist(0, l1, 1);
     }
 }
 
 
 int lwid, bol, awid;
 
-output_mlist(id, l, dummy)
+output_mlist(id, l)
 int id;
 register struct list *l;
-int dummy;
 {
     struct list *l1;
     register struct member *m;
     struct user *u;
-    int id;
 
     put_fill(out, l->description);
     if (l->acl_t ==  'L') {
@@ -378,9 +377,6 @@ FILE *out;
 do_poboxes(out)
 FILE *out;
 {
-    register char *p;
-    char *index();
-
     fprintf(out, "\n%s\n# User Poboxes\n%s\n", divide, divide);
 
     hash_step(users, do_pobox, out);
This page took 0.059798 seconds and 4 git commands to generate.