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})
#include <sys/types.h>
#include <sys/file.h>
#include <strings.h>
+#include <unistd.h>
#include <krb.h>
#include <moira.h>
int add_list_members();
int check_user();
int edit_group();
-int pr_try();
+long pr_try();
int check_afs();
/* libprot.a routines */
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]);
afterc = atoi(argv[3]);
after = &argv[4 + beforec];
- setlinebuf(stdout);
+ setvbuf(stdout, NULL, _IOLBF, BUFSIZ);
strcpy(tbl_buf, table);
strcat(tbl_buf, " (");
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);
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];
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;
}
}
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";
#!/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);
# $Header$
+# kludge kludge kludge
+sub __STDC__ {0;}
+require "fcntl.ph";
+
$afsbin="/moira/bin";
$vos="$afsbin/vos";
$pts="$afsbin/pts";
$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",
# 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");
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);