]> andersk Git - moira.git/commitdiff
Solaris/POSIX changes
authordanw <danw>
Mon, 20 Jan 1997 18:24:10 +0000 (18:24 +0000)
committerdanw <danw>
Mon, 20 Jan 1997 18:24:10 +0000 (18:24 +0000)
incremental/Imakefile
incremental/afs.c
incremental/afs_create.pl
incremental/afs_quota.pl
incremental/afs_utils.pl
incremental/ksrvtgt.c

index 9fd2732b2eeb54ec586b8944a5edaf5bbe6fb0d0..f026a728ce91ed374b6a60facb921b9e10675183 100644 (file)
@@ -4,13 +4,14 @@ AFSDIR = /mit/afsuser
 AFSLIBS=$(AFSDIR)/lib/afs/libprot.a    $(AFSDIR)/lib/afs/libauth.a \
        $(AFSDIR)/lib/libubik.a        $(AFSDIR)/lib/afs/util.a \
        $(AFSDIR)/lib/librxkad.a       $(AFSDIR)/lib/afs/libsys.a \
-       $(AFSDIR)/lib/librx.a          $(AFSDIR)/lib/liblwp.a
+       $(AFSDIR)/lib/librx.a          $(AFSDIR)/lib/liblwp.a \
+       $(AFSDIR)/lib/afs/libaudit.a   -lbsd
 
 SRCS = afs.c ksrvtgt.c
 CODE = $(SRCS)
 DEBUG = -O
-CFLAGS = -I../include -I$(AFSDIR)/include -I/usr/athena/include $(DEBUG)
-LIBS = -L../lib -L/usr/athena/lib -lmoira -lzephyr -lmrgdb -lcom_err -lhesiod -lkrb -ldes
+CFLAGS = -I../include -I../lib -I$(AFSDIR)/include -I/usr/athena/include $(DEBUG)
+LIBS = -L../lib -L../gdb -L/usr/athena/lib -lmoira -lzephyr -lmrgdb -lcom_err -lhesiod -lkrb -ldes
 SRCDIR = $(SRCTOP)/incremental
 
 program(afs.incr,afs.o,,${AFSLIBS} ${LIBS},${PROGDIR})
index fcdcd78a2dcab120489269403937ace8cf13b25a..f55bf199719a5a8ddb2bd829ba81e8b3191f9276 100644 (file)
@@ -11,6 +11,7 @@
 #include <sys/types.h>
 #include <sys/file.h>
 #include <strings.h>
+#include <unistd.h>
 
 #include <krb.h>
 #include <moira.h>
@@ -44,7 +45,7 @@ int add_user_lists();
 int add_list_members();
 int check_user();
 int edit_group();
-int pr_try();
+long pr_try();
 int check_afs();
 
 /* libprot.a routines */
@@ -78,7 +79,7 @@ int argc;
     for (i = getdtablesize() - 1; i > 2; i--)
       close(i);
 
-    whoami = ((whoami = rindex(argv[0], '/')) ? whoami++ : argv[0]);
+    whoami = ((whoami = strrchr(argv[0], '/')) ? whoami+1 : argv[0]);
 
     table = argv[1];
     beforec = atoi(argv[2]);
@@ -86,7 +87,7 @@ int argc;
     afterc = atoi(argv[3]);
     after = &argv[4 + beforec];
 
-    setlinebuf(stdout);
+    setvbuf(stdout, NULL, _IOLBF, BUFSIZ);
 
     strcpy(tbl_buf, table);
     strcat(tbl_buf, " (");
@@ -113,7 +114,7 @@ int argc;
        do_user(before, beforec, after, afterc);
     } else if (!strcmp(table, "list")) {
        do_list(before, beforec, after, afterc);
-    } else if (!strcmp(table, "members")) {
+    } else if (!strcmp(table, "imembers")) {
        do_member(before, beforec, after, afterc);
     } else if (!strcmp(table, "filesys")) {
        do_filesys(before, beforec, after, afterc);
@@ -603,7 +604,7 @@ long pr_try(fn, a1, a2, a3, a4, a5, a6, a7, a8)
     char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8;
 {
     static int initd=0;
-    volatile register long code;
+    register long code;
     register int tries = 0;
 #ifdef DEBUG
     char fname[64];
@@ -685,12 +686,8 @@ moira_connect()
     long code;
 
     if (!mr_connections++) {
-#ifdef DEBUG
-       code = mr_connect("moira");
-#else
        gethostname(hostname, sizeof(hostname));
        code = mr_connect(hostname);
-#endif
        if (!code) code = mr_auth("afs.incr");
        return code;    
     }
index 59e0cfed6bc88575355ae7e2a2f3287d4a3f5b32..09d9c7a3f1e81d2bb2aa2486069fd9848e424e3a 100644 (file)
@@ -131,8 +131,8 @@ sub athena_proc
     }
 
     if ($type =~ /ACTIVITY|APROJ|PROJECT/) {
-       chown($gid,0,$path) ||
-           die "Unable to set volume ownership\n";
+       system("/moira/bin/uchown $path $gid");
+       die "Unable to set volume ownership\n" if ($?);
     } elsif ($type =~ /HOMEDIR|UROP/) {
        chown($uid,0,$path) ||
            die "Unable to set volume ownership\n";
index 893343e685111afd194e9058c0201fcd4c6194fc..3a25816d811fd18e3498b562f03185d816e8cd56 100644 (file)
@@ -1,8 +1,7 @@
 #!/afs/athena/contrib/perl/perl
 # Usage: afs_quota path quota
 
-$incdir = "/mit/moiradev/src/incremental";
-require "$incdir/afs_utils.pl";
+require "/moira/bin/afs_utils.pl";
 
 die "Usage: $0 path quota\n" unless (@ARGV==2);
 
index 06cbecb0fcac06f28a0cb95c26928ee41fe1492a..bdd5a2d2f4753930aa3385a6cba9f93ac05dbdb8 100644 (file)
@@ -1,5 +1,9 @@
 # $Header$
 
+# kludge kludge kludge
+sub __STDC__ {0;}
+require "fcntl.ph";
+
 $afsbin="/moira/bin";
 $vos="$afsbin/vos";
 $pts="$afsbin/pts";
@@ -9,9 +13,6 @@ $zwrite="/usr/athena/bin/zwrite";
 $afs_data="/moira/afs/afs_data";
 $afs_save="$afs_data.tmp";
 
-$LOCK_EX=2;
-$LOCK_UN=8;
-
 %vtypes_ATHENA_MIT_EDU =
     ("ACTIVITY", "activity",
      "APROJ", "aproj",
@@ -42,11 +43,17 @@ $LOCK_UN=8;
 # 8. Close the data file.
 
 
+$flock_t="ssllllllll";
+
 sub afs_lock
 {
     open(SRV,"+<$afs_data") || die "Unable to open $afs_data\n";
     select((select(SRV), $|=1)[$[]);
-    flock(SRV, $LOCK_EX) || die "Unable to lock $afs_data\n";
+    $flkarr[0]=&F_WRLCK;
+    $flkarr[1]=$flkarr[2]=$flkarr[3]=$flkarr[4]=$flkarr[5]=$flkarr[6]=0;
+    $flkarr[7]=$flkarr[8]=$flkarr[9]=0;
+    $flk=pack($flock_t,@flkarr);
+    fcntl(SRV, &F_SETLKW, $flk) || die "Unable to lock $afs_data:$!\n";
     die "Temporary status file: $afs_save exists... aborting\n"
        if (-f $afs_save);
     open(SRV2, ">$afs_save");
index 4c611a9f55a193501aa65bd143dc7a8547fda975..bae09a47245afefdb4e0a755dba38b6ab4ae329e 100644 (file)
@@ -41,8 +41,8 @@ main(argc,argv)
     int i, lifetime = 1;
     char srvtab[MAXPATHLEN + 1];
 
-    bzero(realm, sizeof(realm));
-    bzero(srvtab, sizeof(srvtab));
+    memset(realm, 0, sizeof(realm));
+    memset(srvtab, 0, sizeof(srvtab));
 
     if (argc < 3)
       usage(argv);
This page took 1.392387 seconds and 5 git commands to generate.