From df7ff685b7ef1bc8540b945f6824fa66f57c9e9b Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Mon, 18 Oct 2004 08:11:37 +0000 Subject: [PATCH] STABLE14-resync-20041018 cheat. pull in all the 1.3.71->head changes in one delta --- configure-libafs.in | 2 +- configure.in | 2 +- src/afs/LINUX/osi_groups.c | 4 +- src/afs/LINUX/osi_prototypes.h | 3 - src/afs/SOLARIS/osi_vnodeops.c | 2 +- src/afs/afs_buffer.c | 21 +- src/afs/afs_osi.h | 6 +- src/afs/afs_osi_pag.c | 87 ++++++-- src/afs/afs_prototypes.h | 6 +- src/auth/Makefile.in | 2 +- src/bucoord/commands.c | 10 +- src/bucoord/dump_sched.c | 3 +- src/bucoord/restore.c | 2 +- src/butc/lwps.c | 10 +- src/butc/recoverDb.c | 15 +- src/butm/test_ftm.c | 4 +- src/config/param.amd64_linux26.h | 147 +++++++++++++ src/des/cbc_encrypt.c | 2 +- src/des/des_prototypes.h | 6 +- src/des/pcbc_encrypt.c | 2 +- src/kauth/Makefile.in | 4 +- src/libafsauthent/Makefile.in | 4 + src/libafsauthent/NTMakefile | 1 + src/libafsrpc/Makefile.in | 8 +- src/libafsrpc/afsrpc.def | 3 +- src/libafsrpc/mapfile | 117 ----------- src/ptserver/pts.c | 2 +- src/ptserver/ptuser.c | 6 +- src/rx/rx.h | 13 +- src/rx/rx_getaddr.c | 46 ++-- src/rx/rx_globals.h | 1 + src/rx/rx_prototypes.h | 1 + src/rx/rx_rdwr.c | 2 +- src/rxkad/Makefile.in | 25 +-- src/scout/Makefile.in | 2 +- src/shlibafsauthent/Makefile.in | 4 + src/shlibafsrpc/Makefile.in | 4 +- src/shlibafsrpc/NTMakefile | 349 ------------------------------- src/shlibafsrpc/afsrpc.def | 200 ------------------ src/shlibafsrpc/afsrpc.rc | 18 -- src/ubik/Makefile.in | 3 +- src/ubik/NTMakefile | 1 + src/ubik/udebug.c | 2 +- src/ubik/uinit.c | 206 ++++++++++++++++++ src/util/Makefile.in | 8 +- src/util/ktime.c | 3 +- src/util/netutils.c | 9 + src/util/serverLog.c | 3 +- src/venus/fs.c | 161 +++++--------- src/viced/callback.c | 9 +- src/viced/host.c | 1 + src/viced/viced.c | 9 +- src/vlserver/vlclient.c | 97 +-------- src/vol/listinodes.c | 26 +-- src/vol/namei_ops.h | 8 +- src/vol/ntops.c | 25 +-- src/vol/ntops.h | 8 +- src/volser/volmain.c | 22 +- src/volser/volprocs.c | 40 ++-- src/volser/voltrans.c | 26 ++- src/volser/vsutils.c | 126 +---------- 61 files changed, 704 insertions(+), 1235 deletions(-) create mode 100644 src/config/param.amd64_linux26.h delete mode 100644 src/libafsrpc/mapfile delete mode 100644 src/shlibafsrpc/NTMakefile delete mode 100644 src/shlibafsrpc/afsrpc.def delete mode 100644 src/shlibafsrpc/afsrpc.rc create mode 100644 src/ubik/uinit.c diff --git a/configure-libafs.in b/configure-libafs.in index 93fe6746c..e2bc7a75b 100644 --- a/configure-libafs.in +++ b/configure-libafs.in @@ -1,5 +1,5 @@ AC_INIT(src/libafs/Makefile.common.in) -AM_INIT_AUTOMAKE(openafs-libafs,1.3.71) +AM_INIT_AUTOMAKE(openafs-libafs,1.3.72) AC_CONFIG_HEADER(src/config/afsconfig.h) define(OPENAFS_CONFIGURE_LIBAFS) diff --git a/configure.in b/configure.in index 7395939a7..84067d4ff 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ AC_INIT(src/config/stds.h) -AM_INIT_AUTOMAKE(openafs,1.3.71) +AM_INIT_AUTOMAKE(openafs,1.3.72) AC_CONFIG_HEADER(src/config/afsconfig.h) AC_PROG_CC diff --git a/src/afs/LINUX/osi_groups.c b/src/afs/LINUX/osi_groups.c index c872ec28f..26fd2d2ad 100644 --- a/src/afs/LINUX/osi_groups.c +++ b/src/afs/LINUX/osi_groups.c @@ -222,7 +222,7 @@ setpag(cred_t ** cr, afs_uint32 pagvalue, afs_uint32 * newpag, /* Intercept the standard system call. */ -extern long (*sys_setgroupsp) (int gidsetsize, gid_t * grouplist); +extern asmlinkage long (*sys_setgroupsp) (int gidsetsize, gid_t * grouplist); asmlinkage long afs_xsetgroups(int gidsetsize, gid_t * grouplist) { @@ -256,7 +256,7 @@ afs_xsetgroups(int gidsetsize, gid_t * grouplist) #if defined(AFS_LINUX24_ENV) /* Intercept the standard uid32 system call. */ -extern long (*sys_setgroups32p) (int gidsetsize, gid_t * grouplist); +extern asmlinkage long (*sys_setgroups32p) (int gidsetsize, gid_t * grouplist); asmlinkage long afs_xsetgroups32(int gidsetsize, gid_t * grouplist) { diff --git a/src/afs/LINUX/osi_prototypes.h b/src/afs/LINUX/osi_prototypes.h index b39361a6d..233e8af93 100644 --- a/src/afs/LINUX/osi_prototypes.h +++ b/src/afs/LINUX/osi_prototypes.h @@ -36,9 +36,6 @@ extern int osi_lookupname(char *aname, uio_seg_t seg, int followlink, extern int osi_InitCacheInfo(char *aname); extern int osi_rdwr(int rw, struct osi_file *file, caddr_t addrp, size_t asize, size_t * resid); -extern void inline setup_uio(uio_t * uiop, struct iovec *iovecp, char *buf, - afs_offs_t pos, int count, uio_flag_t flag, - uio_seg_t seg); extern int osi_file_uio_rdwr(struct osi_file *osifile, uio_t * uiop, int rw); extern void afs_osi_SetTime(osi_timeval_t * tvp); extern void osi_linux_free_inode_pages(void); diff --git a/src/afs/SOLARIS/osi_vnodeops.c b/src/afs/SOLARIS/osi_vnodeops.c index d86fbbe78..07600f8c9 100644 --- a/src/afs/SOLARIS/osi_vnodeops.c +++ b/src/afs/SOLARIS/osi_vnodeops.c @@ -1069,7 +1069,7 @@ afs_nfsrdwr(avc, auio, arw, ioflag, acred) /* do ulimit processing; shrink resid or fail */ #if defined(AFS_SUN56_ENV) if (auio->uio_loffset + auio->afsio_resid > auio->uio_llimit) { - if (auio->uio_llimit >= auio->uio_llimit) { + if (auio->uio_loffset >= auio->uio_llimit) { ReleaseWriteLock(&avc->lock); afs_BozonUnlock(&avc->pvnLock, avc); return EFBIG; diff --git a/src/afs/afs_buffer.c b/src/afs/afs_buffer.c index 47a24d4d1..0b56b262f 100644 --- a/src/afs/afs_buffer.c +++ b/src/afs/afs_buffer.c @@ -63,7 +63,7 @@ RCSID /* page hash table size - this is pretty intertwined with pHash */ #define PHSIZE (PHPAGEMASK + PHFIDMASK + 1) /* the pHash macro */ -#define pHash(fid,page) ((((afs_int32)((fid)[0])) & PHFIDMASK) \ +#define pHash(fid,page) ((((afs_int32)((fid)->inode)) & PHFIDMASK) \ | (page & PHPAGEMASK)) #ifdef dirty @@ -88,7 +88,7 @@ static int nbuffers; static afs_int32 timecounter; /* Prototypes for static routines */ -static struct buffer *afs_newslot(afs_inode_t * afid, afs_int32 apage, +static struct buffer *afs_newslot(struct fcache * afid, afs_int32 apage, register struct buffer *lp); static int dinit_flag = 0; @@ -150,7 +150,7 @@ DInit(int abuffers) } void * -DRead(register afs_inode_t * fid, register int page) +DRead(register struct fcache * fid, register int page) { /* Read a page from the disk. */ register struct buffer *tb, *tb2; @@ -224,14 +224,13 @@ DRead(register afs_inode_t * fid, register int page) MObtainWriteLock(&tb->lock, 260); MReleaseWriteLock(&afs_bufferLock); tb->lockers++; - tfile = afs_CFileOpen(fid[0]); - if (page * AFS_BUFFER_PAGESIZE >= tfile->size) { + if (page * AFS_BUFFER_PAGESIZE >= fid->chunkBytes) { dirp_Zap(tb->fid); tb->lockers--; MReleaseWriteLock(&tb->lock); - afs_CFileClose(tfile); return NULL; } + tfile = afs_CFileOpen(fid->inode); code = afs_CFileRead(tfile, tb->page * AFS_BUFFER_PAGESIZE, tb->data, AFS_BUFFER_PAGESIZE); @@ -274,7 +273,7 @@ FixupBucket(register struct buffer *ap) /* lp is pointer to a fairly-old buffer */ static struct buffer * -afs_newslot(afs_inode_t * afid, afs_int32 apage, register struct buffer *lp) +afs_newslot(struct fcache * afid, afs_int32 apage, register struct buffer *lp) { /* Find a usable buffer slot */ register afs_int32 i; @@ -341,7 +340,7 @@ afs_newslot(afs_inode_t * afid, afs_int32 apage, register struct buffer *lp) } if (lp->dirty) { - tfile = afs_CFileOpen(lp->fid[0]); + tfile = afs_CFileOpen(lp->fid->inode); afs_CFileWrite(tfile, lp->page * AFS_BUFFER_PAGESIZE, lp->data, AFS_BUFFER_PAGESIZE); lp->dirty = 0; @@ -433,7 +432,7 @@ DVOffset(register void *ap) * method of DRead... */ void -DZap(afs_inode_t * fid) +DZap(struct fcache * fid) { register int i; /* Destroy all buffers pertaining to a particular fid. */ @@ -470,7 +469,7 @@ DFlush(void) tb->lockers++; MReleaseReadLock(&afs_bufferLock); if (tb->dirty) { - tfile = afs_CFileOpen(tb->fid[0]); + tfile = afs_CFileOpen(tb->fid->inode); afs_CFileWrite(tfile, tb->page * AFS_BUFFER_PAGESIZE, tb->data, AFS_BUFFER_PAGESIZE); tb->dirty = 0; /* Clear the dirty flag */ @@ -485,7 +484,7 @@ DFlush(void) } void * -DNew(register afs_inode_t * fid, register int page) +DNew(register struct fcache * fid, register int page) { /* Same as read, only do *not* even try to read the page, since it probably doesn't exist. */ register struct buffer *tb; diff --git a/src/afs/afs_osi.h b/src/afs/afs_osi.h index 923c92e95..9471ba8e1 100644 --- a/src/afs/afs_osi.h +++ b/src/afs/afs_osi.h @@ -187,9 +187,9 @@ typedef struct timeval osi_timeval_t; * The following three routines provide the fid routines used by the buffer * and directory packages. */ -#define dirp_Zap(afid) (*(afid) = -1) -#define dirp_Eq(afid, bfid) (*(afid) == *(bfid)) -#define dirp_Cpy(dfid,sfid) (*(dfid) = *(sfid)) +#define dirp_Zap(afid) ((afid) = 0) +#define dirp_Eq(afid, bfid) ((afid) == (bfid)) +#define dirp_Cpy(dfid,sfid) ((dfid) = (sfid)) /* diff --git a/src/afs/afs_osi_pag.c b/src/afs/afs_osi_pag.c index 12b7d54ec..7f191b472 100644 --- a/src/afs/afs_osi_pag.c +++ b/src/afs/afs_osi_pag.c @@ -139,6 +139,43 @@ getpag(void) * activates tokens repeatedly) for that entire period. */ +static int afs_pag_sleepcnt = 0; + +static int +afs_pag_sleep(struct AFS_UCRED **acred) +{ + int rv = 0; + if(!afs_suser(acred)) { + if(osi_Time() - pag_epoch < pagCounter) { + rv = 1; + } + } + + return rv; +} + +static int +afs_pag_wait(struct AFS_UCRED **acred) +{ + if(afs_pag_sleep(acred)) { + if(!afs_pag_sleepcnt) { + printf("%s() PAG throttling triggered, pid %d... sleeping. sleepcnt %d\n", + __func__, getpid(), afs_pag_sleepcnt); + } + + afs_pag_sleepcnt++; + + do { + /* XXX spins on EINTR */ + afs_osi_Wait(1000, (struct afs_osi_WaitHandle *)0, 0); + } while(afs_pag_sleep(acred)); + + afs_pag_sleepcnt--; + } + + return 0; +} + int #if defined(AFS_SUN5_ENV) afs_setpag(struct AFS_UCRED **credpp) @@ -148,6 +185,15 @@ afs_setpag(struct proc *p, void *args, int *retval) afs_setpag(void) #endif { + +#if defined(AFS_SUN5_ENV) + struct AFS_UCRED **acred = *credpp; +#elif defined(AFS_OBSD_ENV) + struct AFS_UCRED **acred = p->p_ucred; +#else + struct AFS_UCRED **acred = NULL; +#endif + int code = 0; #if defined(AFS_SGI53_ENV) && defined(MP) @@ -156,18 +202,10 @@ afs_setpag(void) #endif /* defined(AFS_SGI53_ENV) && defined(MP) */ AFS_STATCNT(afs_setpag); -#if defined(AFS_SUN5_ENV) - if (!afs_suser(*credpp)) -#elif defined(AFS_OBSD_ENV) - if (!afs_osi_suser(p->p_ucred)) -#else - if (!afs_suser(NULL)) -#endif - { - while (osi_Time() - pag_epoch < pagCounter) { - afs_osi_Wait(1000, (struct afs_osi_WaitHandle *)0, 0); - } - } + + afs_pag_wait(acred); + + #if defined(AFS_SUN5_ENV) code = AddPag(genpag(), credpp); #elif defined(AFS_OSF_ENV) || defined(AFS_XBSD_ENV) @@ -213,13 +251,16 @@ afs_setpag(void) #endif afs_Trace1(afs_iclSetp, CM_TRACE_SETPAG, ICL_TYPE_INT32, code); + #if defined(KERNEL_HAVE_UERROR) if (!getuerror()) setuerror(code); #endif + #if defined(AFS_SGI53_ENV) && defined(MP) AFS_GUNLOCK(); #endif /* defined(AFS_SGI53_ENV) && defined(MP) */ + return (code); } @@ -240,6 +281,15 @@ afs_setpag_val(struct proc *p, void *args, int *retval, int pagval) afs_setpag_val(int pagval) #endif { + +#if defined(AFS_SUN5_ENV) + struct AFS_UCRED **acred = *credp; +#elif defined(AFS_OBSD_ENV) + struct AFS_UCRED **acred = p->p_ucred; +#else + struct AFS_UCRED **acred = NULL; +#endif + int code = 0; #if defined(AFS_SGI53_ENV) && defined(MP) @@ -248,16 +298,9 @@ afs_setpag_val(int pagval) #endif /* defined(AFS_SGI53_ENV) && defined(MP) */ AFS_STATCNT(afs_setpag); -#ifdef AFS_SUN5_ENV - if (!afs_suser(*credpp)) -#else - if (!afs_suser(NULL)) -#endif - { - while (osi_Time() - pag_epoch < pagCounter) { - afs_osi_Wait(1000, (struct afs_osi_WaitHandle *)0, 0); - } - } + + afs_pag_wait(acred); + #if defined(AFS_SUN5_ENV) code = AddPag(pagval, credpp); #elif defined(AFS_OSF_ENV) || defined(AFS_XBSD_ENV) diff --git a/src/afs/afs_prototypes.h b/src/afs/afs_prototypes.h index c08265e4c..a185eaf4e 100644 --- a/src/afs/afs_prototypes.h +++ b/src/afs/afs_prototypes.h @@ -31,12 +31,12 @@ extern void afs_FreeAllAxs(struct axscache **headp); /* afs_buffer.c */ extern void DInit(int abuffers); -extern void *DRead(register afs_inode_t * fid, register int page); +extern void *DRead(register struct fcache * fid, register int page); extern void DRelease(register struct buffer *bp, int flag); extern int DVOffset(register void *ap); -extern void DZap(afs_inode_t * fid); +extern void DZap(struct fcache * fid); extern void DFlush(void); -extern void *DNew(register afs_inode_t * fid, register int page); +extern void *DNew(register struct fcache * fid, register int page); extern void shutdown_bufferpackage(void); /* afs_call.c */ diff --git a/src/auth/Makefile.in b/src/auth/Makefile.in index f768f1b77..33797066b 100644 --- a/src/auth/Makefile.in +++ b/src/auth/Makefile.in @@ -36,7 +36,7 @@ copyauth.o: copyauth.c ${INCLS} AFS_component_version_number.o setkey.o: setkey.c ${INCLS} AFS_component_version_number.o ktc.krb.o: ktc.c ${INCLS} ${TOP_INCDIR}/afs/vice.h - ${CC} ${CFLAGS} -DAFS_KERBEROS_ENV -c ${srcdir}/ktc.c -o ktc.krb.o + ${CCOBJ} ${CFLAGS} -DAFS_KERBEROS_ENV -c ${srcdir}/ktc.c -o ktc.krb.o libauth.a: $(OBJS) AFS_component_version_number.o -$(RM) -f libauth.a diff --git a/src/bucoord/commands.c b/src/bucoord/commands.c index 423de31bd..49c08773a 100644 --- a/src/bucoord/commands.c +++ b/src/bucoord/commands.c @@ -626,7 +626,8 @@ compactDateString(date_long, string, size) if (*date_long == NEVERDATE) { sprintf(string, "NEVER"); } else { - ltime = localtime(date_long); + time_t t = *date_long; + ltime = localtime(&t); /* prints date in U.S. format of mm/dd/yyyy */ strftime(string, size, "%m/%d/%Y %H:%M", ltime); } @@ -2902,13 +2903,14 @@ dumpInfo(dumpid, detailFlag) printf("----\n"); printDumpEntry(&dumpEntry); } else { + time_t t = dumpEntry.created; if (dbDump) printf("Dump: id %u, created: %s\n", dumpEntry.id, - ctime(&dumpEntry.created)); - else + ctime(&t)); + else printf("Dump: id %u, level %d, volumes %d, created: %s\n", dumpEntry.id, dumpEntry.level, dumpEntry.nVolumes, - ctime(&dumpEntry.created)); + ctime(&t)); } if (!detailFlag && (strlen(dumpEntry.tapes.tapeServer) > 0) diff --git a/src/bucoord/dump_sched.c b/src/bucoord/dump_sched.c index fcf76f7b0..f99db4159 100644 --- a/src/bucoord/dump_sched.c +++ b/src/bucoord/dump_sched.c @@ -581,7 +581,8 @@ ListDumpSchedule(adump, alevel) case BC_ABS_EXPDATE: /* absolute expiration date. Never expires if date is 0 */ if (adump->expDate) { - printf("expires at %.24s", cTIME(&adump->expDate)); + time_t t = adump->expDate; + printf("expires at %.24s", cTIME(&t)); } break; diff --git a/src/bucoord/restore.c b/src/bucoord/restore.c index 122291127..513de7ea9 100644 --- a/src/bucoord/restore.c +++ b/src/bucoord/restore.c @@ -195,7 +195,7 @@ bc_Restorer(aindex) afs_int32 partitionAll; /* Likewise for partition */ struct hostent *hostPtr; long haddr; - u_long did; + time_t did; int foundtape, c; extern statusP createStatusNode(); diff --git a/src/butc/lwps.c b/src/butc/lwps.c index 1ce9e4120..534ab48b4 100644 --- a/src/butc/lwps.c +++ b/src/butc/lwps.c @@ -2287,6 +2287,7 @@ PrintTapeLabel(labelptr) struct butm_tapeLabel *labelptr; { char tapeName[BU_MAXTAPELEN + 32]; + time_t t; printf("Tape label\n"); printf("----------\n"); @@ -2294,9 +2295,12 @@ PrintTapeLabel(labelptr) printf("permanent tape name = %s\n", tapeName); TAPENAME(tapeName, labelptr->AFSName, labelptr->dumpid); printf("AFS tape name = %s\n", tapeName); - printf("creationTime = %s", ctime(&labelptr->creationTime)); - if (labelptr->expirationDate) - printf("expirationDate = %s", cTIME(&labelptr->expirationDate)); + t = labelptr->creationTime; + printf("creationTime = %s", ctime(&t)); + if (labelptr->expirationDate) { + t = labelptr->expirationDate; + printf("expirationDate = %s", cTIME(&t)); + } printf("cell = %s\n", labelptr->cell); printf("size = %u Kbytes\n", labelptr->size); printf("dump path = %s\n", labelptr->dumpPath); diff --git a/src/butc/recoverDb.c b/src/butc/recoverDb.c index 1b66eb9c6..11c53b35e 100644 --- a/src/butc/recoverDb.c +++ b/src/butc/recoverDb.c @@ -59,6 +59,7 @@ PrintDumpLabel(labelptr) struct butm_tapeLabel *labelptr; { char tapeName[BU_MAXTAPELEN + 32]; + time_t t; printf("Dump label\n"); printf("----------\n"); @@ -66,9 +67,12 @@ PrintDumpLabel(labelptr) printf("permanent tape name = %s\n", tapeName); TAPENAME(tapeName, labelptr->AFSName, labelptr->dumpid); printf("AFS tape name = %s\n", tapeName); - printf("creationTime = %s", ctime(&labelptr->creationTime)); - if (labelptr->expirationDate) - printf("expirationDate = %s", cTIME(&labelptr->expirationDate)); + t = labelptr->creationTime; + printf("creationTime = %s", ctime(&t)); + if (labelptr->expirationDate) { + t = labelptr->expirationDate; + printf("expirationDate = %s", cTIME(&t)); + } printf("cell = %s\n", labelptr->cell); printf("size = %u Kbytes\n", labelptr->size); printf("dump path = %s\n", labelptr->dumpPath); @@ -87,6 +91,8 @@ static PrintVolumeHeader(volHeader) struct volumeHeader *volHeader; { + time_t t; + printf("-- volume --\n"); printf("volume name: %s\n", volHeader->volumeName); printf("volume ID %d\n", volHeader->volumeID); @@ -97,7 +103,8 @@ PrintVolumeHeader(volHeader) printf("parentID %d\n", volHeader->parentID); printf("endTime %d\n", volHeader->endTime); /* printf("versionflags %d\n", volHeader->versionflags); */ - printf("clonedate %s\n", ctime(&volHeader->cloneDate)); + t = volHeader->cloneDate; + printf("clonedate %s\n", ctime(&t)); } /* Ask diff --git a/src/butm/test_ftm.c b/src/butm/test_ftm.c index 973e6f218..f8d1406ae 100644 --- a/src/butm/test_ftm.c +++ b/src/butm/test_ftm.c @@ -324,8 +324,8 @@ PerformDumpTest(TestInfo * tip) } past = time(0) - label.creationTime; if ((past < 0) || (past > 5 * 60)) { - printf("label creation time is long ago: %s\n", - ctime(&label.creationTime)); + time_t t = label.creationTime; + printf("label creation time is long ago: %s\n", ctime(&t)); ERROR_EXIT(5); } if (strcmp(label.AFSName, tip->tapeName) != 0) { diff --git a/src/config/param.amd64_linux26.h b/src/config/param.amd64_linux26.h new file mode 100644 index 000000000..9a8444e41 --- /dev/null +++ b/src/config/param.amd64_linux26.h @@ -0,0 +1,147 @@ +#ifndef UKERNEL +/* This section for kernel libafs compiles only */ + +#ifndef AFS_PARAM_H +#define AFS_PARAM_H + +/* In user space the AFS_LINUX20_ENV should be sufficient. In the kernel, + * it's a judgment call. If something is obviously amd64 specific, use that + * #define instead. Note that "20" refers to the linux 2.0 kernel. The "2" + * in the sysname is the current version of the client. This takes into + * account the perferred OS user space configuration as well as the kernel. + */ + +#define AFS_LINUX20_ENV 1 +#define AFS_LINUX22_ENV 1 +#define AFS_LINUX24_ENV 1 +#define AFS_LINUX26_ENV 1 +#define AFS_AMD64_LINUX20_ENV 1 +#define AFS_AMD64_LINUX22_ENV 1 +#define AFS_AMD64_LINUX24_ENV 1 +#define AFS_AMD64_LINUX26_ENV 1 +#define AFS_NONFSTRANS 1 + +#define AFS_MOUNT_AFS "afs" /* The name of the filesystem type. */ +#define AFS_SYSCALL 183 +#define AFS_64BIT_IOPS_ENV 1 +#define AFS_NAMEI_ENV 1 /* User space interface to file system */ +#define AFS_64BIT_ENV 1 +#define AFS_64BIT_CLIENT 1 +#define AFS_64BITPOINTER_ENV 1 /* pointers are 64 bits */ + +#if defined(__KERNEL__) && !defined(KDUMP_KERNEL) +#include + +#include +#ifdef CONFIG_SMP +#ifndef AFS_SMP +#define AFS_SMP 1 +#endif +#endif +/* Using "AFS_SMP" to map to however many #define's are required to get + * MP to compile for Linux + */ +#ifdef AFS_SMP +#ifndef CONFIG_SMP +#define CONFIG_SMP 1 +#endif +#ifndef __SMP__ +#define __SMP__ +#endif +#define AFS_GLOBAL_SUNLOCK +#endif + +#endif /* __KERNEL__ && !DUMP_KERNEL */ + +#include +#define AFS_USERSPACE_IP_ADDR 1 +#define RXK_LISTENER_ENV 1 +#define AFS_GCPAGS 2 /* Set to Userdisabled, allow sysctl to override */ + +#define AFSLITTLE_ENDIAN 1 +#define AFS_HAVE_FFS 1 /* Use system's ffs. */ +#define AFS_HAVE_STATVFS 0 /* System doesn't support statvfs */ +#define AFS_VM_RDWR_ENV 1 /* read/write implemented via VM */ + +#ifdef KERNEL +#ifndef MIN +#define MIN(A,B) ((A) < (B) ? (A) : (B)) +#endif +#ifndef MAX +#define MAX(A,B) ((A) > (B) ? (A) : (B)) +#endif +#endif /* KERNEL */ + +/* Machine / Operating system information */ +#define SYS_NAME "amd64_linux26" +#define SYS_NAME_ID SYS_NAME_ID_amd64_linux26 + +#define USE_UCONTEXT + +#endif /* AFS_PARAM_H */ + + + +#else /* !defined(UKERNEL) */ + +/* This section for user space compiles only */ + +#ifndef AFS_PARAM_H +#define AFS_PARAM_H + +/* In user space the AFS_LINUX20_ENV should be sufficient. In the kernel, + * it's a judgment call. If something is obviously amd64 specific, use that + * #define instead. Note that "20" refers to the linux 2.0 kernel. The "2" + * in the sysname is the current version of the client. This takes into + * account the perferred OS user space configuration as well as the kernel. + */ + +#define UKERNEL 1 /* user space kernel */ +#define AFS_ENV 1 +#define AFS_USR_LINUX20_ENV 1 +#define AFS_USR_LINUX22_ENV 1 +#define AFS_USR_LINUX24_ENV 1 +#define AFS_USR_LINUX26_ENV 1 +#define AFS_NONFSTRANS 1 + +#define AFS_MOUNT_AFS "afs" /* The name of the filesystem type. */ +#define AFS_SYSCALL 183 +#define AFS_64BIT_IOPS_ENV 1 +#define AFS_NAMEI_ENV 1 /* User space interface to file system */ +#include + +#define AFS_USERSPACE_IP_ADDR 1 +#define RXK_LISTENER_ENV 1 +#define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */ + + +/* Machine / Operating system information */ +#define SYS_NAME "amd64_linux26" +#define SYS_NAME_ID SYS_NAME_ID_amd64_linux26 +#define AFSLITTLE_ENDIAN 1 +#define AFS_HAVE_FFS 1 /* Use system's ffs. */ +#define AFS_HAVE_STATVFS 0 /* System doesn't support statvfs */ +#define AFS_VM_RDWR_ENV 1 /* read/write implemented via VM */ + +#define afsio_iov uio_iov +#define afsio_iovcnt uio_iovcnt +#define afsio_offset uio_offset +#define afsio_seg uio_segflg +#define afsio_fmode uio_fmode +#define afsio_resid uio_resid +#define AFS_UIOSYS 1 +#define AFS_UIOUSER UIO_USERSPACE +#define AFS_CLBYTES MCLBYTES +#define AFS_MINCHANGE 2 +#define VATTR_NULL usr_vattr_null + +#define AFS_DIRENT +#ifndef CMSERVERPREF +#define CMSERVERPREF +#endif + +#define USE_UCONTEXT + +#endif /* AFS_PARAM_H */ + +#endif /* !defined(UKERNEL) */ diff --git a/src/des/cbc_encrypt.c b/src/des/cbc_encrypt.c index 5583f0380..a2c8a52a4 100644 --- a/src/des/cbc_encrypt.c +++ b/src/des/cbc_encrypt.c @@ -61,7 +61,7 @@ RCSID des_cblock *iv; * 8 bytes of ivec * */ afs_int32 -des_cbc_encrypt(des_cblock * in, des_cblock * out, register afs_int32 length, +des_cbc_encrypt(void * in, void * out, register afs_int32 length, des_key_schedule key, des_cblock * iv, int encrypt) { register afs_uint32 *input = (afs_uint32 *) in; diff --git a/src/des/des_prototypes.h b/src/des/des_prototypes.h index d7871d22a..dee7c20f1 100644 --- a/src/des/des_prototypes.h +++ b/src/des/des_prototypes.h @@ -18,19 +18,19 @@ extern void test_set(FILE * stream, const char *src, int testbit, extern int des_debug; /* cbc_encrypt.c */ -extern afs_int32 des_cbc_encrypt(des_cblock * in, des_cblock * out, +extern afs_int32 des_cbc_encrypt(void * in, void * out, register afs_int32 length, des_key_schedule key, des_cblock * iv, int encrypt); /* pcbc_encrypt.c */ -extern afs_int32 des_pcbc_encrypt(des_cblock * in, des_cblock * out, +extern afs_int32 des_pcbc_encrypt(void * in, void * out, register afs_int32 length, des_key_schedule key, des_cblock * iv, int encrypt); /* des.c */ -extern afs_int32 des_ecb_encrypt(afs_uint32 * clear, afs_uint32 * cipher, +extern afs_int32 des_ecb_encrypt(void * clear, void * cipher, register des_key_schedule schedule, int encrypt); diff --git a/src/des/pcbc_encrypt.c b/src/des/pcbc_encrypt.c index 854d3b0af..12a22a8b6 100644 --- a/src/des/pcbc_encrypt.c +++ b/src/des/pcbc_encrypt.c @@ -74,7 +74,7 @@ RCSID des_cblock *iv; * 8 bytes of ivec * */ afs_int32 -des_pcbc_encrypt(des_cblock * in, des_cblock * out, register afs_int32 length, +des_pcbc_encrypt(void * in, void * out, register afs_int32 length, des_key_schedule key, des_cblock * iv, int encrypt) { register afs_uint32 *input = (afs_uint32 *) in; diff --git a/src/kauth/Makefile.in b/src/kauth/Makefile.in index 921267042..853eaedfa 100644 --- a/src/kauth/Makefile.in +++ b/src/kauth/Makefile.in @@ -185,10 +185,10 @@ kpwvalid: kpwvalid.o $(LIBS) ${CC} ${LDFLAGS} -o kpwvalid kpwvalid.o ${LIBS} ${XLIBS} user.krb.o: user.c ${INCLS} ${TOP_INCDIR}/afs/vice.h - ${CC} ${CFLAGS} -DAFS_KERBEROS_ENV -c ${srcdir}/user.c -o user.krb.o + ${CCOBJ} ${CFLAGS} -DAFS_KERBEROS_ENV -c ${srcdir}/user.c -o user.krb.o user.o: user.c ${INCLS} ${TOP_INCDIR}/afs/vice.h - ${CC} ${CFLAGS} -c ${srcdir}/user.c + ${CCOBJ} ${CFLAGS} -c ${srcdir}/user.c kdb: kdb.o ${INCLS} ${LIBS} libkauth.a ${CC} ${LDFLAGS} -o kdb kdb.o libkauth.a ${LIBS} ${XLIBS} diff --git a/src/libafsauthent/Makefile.in b/src/libafsauthent/Makefile.in index dbd6b4ac8..04e57910d 100644 --- a/src/libafsauthent/Makefile.in +++ b/src/libafsauthent/Makefile.in @@ -48,6 +48,7 @@ KAUTHOBJS = \ read_passwd.o UBIKOBJS = \ + uinit.o \ ubikclient.o \ uerrors.o \ ubik_int.cs.o \ @@ -160,6 +161,9 @@ read_passwd.o: ${KAUTH}/read_passwd.c ubikclient.o: ${UBIK}/ubikclient.c ${CCRULE} +uinit.o: ${UBIK}/uinit.c + ${CCRULE} + uerrors.o: ${UBIK}/uerrors.c ${CCRULE} diff --git a/src/libafsauthent/NTMakefile b/src/libafsauthent/NTMakefile index 0e65c5eaf..5b8669e7f 100644 --- a/src/libafsauthent/NTMakefile +++ b/src/libafsauthent/NTMakefile @@ -53,6 +53,7 @@ KAUTHOBJS = \ $(OUT)\user_nt.obj UBIKOBJS = \ + $(OUT)\uinit.obj \ $(OUT)\ubikclient.obj \ $(OUT)\uerrors.obj \ $(OUT)\ubik_int.cs.obj \ diff --git a/src/libafsrpc/Makefile.in b/src/libafsrpc/Makefile.in index 435b106cf..ff2f2639f 100644 --- a/src/libafsrpc/Makefile.in +++ b/src/libafsrpc/Makefile.in @@ -202,11 +202,11 @@ md4.o: ${RXKAD}/md4.c md5.o: ${RXKAD}/md5.c ${CCRULE} ${RXKAD}/md5.c -fcrypt.o: ${TOP_OBJDIR}/src/rxkad/fcrypt.c - ${CCRULE} ${TOP_OBJDIR}/src/rxkad/fcrypt.c +fcrypt.o: ${TOP_OBJDIR}/src/rxkad/domestic/fcrypt.c + ${CCRULE} ${TOP_OBJDIR}/src/rxkad/domestic/fcrypt.c -crypt_conn.o: ${TOP_OBJDIR}/src/rxkad/crypt_conn.c - ${CCRULE} ${TOP_OBJDIR}/src/rxkad/crypt_conn.c +crypt_conn.o: ${TOP_OBJDIR}/src/rxkad/domestic/crypt_conn.c + ${CCRULE} ${TOP_OBJDIR}/src/rxkad/domestic/crypt_conn.c AFS_component_version_number.o: ${TOP_OBJDIR}/src/rx/AFS_component_version_number.c ${CCRULE} ${TOP_OBJDIR}/src/rx/AFS_component_version_number.c diff --git a/src/libafsrpc/afsrpc.def b/src/libafsrpc/afsrpc.def index 37cfd4d87..943267bb1 100644 --- a/src/libafsrpc/afsrpc.def +++ b/src/libafsrpc/afsrpc.def @@ -198,4 +198,5 @@ EXPORTS rx_enable_hot_thread @203 DATA xdr_int64 @204 xdr_uint64 @205 - rx_SetMaxMTU @206 + rx_SetMaxMTU @206 + rx_GetConnection @207 diff --git a/src/libafsrpc/mapfile b/src/libafsrpc/mapfile deleted file mode 100644 index ab298407a..000000000 --- a/src/libafsrpc/mapfile +++ /dev/null @@ -1,117 +0,0 @@ -# Copyright 2000, International Business Machines Corporation and others. -# All Rights Reserved. -# -# This software has been released under the terms of the IBM Public -# License. For details, see the LICENSE file in the top-level source -# directory or online at http://www.openafs.org/dl/license10.html - -{ - global: - des_cbc_init; - des_check_key_parity; - des_cksum_init; - des_des_init; - des_fixup_key_parity; - des_init_random_number_generator; - des_is_weak_key; - des_key_sched; - des_random_key; - des_string_to_key; - ktohl; - life_to_time; - rx_DestroyConnection; - rx_EndCall; - rx_Finalize; - rx_GetCachedConnection; - rx_GetCall; - rx_GetIFInfo; - rx_GetSpecific; - rx_Init; - rx_KeyCreate; - rx_NewCall; - rx_NewConnection; - rx_NewService; - rx_PrintPeerStats; - rx_PrintStats; - rx_PrintTheseStats; - rx_ReadProc; - rx_ReleaseCachedConnection; - rx_ServerProc; - rx_SetSpecific; - rx_StartServer; - rx_WriteProc; - rxevent_Init; - rxevent_Post; - rxkad_GetServerInfo; - rxkad_NewClientSecurityObject; - rxkad_NewServerSecurityObject; - rxkad_client_init; - rxkad_crypt_init; - rxnull_NewClientSecurityObject; - rxnull_NewServerSecurityObject; - rxs_Release; - time_to_life; - tkt_CheckTimes; - tkt_DecodeTicket; - tkt_MakeTicket; - xdrrx_create; - hton_syserr_conv; - rxkad_stats; - com_err; - error_message; - rx_socket; - des_pcbc_init; - rxevent_debugFile; - rx_debugFile; - rx_connDeadTime; - rx_maxReceiveSize; - rx_UdpBufSize; - rx_extraQuota; - rx_extraPackets; - rx_tranquil; - rx_getAllAddr; - rx_nWaiting; - rx_stats; - rx_SetNoJumbo; - rx_SetConnDeadTime; - rx_FlushWrite; - rx_thread_id_key; - multi_Finalize; - multi_Select; - multi_Init; - multi_Finalize_Ignore; - add_to_error_table; - xdr_afsUUID; - rx_IncrementTimeAndCount; - rx_enable_stats; - rx_GetServerDebug; - rx_GetServerStats; - rx_GetServerVersion; - rx_GetServerConnections; - rx_stats_mutex; - rx_GetServerPeers; - rx_RetrieveProcessRPCStats; - rx_RetrievePeerRPCStats; - rx_FreeRPCStats; - rx_queryProcessRPCStats; - rx_queryPeerRPCStats; - rx_enableProcessRPCStats; - rx_enablePeerRPCStats; - rx_disableProcessRPCStats; - rx_disablePeerRPCStats; - RXSTATS_ExecuteRequest; - RXSTATS_RetrieveProcessRPCStats; - RXSTATS_RetrievePeerRPCStats; - RXSTATS_QueryProcessRPCStats; - RXSTATS_QueryPeerRPCStats; - RXSTATS_EnableProcessRPCStats; - RXSTATS_EnablePeerRPCStats; - RXSTATS_DisableProcessRPCStats; - RXSTATS_DisablePeerRPCStats; - RXSTATS_QueryRPCStatsVersion; - RXSTATS_ClearProcessRPCStats; - RXSTATS_ClearPeerRPCStats; - - local: - *; -}; diff --git a/src/ptserver/pts.c b/src/ptserver/pts.c index dce5786e9..e33a2d961 100644 --- a/src/ptserver/pts.c +++ b/src/ptserver/pts.c @@ -853,7 +853,7 @@ SetFields(register struct cmd_syndesc *as) idlist ids; namelist names; int i; - afs_int32 mask, flags, ngroups, nusers; + afs_int32 mask, flags=0, ngroups, nusers; if (GetNameOrId(as, &ids, &names)) return PRBADARG; diff --git a/src/ptserver/ptuser.c b/src/ptserver/ptuser.c index bbbc09b72..690d7c46e 100644 --- a/src/ptserver/ptuser.c +++ b/src/ptserver/ptuser.c @@ -86,6 +86,8 @@ pr_Initialize(IN afs_int32 secLevel, IN char *confDir, IN char *cell) /* * Different conf dir; force re-evaluation. */ + if (tdir) + afsconf_Close(tdir); tdir = (struct afsconf_dir *)0; pruclient = (struct ubik_client *)0; } @@ -168,7 +170,7 @@ pr_Initialize(IN afs_int32 secLevel, IN char *confDir, IN char *cell) if (code) scIndex = 0; else { - if (ttoken.kvno >= 0 && ttoken.kvno <= 255) + if (ttoken.kvno >= 0 && ttoken.kvno <= 256) /* this is a kerberos ticket, set scIndex accordingly */ scIndex = 2; else { @@ -178,7 +180,7 @@ pr_Initialize(IN afs_int32 secLevel, IN char *confDir, IN char *cell) scIndex = 2; } sc[2] = - rxkad_NewClientSecurityObject(secLevel, &ttoken.sessionKey, + rxkad_NewClientSecurityObject(rxkad_clear, &ttoken.sessionKey, ttoken.kvno, ttoken.ticketLen, ttoken.ticket); } diff --git a/src/rx/rx.h b/src/rx/rx.h index c4da3756a..6778bbcf4 100644 --- a/src/rx/rx.h +++ b/src/rx/rx.h @@ -211,6 +211,8 @@ returned with an error code of RX_CALL_DEAD ( transient error ) */ #define rx_EnableHotThread() (rx_enable_hot_thread = 1) #define rx_DisableHotThread() (rx_enable_hot_thread = 0) +#define rx_PutConnection(conn) rx_DestroyConnection(conn) + /* A connection is an authenticated communication path, allowing limited multiple asynchronous conversations. */ #ifdef KDUMP_RX_LOCK @@ -248,7 +250,7 @@ struct rx_connection { /* client-- to retransmit the challenge */ struct rx_service *service; /* used by servers only */ u_short serviceId; /* To stamp on requests (clients only) */ - u_short refCount; /* Reference count */ + afs_uint32 refCount; /* Reference count */ u_char flags; /* Defined below */ u_char type; /* Type of connection, defined below */ u_char secondsUntilPing; /* how often to ping for each active call */ @@ -363,7 +365,7 @@ struct rx_peer { /* For garbage collection */ afs_uint32 idleWhen; /* When the refcountwent to zero */ - short refCount; /* Reference count for this structure */ + afs_uint32 refCount; /* Reference count for this structure */ /* Congestion control parameters */ u_char burstSize; /* Reinitialization size for the burst parameter */ @@ -817,7 +819,7 @@ struct rx_debugIn { #define RX_DEBUGI_BADTYPE (-8) #define RX_DEBUGI_VERSION_MINIMUM ('L') /* earliest real version */ -#define RX_DEBUGI_VERSION ('Q') /* Latest version */ +#define RX_DEBUGI_VERSION ('R') /* Latest version */ /* first version w/ secStats */ #define RX_DEBUGI_VERSION_W_SECSTATS ('L') /* version M is first supporting GETALLCONN and RXSTATS type */ @@ -829,6 +831,7 @@ struct rx_debugIn { #define RX_DEBUGI_VERSION_W_IDLETHREADS ('O') #define RX_DEBUGI_VERSION_W_NEWPACKETTYPES ('P') #define RX_DEBUGI_VERSION_W_GETPEER ('Q') +#define RX_DEBUGI_VERSION_W_WAITED ('R') #define RX_DEBUGI_GETSTATS 1 /* get basic rx stats */ #define RX_DEBUGI_GETCONN 2 /* get connection info */ @@ -846,7 +849,8 @@ struct rx_debugStats { char spare1; afs_int32 nWaiting; afs_int32 idleThreads; /* Number of server threads that are idle */ - afs_int32 spare2[8]; + afs_int32 nWaited; + afs_int32 spare2[7]; }; struct rx_debugConn_vL { @@ -971,6 +975,7 @@ extern int rx_callHoldType; #define RX_SERVER_DEBUG_OLD_CONN 0x20 #define RX_SERVER_DEBUG_NEW_PACKETS 0x40 #define RX_SERVER_DEBUG_ALL_PEER 0x80 +#define RX_SERVER_DEBUG_WAITED_CNT 0x100 #define AFS_RX_STATS_CLEAR_ALL 0xffffffff #define AFS_RX_STATS_CLEAR_INVOCATIONS 0x1 diff --git a/src/rx/rx_getaddr.c b/src/rx/rx_getaddr.c index 3d0847a1b..870946997 100644 --- a/src/rx/rx_getaddr.c +++ b/src/rx/rx_getaddr.c @@ -118,9 +118,7 @@ rxi_getaddr(void) #define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len)) static void -rt_xaddrs(cp, cplim, rtinfo) - caddr_t cp, cplim; - struct rt_addrinfo *rtinfo; +rt_xaddrs(caddr_t cp, caddr_t cplim, struct rt_addrinfo *rtinfo) { struct sockaddr *sa; int i; @@ -141,9 +139,7 @@ rt_xaddrs(cp, cplim, rtinfo) */ #if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) int -rx_getAllAddr(buffer, maxSize) - afs_int32 buffer[]; - int maxSize; /* sizeof of buffer in afs_int32 units */ +rx_getAllAddr(afs_int32 buffer[], int maxSize) { size_t needed; int mib[6]; @@ -221,11 +217,8 @@ rx_getAllAddr(buffer, maxSize) } int -rxi_getAllAddrMaskMtu(addrBuffer, maskBuffer, mtuBuffer, maxSize) - afs_int32 addrBuffer[]; /* the network addrs in net byte order */ - afs_int32 maskBuffer[]; /* the subnet masks */ - afs_int32 mtuBuffer[]; /* the MTU sizes */ - int maxSize; /* sizeof of buffer in afs_int32 units */ +rxi_getAllAddrMaskMtu(afs_int32 addrBuffer[], afs_int32 maskBuffer[], + afs_int32 mtuBuffer[], int maxSize) { int s; @@ -279,9 +272,6 @@ rxi_getAllAddrMaskMtu(addrBuffer, maskBuffer, mtuBuffer, maxSize) } if ((ifm->ifm_flags & IFF_UP) == 0) continue; /* not up */ - if (ifm->ifm_flags & IFF_LOOPBACK) { - continue; /* skip aliased loopbacks as well. */ - } while (addrcount > 0) { struct sockaddr_in *a; @@ -322,13 +312,9 @@ rxi_getAllAddrMaskMtu(addrBuffer, maskBuffer, mtuBuffer, maxSize) free(buf); return count; } - - #else -int -rx_getAllAddr(buffer, maxSize) - afs_int32 buffer[]; - int maxSize; /* sizeof of buffer in afs_int32 units */ +static int +rx_getAllAddr_internal(afs_int32 buffer[], int maxSize, int loopbacks) { int s; int i, len, count = 0; @@ -381,7 +367,7 @@ rx_getAllAddr(buffer, maxSize) continue; /* ignore this address */ } if (a->sin_addr.s_addr != 0) { - if (ifr->ifr_flags & IFF_LOOPBACK) { + if (!loopbacks && (ifr->ifr_flags & IFF_LOOPBACK)) { continue; /* skip aliased loopbacks as well. */ } if (count >= maxSize) /* no more space */ @@ -395,6 +381,12 @@ rx_getAllAddr(buffer, maxSize) return count; } +int +rx_getAllAddr(afs_int32 buffer[], int maxSize) +{ + return rx_getAllAddr_internal(buffer, maxSize, 0); +} + /* this function returns the total number of interface addresses * the buffer has to be passed in by the caller. It also returns * the interface mask. If AFS_USERSPACE_IP_ADDR is defined, it @@ -402,11 +394,8 @@ rx_getAllAddr(buffer, maxSize) * by afsi_SetServerIPRank(). */ int -rxi_getAllAddrMaskMtu(addrBuffer, maskBuffer, mtuBuffer, maxSize) - afs_int32 addrBuffer[]; /* the network addrs in net byte order */ - afs_int32 maskBuffer[]; /* the subnet masks */ - afs_int32 mtuBuffer[]; /* the MTU sizes */ - int maxSize; /* sizeof of buffer in afs_int32 units */ +rxi_getAllAddrMaskMtu(afs_int32 addrBuffer[], afs_int32 maskBuffer[], + afs_int32 mtuBuffer[], int maxSize) { int s; int i, len, count = 0; @@ -418,7 +407,7 @@ rxi_getAllAddrMaskMtu(addrBuffer, maskBuffer, mtuBuffer, maxSize) #endif #if !defined(AFS_USERSPACE_IP_ADDR) - count = rx_getAllAddr(addrBuffer, 1024); + count = rx_getAllAddr_internal(addrBuffer, 1024, 1); for (i = 0; i < count; i++) { maskBuffer[i] = htonl(0xffffffff); mtuBuffer[i] = htonl(1500); @@ -458,9 +447,6 @@ rxi_getAllAddrMaskMtu(addrBuffer, maskBuffer, mtuBuffer, maxSize) perror("SIOCGIFFLAGS"); continue; /* ignore this address */ } - if (ifr->ifr_flags & IFF_LOOPBACK) { - continue; /* skip aliased loopbacks as well. */ - } if (count >= maxSize) { /* no more space */ printf("Too many interfaces..ignoring 0x%x\n", diff --git a/src/rx/rx_globals.h b/src/rx/rx_globals.h index a492d1129..b47f4a8a1 100644 --- a/src/rx/rx_globals.h +++ b/src/rx/rx_globals.h @@ -151,6 +151,7 @@ EXT afs_kmutex_t rx_freePktQ_lock; EXT int rx_nFreePackets INIT(0); EXT int rxi_NeedMorePackets INIT(0); EXT int rx_nWaiting INIT(0); +EXT int rx_nWaited INIT(0); EXT int rx_packetReclaims INIT(0); /* largest packet which we can safely receive, initialized to AFS 3.2 value diff --git a/src/rx/rx_prototypes.h b/src/rx/rx_prototypes.h index f06ec425d..6d57e165e 100644 --- a/src/rx/rx_prototypes.h +++ b/src/rx/rx_prototypes.h @@ -26,6 +26,7 @@ extern void rx_SetConnDeadTime(register struct rx_connection *conn, register int seconds); extern void rxi_CleanupConnection(struct rx_connection *conn); extern void rxi_DestroyConnection(register struct rx_connection *conn); +extern void rx_GetConnection(register struct rx_connection *conn); extern void rx_DestroyConnection(register struct rx_connection *conn); extern struct rx_call *rx_NewCall(register struct rx_connection *conn); extern int rxi_HasActiveCalls(register struct rx_connection *aconn); diff --git a/src/rx/rx_rdwr.c b/src/rx/rx_rdwr.c index 9402f118b..f31548baa 100644 --- a/src/rx/rx_rdwr.c +++ b/src/rx/rx_rdwr.c @@ -1301,7 +1301,7 @@ rxi_FlushWrite(register struct rx_call *call) return; } cp->length = 0; - cp->niovecs = 1; /* just the header */ + cp->niovecs = 2; /* header + space for rxkad stuff */ call->nFree = 0; } diff --git a/src/rxkad/Makefile.in b/src/rxkad/Makefile.in index 40d1b6fe9..c19ae6854 100644 --- a/src/rxkad/Makefile.in +++ b/src/rxkad/Makefile.in @@ -65,8 +65,6 @@ librxkad.a: ${OBJS} AFS_component_version_number.o $(AR) crv $@ ${OBJS} AFS_component_version_number.o $(RANLIB) $@ -crypt_conn.o: fcrypt.h private_data.h crypt_conn.c ${INCLS} - rxkad_client.o: fcrypt.h private_data.h rxkad_client.c ${INCLS} rxkad_server.o: fcrypt.h private_data.h rxkad_server.c ${INCLS} @@ -89,14 +87,18 @@ md4.o: md4.c ${INCLS} md5.o: md5.c ${INCLS} -fcrypt.o: fcrypt.c fcrypt.h sboxes.h rxkad.h rxkad_prototypes.h - ${CCOBJ} ${CFLAGS} -c fcrypt.c +fcrypt.o: domestic/fcrypt.c fcrypt.h sboxes.h rxkad.h rxkad_prototypes.h + ${CCOBJ} ${CFLAGS} -c domestic/fcrypt.c + +crypt_conn.o: domestic/crypt_conn.c fcrypt.h private_data.h ${INCLS} + ${CCOBJ} ${CFLAGS} -c domestic/crypt_conn.c + +tcrypt.o: domestic/tcrypt.c AFS_component_version_number.o + ${CCOBJ} ${CFLAGS} -c domestic/fcrypt.c tcrypt: tcrypt.o librxkad.a ${CC} -o tcrypt tcrypt.o librxkad.a -tcrypt.o: tcrypt.c AFS_component_version_number.o - fc_test: ${fc_test_OBJS} ${fc_test_LIBS} ${CC} ${CFLAGS} -o fc_test ${fc_test_OBJS} ${fc_test_LIBS} ${XLIBS} @@ -109,7 +111,7 @@ fc_test.o: ${INCLS} clean: $(RM) -f *.o *.a tcrypt core rxkad_errs.c rxkad.h \ AFS_component_version_number.c \ - crypt_conn.c fcrypt.c fcrypt.h sboxes.h \ + fcrypt.h sboxes.h \ fc_test test: @@ -117,21 +119,12 @@ test: # These sources are kept in a separate directory so that we can use an # ACL to comply with source export restrictions. -crypt_conn.c: domestic/crypt_conn.c - ${INSTALL} $? $@ - -fcrypt.c: domestic/fcrypt.c - ${INSTALL} $? $@ - fcrypt.h: domestic/fcrypt.h ${INSTALL} $? $@ sboxes.h: domestic/sboxes.h ${INSTALL} $? $@ -tcrypt.c: domestic/tcrypt.c - ${INSTALL} $? $@ - include ../config/Makefile.version ${DESTDIR}${libdir}/librxkad.a: librxkad.a ${INSTALL} $? $@ diff --git a/src/scout/Makefile.in b/src/scout/Makefile.in index db42c140e..5007c85ee 100644 --- a/src/scout/Makefile.in +++ b/src/scout/Makefile.in @@ -24,6 +24,7 @@ INCLS=${TOP_INCDIR}/afs/gtxobjects.h \ LIBS=${TOP_LIBDIR}/libgtx.a \ ${TOP_LIBDIR}/libfsprobe.a \ ${TOP_LIBDIR}/libvolser.a \ + ${TOP_LIBDIR}/libubik.a \ ${TOP_LIBDIR}/libkauth.a \ ${TOP_LIBDIR}/libauth.a \ ${TOP_LIBDIR}/librxkad.a \ @@ -31,7 +32,6 @@ LIBS=${TOP_LIBDIR}/libgtx.a \ ${TOP_LIBDIR}/libcmd.a \ ${TOP_LIBDIR}/vlib.a ${TOP_LIBDIR}/libacl.a \ ${TOP_LIBDIR}/libvldb.a \ - ${TOP_LIBDIR}/libubik.a \ ${TOP_LIBDIR}/libafsint.a \ ${TOP_LIBDIR}/libsys.a \ ${TOP_LIBDIR}/librx.a \ diff --git a/src/shlibafsauthent/Makefile.in b/src/shlibafsauthent/Makefile.in index 4c01bf03a..306423f26 100644 --- a/src/shlibafsauthent/Makefile.in +++ b/src/shlibafsauthent/Makefile.in @@ -53,6 +53,7 @@ KAUTHOBJS = \ read_passwd.o UBIKOBJS = \ + uinit.o \ ubikclient.o \ uerrors.o \ ubik_int.cs.o \ @@ -175,6 +176,9 @@ read_passwd.o: ${KAUTH}/read_passwd.c ubikclient.o: ${UBIK}/ubikclient.c ${CCRULE} +uinit.o: ${UBIK}/uinit.c + ${CCRULE} + uerrors.o: ${UBIK}/uerrors.c ${CCRULE} diff --git a/src/shlibafsrpc/Makefile.in b/src/shlibafsrpc/Makefile.in index 2c4b5504e..675f7a47f 100644 --- a/src/shlibafsrpc/Makefile.in +++ b/src/shlibafsrpc/Makefile.in @@ -209,10 +209,10 @@ md4.o: ${RXKAD}/md4.c md5.o: ${RXKAD}/md5.c ${CCRULE} -fcrypt.o: ${RXKAD}/fcrypt.c +fcrypt.o: ${RXKAD}/domestic/fcrypt.c ${CCRULE} -crypt_conn.o: ${RXKAD}/crypt_conn.c +crypt_conn.o: ${RXKAD}/domestic/crypt_conn.c ${CCRULE} AFS_component_version_number.o: ${RX}/AFS_component_version_number.c diff --git a/src/shlibafsrpc/NTMakefile b/src/shlibafsrpc/NTMakefile deleted file mode 100644 index 3fc15fa23..000000000 --- a/src/shlibafsrpc/NTMakefile +++ /dev/null @@ -1,349 +0,0 @@ -# Copyright 2000, International Business Machines Corporation and others. -# All Rights Reserved. -# -# This software has been released under the terms of the IBM Public -# License. For details, see the LICENSE file in the top-level source -# directory or online at http://www.openafs.org/dl/license10.html - -RELDIR=shlibafsrpc -!include ..\config\NTMakefile.$(SYS_NAME) -!include ..\config\NTMakefile.version - -RX = ..\rx -RXSTAT = ..\rxstat -RXKAD = ..\rxkad -DES = ..\des -UTIL = ..\util -FSINT = ..\fsint -COMERR = ..\comerr - -# Additional debugging flag for RX. -AFSDEV_AUXCDEFINES = -DRXDEBUG -DAFS_PTHREAD_ENV - -LIBFILE = $(DESTDIR)\lib\afsrpc.dll - -# Object files by category. -MULTIOBJS = $(OUT)\rx_multi.obj - -XDROBJS = $(OUT)\xdr.obj \ - $(OUT)\xdr_array.obj \ - $(OUT)\xdr_arrayn.obj \ - $(OUT)\xdr_float.obj \ - $(OUT)\xdr_mem.obj \ - $(OUT)\xdr_rec.obj \ - $(OUT)\xdr_refernce.obj \ - $(OUT)\xdr_rx.obj \ - $(OUT)\xdr_update.obj \ - $(OUT)\xdr_afsuuid.obj \ - $(OUT)\xdr_int64.obj - -RXOBJS = $(OUT)\rx_event.obj \ - $(OUT)\rx_user.obj \ - $(OUT)\rx_pthread.obj \ - $(OUT)\rx.obj \ - $(OUT)\rx_null.obj \ - $(OUT)\rx_globals.obj \ - $(OUT)\rx_getaddr.obj \ - $(OUT)\rx_misc.obj - $(OUT)\rx_packet.obj \ - $(OUT)\rx_rdwr.obj \ - $(OUT)\rx_trace.obj \ - $(OUT)\rx_xmit_nt.obj \ - $(OUT)\rx_conncache.obj - -RXSTATOBJS = $(OUT)\rxstat.obj \ - $(OUT)\rxstat.ss.obj \ - $(OUT)\rxstat.xdr.obj \ - $(OUT)\rxstat.cs.obj - -LIBRXKAD_OBJS = $(OUT)\rxkad_client.obj \ - $(OUT)\rxkad_server.obj \ - $(OUT)\rxkad_common.obj \ - $(OUT)\ticket.obj \ - $(OUT)\ticket5.obj \ - $(OUT)\crc.obj \ - $(OUT)\md4.obj \ - $(OUT)\md5.obj \ - $(OUT)\AFS_component_version_number.obj - -LIBRXKAD_REGOBJS = $(OUT)\fcrypt.obj \ - $(OUT)\crypt_conn.obj - -DESOBJS = $(OUT)\des.obj \ - $(OUT)\cbc_encrypt.obj \ - $(OUT)\pcbc_encrypt.obj \ - $(OUT)\cksum.obj \ - $(OUT)\new_rnd_key.obj \ - $(OUT)\key_sched.obj \ - $(OUT)\debug_decl.obj \ - $(OUT)\quad_cksum.obj \ - $(OUT)\key_parity.obj \ - $(OUT)\weak_key.obj \ - $(OUT)\strng_to_key.obj \ - $(OUT)\misc.obj \ - $(OUT)\util.obj - -UTILOBJS = $(OUT)\casestrcpy.obj \ - $(OUT)\winsock_nt.obj - -COMERROBJS = $(OUT)\error_msg.obj \ - $(OUT)\et_name.obj \ - $(OUT)\com_err.obj - -FSINTOBJS = $(OUT)\afsint.cs.obj \ - $(OUT)\afsint.xdr.obj \ - $(OUT)\afscbint.cs.obj \ - $(OUT)\afscbint.xdr.obj \ - $(OUT)\afsaux.obj - -DLLOBJS = $(MULTIOBJS) $(RXOBJS) $(XDROBJS) $(RXSTATOBJS) $(LIBRXKAD_OBJS) \ - $(DESOBJS) $(LIBRXKAD_REGOBJS) $(UTILOBJS) $(COMERROBJS) \ - $(FSINTOBJS) afsrpc.res - -rx_multi.obj: $(RX)\rx_multi.c - $(C2OBJ) $(RX)\rx_multi.c - -xdr.obj: $(RX)\xdr.c - $(C2OBJ) $(RX)\xdr.c - -xdr_array.obj: $(RX)\xdr_array.c - $(C2OBJ) $(RX)\xdr_array.c - -xdr_arrayn.obj: $(RX)\xdr_arrayn.c - $(C2OBJ) $(RX)\xdr_arrayn.c - -xdr_float.obj: $(RX)\xdr_float.c - $(C2OBJ) $(RX)\xdr_float.c - -xdr_mem.obj: $(RX)\xdr_mem.c - $(C2OBJ) $(RX)\xdr_mem.c - -xdr_rec.obj: $(RX)\xdr_rec.c - $(C2OBJ) $(RX)\xdr_rec.c - -xdr_refernce.obj: $(RX)\xdr_refernce.c - $(C2OBJ) $(RX)\xdr_refernce.c - -xdr_rx.obj: $(RX)\xdr_rx.c - $(C2OBJ) $(RX)\xdr_rx.c - -xdr_update.obj: $(RX)\xdr_update.c - $(C2OBJ) $(RX)\xdr_update.c - -xdr_afsuuid.obj: $(RX)\xdr_afsuuid.c - $(C2OBJ) $(RX)\xdr_afsuuid.c - -xdr_int64.obj: $(RX)\xdr_int64.c - $(C2OBJ) $(RX)\xdr_int64.c - -rx_event.obj: $(RX)\rx_event.c - $(C2OBJ) $(RX)\rx_event.c - -rx_user.obj: $(RX)\rx_user.c - $(C2OBJ) $(RX)\rx_user.c - -rx_pthread.obj: $(RX)\rx_pthread.c - $(C2OBJ) $(RX)\rx_pthread.c - -rx.obj: $(RX)\rx.c - $(C2OBJ) $(RX)\rx.c - -rx_null.obj: $(RX)\rx_null.c - $(C2OBJ) $(RX)\rx_null.c - -rx_globals.obj: $(RX)\rx_globals.c - $(C2OBJ) $(RX)\rx_globals.c - -rx_getaddr.obj: $(RX)\rx_getaddr.c - $(C2OBJ) $(RX)\rx_getaddr.c - -rx_misc.obj: $(RX)\rx_misc.c - $(C2OBJ) $(RX)\rx_misc.c - -rx_packet.obj: $(RX)\rx_packet.c - $(C2OBJ) $(RX)\rx_packet.c - -rx_rdwr.obj: $(RX)\rx_rdwr.c - $(C2OBJ) $(RX)\rx_rdwr.c - -rx_trace.obj: $(RX)\rx_trace.c - $(C2OBJ) $(RX)\rx_trace.c - -rx_xmit_nt.obj: $(RX)\rx_xmit_nt.c - $(C2OBJ) $(RX)\rx_xmit_nt.c - -rx_conncache.obj: $(RX)\rx_conncache.c - $(C2OBJ) $(RX)\rx_conncache.c - -rxstat.cs.obj:$(RXSTAT)\rxstat.cs.c - $(C2OBJ) $(RXSTAT)\rxstat.cs.c - -rxstat.ss.obj:$(RXSTAT)\rxstat.ss.c - $(C2OBJ) $(RXSTAT)\rxstat.ss.c - -rxstat.xdr.obj:$(RXSTAT)\rxstat.xdr.c - $(C2OBJ) $(RXSTAT)\rxstat.xdr.c - -rxstat.obj:$(RXSTAT)\rxstat.c - $(C2OBJ) $(RXSTAT)\rxstat.c - -rxkad_client.obj:$(RXKAD)\rxkad_client.c - $(C2OBJ) $(RXKAD)\rxkad_client.c - -rxkad_server.obj:$(RXKAD)\rxkad_server.c - $(C2OBJ) $(RXKAD)\rxkad_server.c - -rxkad_common.obj:$(RXKAD)\rxkad_common.c - $(C2OBJ) $(RXKAD)\rxkad_common.c - -ticket.obj:$(RXKAD)\ticket.c - $(C2OBJ) $(RXKAD)\ticket.c - -fcrypt.obj:$(RXKAD)\fcrypt.c - $(C2OBJ) $(RXKAD)\fcrypt.c - -crypt_conn.obj:$(RXKAD)\crypt_conn.c - $(C2OBJ) $(RXKAD)\crypt_conn.c - -AFS_component_version_number.obj:$(RXKAD)\AFS_component_version_number.c - $(C2OBJ) $(RXKAD)\AFS_component_version_number.c - -fcrypt_x.obj:$(RXKAD)\fcrypt.c - $(C2OBJ) $(RXKAD)\fcrypt.c /Fofcrypt_x.obj - -crypt_conn_x.obj:$(RXKAD)\crypt_conn.c - $(C2OBJ) $(RXKAD)\crypt_conn.c /Focrypt_conn_x.obj - -des.obj:$(DES)\des.c - $(C2OBJ) $(DES)\des.c - -cbc_encrypt.obj:$(DES)\cbc_encrypt.c - $(C2OBJ) $(DES)\cbc_encrypt.c - -pcbc_encrypt.obj:$(DES)\pcbc_encrypt.c - $(C2OBJ) $(DES)\pcbc_encrypt.c - -cksum.obj:$(DES)\cksum.c - $(C2OBJ) $(DES)\cksum.c - -new_rnd_key.obj:$(DES)\new_rnd_key.c - $(C2OBJ) $(DES)\new_rnd_key.c - -key_sched.obj:$(DES)\key_sched.c - $(C2OBJ) $(DES)\key_sched.c - -debug_decl.obj:$(DES)\debug_decl.c - $(C2OBJ) $(DES)\debug_decl.c - -quad_cksum.obj:$(DES)\quad_cksum.c - $(C2OBJ) $(DES)\quad_cksum.c - -key_parity.obj:$(DES)\key_parity.c - $(C2OBJ) $(DES)\key_parity.c - -weak_key.obj:$(DES)\weak_key.c - $(C2OBJ) $(DES)\weak_key.c - -strng_to_key.obj:$(DES)\strng_to_key.c - $(C2OBJ) $(DES)\strng_to_key.c - -misc.obj:$(DES)\misc.c - $(C2OBJ) -DDONT_INCL_MAIN $(DES)\misc.c - -util.obj:$(DES)\util.c - $(C2OBJ) $(DES)\util.c - -des_x.obj:$(DES)\des.c - $(C2OBJ) $(DES)\des.c /Fodes_x.obj - -cbc_crypt_x.obj:$(DES)\cbc_encrypt.c - $(C2OBJ) $(DES)\cbc_encrypt.c /Focbc_crypt_x.obj - -pcbc_crypt_x.obj:$(DES)\pcbc_encrypt.c - $(C2OBJ) $(DES)\pcbc_encrypt.c /Fopcbc_crypt_x.obj - -cksum_x.obj:$(DES)\cksum.c - $(C2OBJ) $(DES)\cksum.c /Focksum_x.obj - -nrnd_key_x.obj:$(DES)\new_rnd_key.c - $(C2OBJ) $(DES)\new_rnd_key.c /Fonrnd_key_x.obj - -error_msg.obj:$(COMERR)\error_msg.c - $(C2OBJ) $(COMERR)\error_msg.c - -et_name.obj:$(COMERR)\et_name.c - $(C2OBJ) $(COMERR)\et_name.c - -com_err.obj:$(COMERR)\com_err.c - $(C2OBJ) $(COMERR)\com_err.c - -casestrcpy.obj:$(UTIL)\casestrcpy.c - $(C2OBJ) $(UTIL)\casestrcpy.c - -winsock_nt.obj:$(UTIL)\winsock_nt.c - $(C2OBJ) $(UTIL)\winsock_nt.c - -afsint.cs.obj:$(FSINT)\afsint.cs.c - $(C2OBJ) $(FSINT)\afsint.cs.c - -afsint.xdr.obj:$(FSINT)\afsint.xdr.c - $(C2OBJ) $(FSINT)\afsint.xdr.c - -afscbint.cs.obj:$(FSINT)\afscbint.cs.c - $(C2OBJ) $(FSINT)\afscbint.cs.c - -afscbint.xdr.obj:$(FSINT)\afscbint.xdr.c - $(C2OBJ) $(FSINT)\afscbint.xdr.c - -afsaux.obj:$(FSINT)\afsaux.c - $(C2OBJ) $(FSINT)\afsaux.c - -NTMAKE = nmake /nologo /f ntmakefile - - -DLLLIBS =\ -!IF (("$(SYS_NAME)"=="i386_win95" ) || ("$(SYS_NAME)"=="I386_WIN95" )) - $(DESTDIR)\lib\win95\afspthread.lib \ -!ELSE - $(DESTDIR)\lib\afspthread.lib \ -!ENDIF - $(DESTDIR)\lib\afs\afsutil.lib \ - $(DESTDIR)\lib\afs\afsreg.lib - -$(DESTDIR)\lib\afsrpc.dll: $(DLLOBJS) $(DLLLIBS) - $(DLLCONLINK) /DEF:afsrpc.def - $(DLLPREP) - -# Definitions for generating versioninfo resources -afsrpc.res: afsrpc.rc AFS_component_version_number.h - $(RC) $*.rc - - -install: -! IF (EXIST(..\..\src\des\NTMakefile)) - $(NTMAKE) $(LIBFILE) -! else - $(NTMAKE) libstub -! endif - -install9x: install - -!IF (EXIST(..\..\src\des\NTMakefile)) -!ELSE IF (EXIST(..\..\DESLIB)) -DESPAR = ..\..\DESLIB\dest -!ELSE IF (EXIST(..\..\..\DESLIB)) -DESPAR = ..\..\..\DESLIB\dest -!ELSE -!ERROR Must create DESLIB link in the same directory as PARENT link. -!ENDIF - -libstub: - $(COPY) $(DESPAR)\lib\afsrpc.dll \ - $(DESTDIR)\lib\afsrpc.dll - $(COPY) $(DESPAR)\lib\afsrpc.lib \ - $(DESTDIR)\lib\afsrpc.lib - $(COPY) $(DESPAR)\lib\afsrpc.exp \ - $(DESTDIR)\lib\afsrpc.exp - -clean:: - $(DEL) $(DESTDIR)\lib\afsrpc.dll $(DESTDIR)\lib\afsrpc.lib $(DESTDIR)\lib\afsrpc.exp \ No newline at end of file diff --git a/src/shlibafsrpc/afsrpc.def b/src/shlibafsrpc/afsrpc.def deleted file mode 100644 index 95ec3c992..000000000 --- a/src/shlibafsrpc/afsrpc.def +++ /dev/null @@ -1,200 +0,0 @@ -EXPORTS - des_check_key_parity @2 - des_fixup_key_parity @5 - des_init_random_number_generator @6 - des_is_weak_key @7 - des_key_sched @8 - des_random_key @9 - des_string_to_key @10 - ktohl @11 - life_to_time @12 - rx_DestroyConnection @13 - rx_EndCall @14 - rx_Finalize @15 - rx_GetCachedConnection @16 - rx_GetCall @17 - rx_GetIFInfo @18 - rx_Init @19 - rx_NewCall @20 - rx_NewConnection @21 - rx_NewService @22 - rx_PrintPeerStats @23 - rx_PrintStats @24 - rx_PrintTheseStats @25 - rx_ReadProc @26 - rx_ReleaseCachedConnection @27 - rx_ServerProc @28 - rx_StartServer @29 - rx_WriteProc @30 - rxevent_Init @31 - rxevent_Post @32 - rxkad_GetServerInfo @33 - rxkad_NewClientSecurityObject @34 - rxkad_NewServerSecurityObject @35 - rxnull_NewClientSecurityObject @38 - rxnull_NewServerSecurityObject @39 - rxs_Release @40 - time_to_life @41 - tkt_CheckTimes @42 - tkt_DecodeTicket @43 - tkt_MakeTicket @44 - xdr_array @45 - xdr_bool @46 - xdr_bytes @47 - xdr_char @48 - xdr_double @49 - xdr_enum @50 - xdr_float @51 - xdr_int @52 - xdr_long @53 - xdr_opaque @54 - xdr_pointer @55 - xdr_reference @56 - xdr_short @57 - xdr_string @58 - xdr_u_char @59 - xdr_u_int @60 - xdr_u_long @61 - xdr_u_short @62 - xdr_union @63 - xdr_vector @64 - xdr_void @65 - xdr_wrapstring @66 - xdrmem_create @67 - xdrrec_create @68 - xdrrec_endofrecord @69 - xdrrec_eof @70 - xdrrec_skiprecord @71 - xdrrx_create @72 - hton_syserr_conv @73 - rxkad_stats @74 DATA - com_err @75 - error_message @76 - rx_socket @77 DATA - AssertionFailed @79 - afs_winsockInit @80 - rxevent_debugFile @81 DATA - rx_debugFile @82 DATA - rx_connDeadTime @83 DATA - rx_maxReceiveSize @84 DATA - rx_UdpBufSize @85 DATA - rx_extraQuota @86 DATA - rx_extraPackets @87 DATA - rx_tranquil @88 DATA - rx_getAllAddr @89 - rx_nWaiting @90 DATA - rx_stats @91 DATA - rx_SetNoJumbo @92 - rx_SetConnDeadTime @93 - rx_FlushWrite @94 - rx_thread_id_key @95 DATA - multi_Finalize @96 - multi_Select @97 - multi_Init @98 - multi_Finalize_Ignore @99 - add_to_error_table @100 - xdr_afsUUID @101 - rx_GetSpecific @102 - rx_SetSpecific @103 - rx_KeyCreate @104 - rx_BusyError @105 DATA - rx_BusyThreshold @106 DATA - rx_IncrementTimeAndCount @107 - rx_enable_stats @108 DATA - rx_GetServerDebug @109 - rx_GetServerStats @110 - rx_GetServerVersion @111 - rx_GetServerConnections @112 - rx_stats_mutex @113 DATA - rx_GetServerPeers @114 - rx_RetrieveProcessRPCStats @115 - rx_RetrievePeerRPCStats @116 - rx_FreeRPCStats @117 - rx_queryProcessRPCStats @118 - rx_queryPeerRPCStats @119 - rx_enableProcessRPCStats @120 - rx_enablePeerRPCStats @121 - rx_disableProcessRPCStats @122 - rx_disablePeerRPCStats @123 - RXSTATS_ExecuteRequest @124 - RXSTATS_RetrieveProcessRPCStats @125 - RXSTATS_RetrievePeerRPCStats @126 - RXSTATS_QueryProcessRPCStats @127 - RXSTATS_QueryPeerRPCStats @128 - RXSTATS_EnableProcessRPCStats @129 - RXSTATS_EnablePeerRPCStats @130 - RXSTATS_DisableProcessRPCStats @131 - RXSTATS_DisablePeerRPCStats @132 - RXSTATS_QueryRPCStatsVersion @133 - RXSTATS_ClearProcessRPCStats @134 - RXSTATS_ClearPeerRPCStats @135 - - - rxi_connAbortThreshhold @138 DATA - rxi_connAbortDelay @139 DATA - rxi_callAbortThreshhold @140 DATA - rxi_callAbortDelay @141 DATA - RXSTATS_function_names @142 DATA - RXAFSCB_function_names @143 DATA - RXAFSCB_CallBack @144 - StartRXAFSCB_CallBack @145 - EndRXAFSCB_CallBack @146 - RXAFSCB_InitCallBackState @147 - RXAFSCB_Probe @148 - StartRXAFSCB_Probe @149 - EndRXAFSCB_Probe @150 - RXAFSCB_GetLock @151 - RXAFSCB_GetCE @152 - RXAFSCB_XStatsVersion @153 - RXAFSCB_GetXStats @154 - RXAFSCB_InitCallBackState2 @155 - RXAFSCB_WhoAreYou @156 - RXAFSCB_InitCallBackState3 @157 - RXAFSCB_ProbeUuid @158 - StartRXAFSCB_ProbeUuid @159 - EndRXAFSCB_ProbeUuid @160 - RXAFSCB_GetServerPrefs @161 - RXAFSCB_GetCellServDB @162 - RXAFSCB_GetLocalCell @163 - RXAFSCB_GetCacheConfig @164 - StartRXAFS_FetchData @165 - EndRXAFS_FetchData @166 - RXAFS_FetchACL @167 - RXAFS_FetchStatus @168 - StartRXAFS_StoreData @169 - EndRXAFS_StoreData @170 - RXAFS_StoreACL @171 - RXAFS_StoreStatus @172 - RXAFS_RemoveFile @173 - RXAFS_CreateFile @174 - RXAFS_Rename @175 - RXAFS_Symlink @176 - RXAFS_Link @177 - RXAFS_MakeDir @178 - RXAFS_RemoveDir @179 - RXAFS_OldSetLock @180 - RXAFS_OldExtendLock @181 - RXAFS_OldReleaseLock @182 - RXAFS_GetStatistics @183 - RXAFS_GiveUpCallBacks @184 - RXAFS_GetVolumeInfo @185 - RXAFS_GetVolumeStatus @186 - RXAFS_SetVolumeStatus @187 - RXAFS_GetRootVolume @188 - RXAFS_CheckToken @189 - RXAFS_GetTime @190 - RXAFS_NGetVolumeInfo @191 - RXAFS_BulkStatus @192 - RXAFS_SetLock @193 - RXAFS_ExtendLock @194 - RXAFS_ReleaseLock @195 - RXAFS_XStatsVersion @196 - RXAFS_GetXStats @197 - RXAFS_Lookup @198 - RXAFS_FlushCPS @199 - RXAFS_DFSSymlink @200 - rx_SetRxStatUserOk @201 - rx_RxStatUserOk @202 - rx_enable_hot_thread @203 DATA - xdr_int64 @204 - xdr_uint64 @205 diff --git a/src/shlibafsrpc/afsrpc.rc b/src/shlibafsrpc/afsrpc.rc deleted file mode 100644 index 218fd55c0..000000000 --- a/src/shlibafsrpc/afsrpc.rc +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2000, International Business Machines Corporation and others. - * All Rights Reserved. - * - * This software has been released under the terms of the IBM Public - * License. For details, see the LICENSE file in the top-level source - * directory or online at http://www.openafs.org/dl/license10.html - */ - -/* Define VERSIONINFO resource */ - -#define AFS_VERINFO_FILE_DESCRIPTION "AFS Rx RPC DLL" -#define AFS_VERINFO_DLL -#define AFS_VERINFO_NAME "afsrpc" -#define AFS_VERINFO_FILENAME "afsrpc.dll" - -#include "AFS_component_version_number.h" -#include "..\config\NTVersioninfo.rc" diff --git a/src/ubik/Makefile.in b/src/ubik/Makefile.in index 8f2ee4113..018173863 100644 --- a/src/ubik/Makefile.in +++ b/src/ubik/Makefile.in @@ -10,7 +10,7 @@ include @TOP_OBJDIR@/src/config/Makefile.config LIBOBJS=disk.o remote.o beacon.o recovery.o ubik.o vote.o lock.o phys.o \ ubik_int.cs.o ubik_int.ss.o ubik_int.xdr.o ubikcmd.o \ - ubikclient.o uerrors.o + ubikclient.o uerrors.o uinit.o INCLS=${TOP_INCDIR}/lwp.h ${TOP_INCDIR}/lock.h \ ${TOP_INCDIR}/rx/rx.h ${TOP_INCDIR}/rx/xdr.h \ @@ -99,6 +99,7 @@ libubik.a: ${LIBOBJS} AFS_component_version_number.o $(RANLIB) $@ disk.o: disk.c ${INCLS} +uinit.o: uinit.c ${INCLS} remote.o: remote.c ${INCLS} beacon.o: beacon.c ${INCLS} lock.o: lock.c ${INCLS} diff --git a/src/ubik/NTMakefile b/src/ubik/NTMakefile index f3cfd550a..b81948450 100644 --- a/src/ubik/NTMakefile +++ b/src/ubik/NTMakefile @@ -31,6 +31,7 @@ LIBOBJS =\ $(OUT)\beacon.obj \ $(OUT)\recovery.obj \ $(OUT)\ubik.obj \ + $(OUT)\uinit.obj \ $(OUT)\vote.obj \ $(OUT)\lock.obj \ $(OUT)\phys.obj \ diff --git a/src/ubik/udebug.c b/src/ubik/udebug.c index 2499ff7b6..b72ad85cf 100644 --- a/src/ubik/udebug.c +++ b/src/ubik/udebug.c @@ -97,7 +97,7 @@ CommandProc(struct cmd_syndesc *as, char *arock) register afs_int32 i, j, code; short port; int int32p; - afs_int32 now, diff, newtime; + time_t now, diff, newtime; struct hostent *th; struct rx_connection *tconn; struct rx_securityClass *sc; diff --git a/src/ubik/uinit.c b/src/ubik/uinit.c new file mode 100644 index 000000000..32c6bf125 --- /dev/null +++ b/src/ubik/uinit.c @@ -0,0 +1,206 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +#include +#include + +RCSID + ("$Header$"); + +#include +#ifdef AFS_NT40_ENV +#include +#include +#else +#include +#include +#include +#include +#endif /* AFS_NT40_ENV */ +#include +#ifdef AFS_AIX_ENV +#include +#endif + +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + Get the appropriate type of ubik client structure out from the system. +*/ +afs_int32 +ugen_ClientInit(int noAuthFlag, char *confDir, char *cellName, afs_int32 sauth, + struct ubik_client **uclientp, int (*secproc) (), + char *funcName, afs_int32 gen_rxkad_level, + afs_int32 maxservers, afs_int32 serviceid, afs_int32 deadtime, + afs_uint32 server, afs_uint32 port, afs_int32 usrvid) +{ + afs_int32 code, scIndex, i; + struct afsconf_cell info; + struct afsconf_dir *tdir; + struct ktc_principal sname; + struct ktc_token ttoken; + struct rx_securityClass *sc; + /* This must change if VLDB_MAXSERVERS becomes larger than MAXSERVERS */ + static struct rx_connection *serverconns[MAXSERVERS]; + char cellstr[64]; + + code = rx_Init(0); + if (code) { + fprintf(stderr, "%s: could not initialize rx.\n", funcName); + return code; + } + rx_SetRxDeadTime(deadtime); + + if (sauth) { /* -localauth */ + tdir = afsconf_Open(AFSDIR_SERVER_ETC_DIRPATH); + if (!tdir) { + fprintf(stderr, + "%s: Could not process files in configuration directory (%s).\n", + funcName, AFSDIR_SERVER_ETC_DIRPATH); + return -1; + } + code = afsconf_ClientAuth(tdir, &sc, &scIndex); /* sets sc,scIndex */ + if (code) { + fprintf(stderr, + "%s: Could not get security object for -localAuth\n", + funcName); + return -1; + } + code = + afsconf_GetCellInfo(tdir, tdir->cellName, serviceid, + &info); + if (code) { + fprintf(stderr, + "%s: can't find cell %s's hosts in %s/%s\n", + funcName, cellName, AFSDIR_SERVER_ETC_DIRPATH, + AFSDIR_CELLSERVDB_FILE); + exit(1); + } + } else { /* not -localauth */ + tdir = afsconf_Open(confDir); + if (!tdir) { + fprintf(stderr, + "%s: Could not process files in configuration directory (%s).\n", + funcName, confDir); + return -1; + } + + if (!cellName) { + code = afsconf_GetLocalCell(tdir, cellstr, sizeof(cellstr)); + if (code) { + fprintf(stderr, + "%s: can't get local cellname, check %s/%s\n", + funcName, confDir, AFSDIR_THISCELL_FILE); + exit(1); + } + cellName = cellstr; + } + + code = + afsconf_GetCellInfo(tdir, cellName, serviceid, &info); + if (code) { + fprintf(stderr, + "%s: can't find cell %s's hosts in %s/%s\n", + funcName, cellName, confDir, AFSDIR_CELLSERVDB_FILE); + exit(1); + } + if (noAuthFlag) /* -noauth */ + scIndex = 0; + else { /* not -noauth */ + strcpy(sname.cell, info.name); + sname.instance[0] = 0; + strcpy(sname.name, "afs"); + code = ktc_GetToken(&sname, &ttoken, sizeof(ttoken), NULL); + if (code) { /* did not get ticket */ + fprintf(stderr, + "%s: Could not get afs tokens, running unauthenticated.\n", + funcName); + scIndex = 0; + } else { /* got a ticket */ + scIndex = 2; + if ((ttoken.kvno < 0) || (ttoken.kvno > 256)) { + fprintf(stderr, + "%s: funny kvno (%d) in ticket, proceeding\n", + funcName, ttoken.kvno); + } + } + } + + switch (scIndex) { + case 0: + sc = rxnull_NewClientSecurityObject(); + break; + case 2: + sc = rxkad_NewClientSecurityObject(gen_rxkad_level, + &ttoken.sessionKey, + ttoken.kvno, ttoken.ticketLen, + ttoken.ticket); + break; + default: + fprintf(stderr, "%s: unsupported security index %d\n", + funcName, scIndex); + exit(1); + break; + } + } + + afsconf_Close(tdir); + + if (secproc) /* tell UV module about default authentication */ + (*secproc) (sc, scIndex); + if (server) { + serverconns[0] = rx_NewConnection(server, port, + usrvid, sc, scIndex); + } else { + if (info.numServers > maxservers) { + fprintf(stderr, + "%s: info.numServers=%d (> maxservers=%d)\n", + funcName, info.numServers, maxservers); + exit(1); + } + for (i = 0; i < info.numServers; i++) { + serverconns[i] = + rx_NewConnection(info.hostAddr[i].sin_addr.s_addr, + info.hostAddr[i].sin_port, usrvid, + sc, scIndex); + } + } + /* Are we just setting up connections, or is this really ubik stuff? */ + if (uclientp) { + *uclientp = 0; + code = ubik_ClientInit(serverconns, uclientp); + if (code) { + fprintf(stderr, "%s: ubik client init failed.\n", funcName); + return code; + } + } + return 0; +} + + diff --git a/src/util/Makefile.in b/src/util/Makefile.in index 924bae2c1..4ce6b9004 100644 --- a/src/util/Makefile.in +++ b/src/util/Makefile.in @@ -62,10 +62,10 @@ util.a: ${objects} AFS_component_version_number.o $(RANLIB) util.a assert.o: ${srcdir}/assert.c ${includes} - ${CC} ${CFLAGS} -c ${srcdir}/assert.c + ${CCOBJ} ${CFLAGS} -c ${srcdir}/assert.c casestrcpy.o: ${srcdir}/casestrcpy.c ${includes} - ${CC} ${CFLAGS} -c ${srcdir}/casestrcpy.c + ${CCOBJ} ${CFLAGS} -c ${srcdir}/casestrcpy.c hputil.o: ${srcdir}/hputil.c ${includes} ${CC} ${CFLAGS} -c ${srcdir}/hputil.c @@ -110,10 +110,10 @@ serverLog.o: ${srcdir}/serverLog.c ${includes} ${CC} ${CFLAGS} -c ${srcdir}/serverLog.c dirpath.o: ${srcdir}/dirpath.c ${includes} - ${CC} ${CFLAGS} -c ${srcdir}/dirpath.c + ${CCOBJ} ${CFLAGS} -c ${srcdir}/dirpath.c fileutil.o: ${srcdir}/fileutil.c ${includes} - ${CC} ${CFLAGS} -c ${srcdir}/fileutil.c + ${CCOBJ} ${CFLAGS} -c ${srcdir}/fileutil.c netutils.o: ${srcdir}/netutils.c ${includes} ${CC} ${CFLAGS} -c ${srcdir}/netutils.c diff --git a/src/util/ktime.c b/src/util/ktime.c index eba0260b9..f113b4f01 100644 --- a/src/util/ktime.c +++ b/src/util/ktime.c @@ -165,7 +165,8 @@ ktime_DateOf(afs_int32 atime) { static char tbuffer[30]; register char *tp; - tp = ctime((time_t *) & atime); + time_t t = atime; + tp = ctime(&t); if (tp) { strcpy(tbuffer, tp); tbuffer[24] = 0; /* get rid of new line */ diff --git a/src/util/netutils.c b/src/util/netutils.c index 316f84e71..50c692614 100644 --- a/src/util/netutils.c +++ b/src/util/netutils.c @@ -53,6 +53,10 @@ RCSID #define MAX_NETFILE_LINE 2048 /* length of a line in the netrestrict file */ #define MAXIPADDRS 1024 /* from afsd.c */ +#ifndef INADDR_LOOPBACK +#define INADDR_LOOPBACK (afs_uint32)0x7f000001 +#endif + /* * The line parameter is a pointer to a buffer containing a string of * bytes of the form @@ -382,6 +386,11 @@ filterAddrs(afs_uint32 addr1[], afs_uint32 addr2[], afs_uint32 mask1[], break; } } + + /* Always mask loopback address */ + if (found && addr1[i] == INADDR_LOOPBACK) + found = 0; + if (found) { taddr[count] = addr1[i]; tmask[count] = mask1[i]; diff --git a/src/util/serverLog.c b/src/util/serverLog.c index fabf52090..7b63bff58 100644 --- a/src/util/serverLog.c +++ b/src/util/serverLog.c @@ -235,8 +235,9 @@ OpenLog(const char *fileName) #endif if (mrafsStyleLogs) { + time_t t = Start.tv_sec; TM_GetTimeOfDay(&Start, 0); - TimeFields = localtime(&Start.tv_sec); + TimeFields = localtime(&t); if (fileName) { if (strncmp(fileName, (char *)&ourName, strlen(fileName))) strcpy((char *)&ourName, (char *)fileName); diff --git a/src/venus/fs.c b/src/venus/fs.c index 831e40194..d7ba1823a 100644 --- a/src/venus/fs.c +++ b/src/venus/fs.c @@ -724,7 +724,7 @@ AclToString(struct Acl *acl) } static int -SetACLCmd(struct cmd_syndesc *as) +SetACLCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code; struct ViceIoctl blob; @@ -858,7 +858,7 @@ SetACLCmd(struct cmd_syndesc *as) static int -CopyACLCmd(struct cmd_syndesc *as) +CopyACLCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code; struct ViceIoctl blob; @@ -1038,7 +1038,7 @@ CleanAcl(struct Acl *aa, char *fname) /* clean up an acl to not have bogus entries */ static int -CleanACLCmd(struct cmd_syndesc *as) +CleanACLCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code; struct Acl *ta = 0; @@ -1125,7 +1125,7 @@ CleanACLCmd(struct cmd_syndesc *as) } static int -ListACLCmd(struct cmd_syndesc *as) +ListACLCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code; struct Acl *ta; @@ -1189,7 +1189,7 @@ ListACLCmd(struct cmd_syndesc *as) } static int -FlushVolumeCmd(struct cmd_syndesc *as) +FlushVolumeCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code; struct ViceIoctl blob; @@ -1211,7 +1211,7 @@ FlushVolumeCmd(struct cmd_syndesc *as) } static int -FlushCmd(struct cmd_syndesc *as) +FlushCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code; struct ViceIoctl blob; @@ -1238,7 +1238,7 @@ FlushCmd(struct cmd_syndesc *as) /* all this command does is repackage its args and call SetVolCmd */ static int -SetQuotaCmd(struct cmd_syndesc *as) +SetQuotaCmd(struct cmd_syndesc *as, char *arock) { struct cmd_syndesc ts; @@ -1248,7 +1248,7 @@ SetQuotaCmd(struct cmd_syndesc *as) } static int -SetVolCmd(struct cmd_syndesc *as) +SetVolCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code; struct ViceIoctl blob; @@ -1312,7 +1312,7 @@ struct VenusFid { }; static int -ExamineCmd(struct cmd_syndesc *as) +ExamineCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code; struct ViceIoctl blob; @@ -1353,7 +1353,7 @@ ExamineCmd(struct cmd_syndesc *as) } static int -ListQuotaCmd(struct cmd_syndesc *as) +ListQuotaCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code; struct ViceIoctl blob; @@ -1384,7 +1384,7 @@ ListQuotaCmd(struct cmd_syndesc *as) } static int -WhereIsCmd(struct cmd_syndesc *as) +WhereIsCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code; struct ViceIoctl blob; @@ -1423,7 +1423,7 @@ WhereIsCmd(struct cmd_syndesc *as) static int -DiskFreeCmd(struct cmd_syndesc *as) +DiskFreeCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code; struct ViceIoctl blob; @@ -1454,7 +1454,7 @@ DiskFreeCmd(struct cmd_syndesc *as) } static int -QuotaCmd(struct cmd_syndesc *as) +QuotaCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code; struct ViceIoctl blob; @@ -1487,7 +1487,7 @@ QuotaCmd(struct cmd_syndesc *as) } static int -ListMountCmd(struct cmd_syndesc *as) +ListMountCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code; struct ViceIoctl blob; @@ -1608,7 +1608,7 @@ ListMountCmd(struct cmd_syndesc *as) } static -MakeMountCmd(struct cmd_syndesc *as) +MakeMountCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code; char *cellName, *volName, *tmpName; @@ -1716,7 +1716,7 @@ defect #3069 * tp: Set to point to the actual name of the mount point to nuke. */ static int -RemoveMountCmd(struct cmd_syndesc *as) +RemoveMountCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code = 0; struct ViceIoctl blob; @@ -1768,7 +1768,7 @@ RemoveMountCmd(struct cmd_syndesc *as) */ static int -CheckServersCmd(struct cmd_syndesc *as) +CheckServersCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code; struct ViceIoctl blob; @@ -1867,7 +1867,7 @@ CheckServersCmd(struct cmd_syndesc *as) } static int -MessagesCmd(struct cmd_syndesc *as) +MessagesCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code = 0; struct ViceIoctl blob; @@ -1913,7 +1913,7 @@ MessagesCmd(struct cmd_syndesc *as) } static int -CheckVolumesCmd(struct cmd_syndesc *as) +CheckVolumesCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code; struct ViceIoctl blob; @@ -1931,7 +1931,7 @@ CheckVolumesCmd(struct cmd_syndesc *as) } static int -SetCacheSizeCmd(struct cmd_syndesc *as) +SetCacheSizeCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code; struct ViceIoctl blob; @@ -1970,7 +1970,7 @@ SetCacheSizeCmd(struct cmd_syndesc *as) #define MAXGCSIZE 16 static int -GetCacheParmsCmd(struct cmd_syndesc *as) +GetCacheParmsCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code; struct ViceIoctl blob; @@ -1995,7 +1995,7 @@ GetCacheParmsCmd(struct cmd_syndesc *as) } static int -ListCellsCmd(struct cmd_syndesc *as) +ListCellsCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code; afs_int32 i, j; @@ -2046,7 +2046,7 @@ ListCellsCmd(struct cmd_syndesc *as) } static int -ListAliasesCmd(struct cmd_syndesc *as) +ListAliasesCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code, i; char *tp, *aliasName, *realName; @@ -2076,7 +2076,7 @@ ListAliasesCmd(struct cmd_syndesc *as) } static int -CallBackRxConnCmd(struct cmd_syndesc *as) +CallBackRxConnCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code; struct ViceIoctl blob; @@ -2115,7 +2115,7 @@ CallBackRxConnCmd(struct cmd_syndesc *as) } static int -NewCellCmd(struct cmd_syndesc *as) +NewCellCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code, linkedstate = 0, size = 0, *lp; struct ViceIoctl blob; @@ -2227,7 +2227,7 @@ NewCellCmd(struct cmd_syndesc *as) } static int -NewAliasCmd(struct cmd_syndesc *as) +NewAliasCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code; struct ViceIoctl blob; @@ -2262,7 +2262,7 @@ NewAliasCmd(struct cmd_syndesc *as) } static int -WhichCellCmd(struct cmd_syndesc *as) +WhichCellCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code; struct cmd_item *ti; @@ -2287,7 +2287,7 @@ WhichCellCmd(struct cmd_syndesc *as) } static int -WSCellCmd(struct cmd_syndesc *as) +WSCellCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code; struct ViceIoctl blob; @@ -2317,7 +2317,7 @@ static PrimaryCellCmd(as) */ static int -MonitorCmd(struct cmd_syndesc *as) +MonitorCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code; struct ViceIoctl blob; @@ -2378,7 +2378,7 @@ MonitorCmd(struct cmd_syndesc *as) } static int -SysNameCmd(struct cmd_syndesc *as) +SysNameCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code; struct ViceIoctl blob; @@ -2432,7 +2432,7 @@ SysNameCmd(struct cmd_syndesc *as) static char *exported_types[] = { "null", "nfs", "" }; static int -ExportAfsCmd(struct cmd_syndesc *as) +ExportAfsCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code; struct ViceIoctl blob; @@ -2531,7 +2531,7 @@ ExportAfsCmd(struct cmd_syndesc *as) static int -GetCellCmd(struct cmd_syndesc *as) +GetCellCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code; struct ViceIoctl blob; @@ -2582,7 +2582,7 @@ GetCellCmd(struct cmd_syndesc *as) } static int -SetCellCmd(struct cmd_syndesc *as) +SetCellCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code; struct ViceIoctl blob; @@ -2659,75 +2659,14 @@ static int VLDBInit(int noAuthFlag, struct afsconf_cell *info) { afs_int32 code; - struct ktc_principal sname; - struct ktc_token ttoken; - afs_int32 scIndex; - struct rx_securityClass *sc; - struct rx_connection *serverconns[VLDB_MAXSERVERS]; - afs_int32 i; - - code = rx_Init(0); - if (code) { - fprintf(stderr, "%s: could not initialize rx.\n", pn); - return code; - } - rxInitDone = 1; - rx_SetRxDeadTime(50); - if (!noAuthFlag) { /* we don't need tickets for null */ - strcpy(sname.cell, info->name); - sname.instance[0] = 0; - strcpy(sname.name, "afs"); - code = ktc_GetToken(&sname, &ttoken, sizeof(ttoken), NULL); - if (code) { - fprintf(stderr, - "%s: Could not get afs tokens, running unauthenticated.\n", - pn); - scIndex = 0; - } else { - /* got a ticket */ - if (ttoken.kvno >= 0 && ttoken.kvno <= 255) - scIndex = 2; /* kerberos */ - else { - fprintf(stderr, "%s: funny kvno (%d) in ticket, proceeding\n", - pn, ttoken.kvno); - scIndex = 2; - } - } - } else - scIndex = 0; /* don't authenticate */ - switch (scIndex) { - case 0: - sc = rxnull_NewClientSecurityObject(); - break; - case 1: - break; - case 2: - sc = (struct rx_securityClass *) - rxkad_NewClientSecurityObject(rxkad_clear, &ttoken.sessionKey, - ttoken.kvno, ttoken.ticketLen, - ttoken.ticket); - break; - } - if (info->numServers > VLDB_MAXSERVERS) { - fprintf(stderr, "%s: info.numServers=%d (> VLDB_MAXSERVERS=%d)\n", pn, - info->numServers, VLDB_MAXSERVERS); - exit(1); - } - memset(serverconns, 0, sizeof(serverconns)); - for (i = 0; i < info->numServers; i++) - serverconns[i] = - rx_NewConnection(info->hostAddr[i].sin_addr.s_addr, - info->hostAddr[i].sin_port, USER_SERVICE_ID, sc, - scIndex); - - code = ubik_ClientInit(serverconns, &uclient); - - if (code) { - fprintf(stderr, "%s: ubik client init failed.\n", pn); - return code; - } - return 0; + code = ugen_ClientInit(noAuthFlag, AFSDIR_CLIENT_ETC_DIRPATH, + info->name, 0, &uclient, + NULL, pn, rxkad_clear, + VLDB_MAXSERVERS, AFSCONF_VLDBSERVICE, 50, + 0, 0, USER_SERVICE_ID); + rxInitDone = 1; + return code; } static struct ViceIoctl gblob; @@ -2827,7 +2766,7 @@ addServer(char *name, afs_int32 rank) static int -SetPrefCmd(struct cmd_syndesc *as) +SetPrefCmd(struct cmd_syndesc *as, char *arock) { FILE *infd; afs_int32 code; @@ -2933,7 +2872,7 @@ SetPrefCmd(struct cmd_syndesc *as) static int -GetPrefCmd(struct cmd_syndesc *as) +GetPrefCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code; struct cmd_item *ti; @@ -3003,7 +2942,7 @@ GetPrefCmd(struct cmd_syndesc *as) } static int -StoreBehindCmd(struct cmd_syndesc *as) +StoreBehindCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code = 0; struct ViceIoctl blob; @@ -3104,7 +3043,7 @@ StoreBehindCmd(struct cmd_syndesc *as) static afs_int32 -SetCryptCmd(struct cmd_syndesc *as) +SetCryptCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code = 0, flag; struct ViceIoctl blob; @@ -3131,7 +3070,7 @@ SetCryptCmd(struct cmd_syndesc *as) static afs_int32 -GetCryptCmd(struct cmd_syndesc *as) +GetCryptCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code = 0, flag; struct ViceIoctl blob; @@ -3511,7 +3450,7 @@ Die(int errnum, char *filename) /* get clients interface addresses */ static int -GetClientAddrsCmd(struct cmd_syndesc *as) +GetClientAddrsCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code; struct cmd_item *ti; @@ -3557,7 +3496,7 @@ GetClientAddrsCmd(struct cmd_syndesc *as) } static int -SetClientAddrsCmd(struct cmd_syndesc *as) +SetClientAddrsCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code, addr; struct cmd_item *ti; @@ -3631,7 +3570,7 @@ SetClientAddrsCmd(struct cmd_syndesc *as) } static int -FlushMountCmd(struct cmd_syndesc *as) +FlushMountCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code; struct ViceIoctl blob; @@ -3747,7 +3686,7 @@ FlushMountCmd(struct cmd_syndesc *as) } static int -RxStatProcCmd(struct cmd_syndesc *as) +RxStatProcCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code; afs_int32 flags = 0; @@ -3782,7 +3721,7 @@ RxStatProcCmd(struct cmd_syndesc *as) } static int -RxStatPeerCmd(struct cmd_syndesc *as) +RxStatPeerCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code; afs_int32 flags = 0; diff --git a/src/viced/callback.c b/src/viced/callback.c index 65e3be289..90d684d72 100644 --- a/src/viced/callback.c +++ b/src/viced/callback.c @@ -776,6 +776,7 @@ MultiBreakCallBack_r(struct cbstruct cba[], int ncbas, if (!thishost || (thishost->hostFlags & HOSTDELETED)) { continue; } + rx_GetConnection(thishost->callback_rxcon); conns[j++] = thishost->callback_rxcon; #ifdef ADAPT_MTU @@ -832,14 +833,14 @@ MultiBreakCallBack_r(struct cbstruct cba[], int ncbas, } H_LOCK; - h_Lock_r(hp); + h_Lock_r(hp); hp->hostFlags |= VENUSDOWN; /** * We always go into AddCallBack1_r with the host locked */ AddCallBack1_r(hp, afidp->AFSCBFids_val, itot(idx), CB_DELAYED, 1); - h_Unlock_r(hp); + h_Unlock_r(hp); H_UNLOCK; } } @@ -853,8 +854,10 @@ MultiBreakCallBack_r(struct cbstruct cba[], int ncbas, for (i = 0; i < ncbas; i++) { struct host *hp; hp = cba[i].hp; - if (hp && xhost != hp) + if (hp && xhost != hp) { + rx_PutConnection(hp->callback_rxcon); h_Release_r(hp); + } } return; diff --git a/src/viced/host.c b/src/viced/host.c index 2e99984a7..3d1eb6d66 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -781,6 +781,7 @@ h_TossStuff_r(register struct host *host) *hp = th->next; h_DeleteList_r(host); FreeHT(host); + free(th); break; } } diff --git a/src/viced/viced.c b/src/viced/viced.c index ba1097239..e2251bc17 100644 --- a/src/viced/viced.c +++ b/src/viced/viced.c @@ -1564,6 +1564,7 @@ main(int argc, char *argv[]) struct rlimit rlim; /* max number of open file descriptors */ #endif int curLimit; + time_t t; #ifdef AFS_AIX32_ENV struct sigaction nsa; @@ -1868,9 +1869,10 @@ main(int argc, char *argv[]) TM_GetTimeOfDay(&tp, 0); #ifndef AFS_QUIETFS_ENV - if (console != NULL) { + if (console != NULL) { + time_t t = tp.tv_sec; fprintf(console, "File server has started at %s\r", - afs_ctime(&tp.tv_sec, tbuffer, sizeof(tbuffer))); + afs_ctime(&t, tbuffer, sizeof(tbuffer))); } #endif @@ -1907,9 +1909,10 @@ main(int argc, char *argv[]) (void)signal(SIGQUIT, ShutDown_Signal); #endif + t = tp.tv_sec; ViceLog(0, ("File Server started %s", - afs_ctime(&tp.tv_sec, tbuffer, sizeof(tbuffer)))); + afs_ctime(&t, tbuffer, sizeof(tbuffer)))); #if FS_STATS_DETAILED afs_FullPerfStats.det.epoch.tv_sec = StartTime = tp.tv_sec; #endif diff --git a/src/vlserver/vlclient.c b/src/vlserver/vlclient.c index 985fbc99d..42d70c0c9 100644 --- a/src/vlserver/vlclient.c +++ b/src/vlserver/vlclient.c @@ -162,102 +162,17 @@ GetVolume(vol, entry) /* Almost identical's to pr_Initialize in vlserver/pruser.c */ afs_int32 -vl_Initialize(auth, confDir, server, cellp) - int auth, server; - char *confDir, *cellp; +vl_Initialize(int auth, char *confDir, int server, char *cellp) { - afs_int32 code; - struct afsconf_dir *tdir; - struct ktc_principal sname; - struct ktc_token ttoken; - afs_int32 scIndex = 0; - struct rx_securityClass *sc; - struct afsconf_cell info; - afs_int32 i; - - code = rx_Init(0); - if (code) { - fprintf(stderr, "vl_Initialize: Could not initialize rx.\n"); - return code; - } - - rx_SetRxDeadTime(50); - if (!server) { - tdir = afsconf_Open(confDir); - if (!tdir) { - fprintf(stderr, "Could not open configuration directory (%s).\n", - confDir); - return -1; - } - } - if (auth) { /* we don't need tickets for null */ - if (!server) { - code = afsconf_GetLocalCell(tdir, sname.cell, sizeof(sname.cell)); - if (code) { - fprintf(stderr, - "vl_Initialize: Could not get local cell name.\n"); - return code; - } - } else - strncpy(sname.cell, cellp, sizeof(sname.cell)); - sname.instance[0] = 0; - strcpy(sname.name, "afs"); - code = ktc_GetToken(&sname, &ttoken, sizeof(ttoken), NULL); - if (code) { - fprintf(stderr, - "vl_Initialize: Could not get afs tokens, running unauthenticated.\n"); - scIndex = 0; - } else if (ttoken.kvno <= 255) - scIndex = 2; - else { /* bcrypt */ - fprintf(stderr, - "vl_Initialize: funny kvno (%d) in ticket, proceeding\n", - ttoken.kvno); - scIndex = 2; - } - } - switch (scIndex) { - case 0: - sc = rxnull_NewClientSecurityObject(); - break; - case 1: - return -1; - case 2: - sc = rxkad_NewClientSecurityObject(rxkad_clear, &ttoken.sessionKey, - ttoken.kvno, ttoken.ticketLen, - ttoken.ticket); - } - if (!server) { - code = afsconf_GetCellInfo(tdir, NULL, AFSCONF_VLDBSERVICE, &info); - if (info.numServers > MAXSERVERS) { - fprintf(stderr, - "vl_Initialize: info.numServers=%d (> MAXSERVERS=%d)\n", - info.numServers, MAXSERVERS); - exit(1); - } - for (i = 0; i < info.numServers; i++) - serverconns[i] = - rx_NewConnection(info.hostAddr[i].sin_addr.s_addr, - info.hostAddr[i].sin_port, USER_SERVICE_ID, - sc, scIndex); - } else { - serverconns[0] = - rx_NewConnection(server, htons(AFSCONF_VLDBPORT), USER_SERVICE_ID, - sc, scIndex); - } - code = ubik_ClientInit(serverconns, &cstruct); - - if (code) { - fprintf(stderr, "vl_Initialize: ubik client init failed.\n"); - return code; - } - return 0; + return ugen_ClientInit(auth?0:1, confDir, cellp, 0, + &cstruct, NULL, "vl_Initialize", rxkad_clear, + MAXSERVERS, AFSCONF_VLDBSERVICE, 50, server, + htons(AFSCONF_VLDBPORT), USER_SERVICE_ID); } /* return host address in network byte order */ afs_int32 -GetServer(aname) - char *aname; +GetServer(char *aname) { register struct hostent *th; afs_int32 addr; diff --git a/src/vol/listinodes.c b/src/vol/listinodes.c index 86fed237a..992e44158 100644 --- a/src/vol/listinodes.c +++ b/src/vol/listinodes.c @@ -35,7 +35,7 @@ RCSID int ListViceInodes(char *devname, char *mountedOn, char *resultFile, int (*judgeInode) (), int judgeParam, int *forcep, int forceR, - char *wpath) + char *wpath, void *rock) { Log("ListViceInodes not implemented for this platform!\n"); return -1; @@ -167,7 +167,7 @@ struct dinode *ginode(); int ListViceInodes(char *devname, char *mountedOn, char *resultFile, int (*judgeInode) (), int judgeParam, int *forcep, int forceR, - char *wpath) + char *wpath, void *rock) { FILE *inodeFile = NULL; char dev[50], rdev[51]; @@ -301,7 +301,7 @@ ListViceInodes(char *devname, char *mountedOn, char *resultFile, info.u.param[2] = p->di_vicep3; info.u.param[3] = p->di_vicep4; - if (judgeInode && (*judgeInode) (&info, judgeParam) == 0) + if (judgeInode && (*judgeInode) (&info, judgeParam, rock) == 0) continue; if (fwrite(&info, sizeof info, 1, inodeFile) != 1) { @@ -469,7 +469,7 @@ afs_efs_figet(EFS_MOUNT * mp, struct efs_dinode *dinodeBuf, int *last_cgno, int efs_ListViceInodes(char *devname, char *mountedOn, char *resultFile, int (*judgeInode) (), int judgeParam, int *forcep, - int forceR, char *wpath) + int forceR, char *wpath, void *rock) { FILE *inodeFile = NULL; char dev[50], rdev[51]; @@ -570,7 +570,7 @@ efs_ListViceInodes(char *devname, char *mountedOn, char *resultFile, p->di_nlink, info.u.param[0], info.u.param[1], info.u.param[2], info.u.param[3]); #endif - if (judgeInode && (*judgeInode) (&info, judgeParam) == 0) + if (judgeInode && (*judgeInode) (&info, judgeParam, rock) == 0) continue; if (fwrite(&info, sizeof info, 1, inodeFile) != 1) { @@ -823,7 +823,7 @@ xfs_RenameFiles(char *dir, xfs_Rename_t * renames, int n_renames) int xfs_ListViceInodes(char *devname, char *mountedOn, char *resultFile, int (*judgeInode) (), int judgeParam, int *forcep, - int forceR, char *wpath) + int forceR, char *wpath, void *rock) { FILE *inodeFile = NULL; i_list_inode_t info; @@ -931,7 +931,7 @@ xfs_ListViceInodes(char *devname, char *mountedOn, char *resultFile, goto err1_exit; } - if (judgeInode && (*judgeInode) (&info.ili_info, judgeParam) == 0) + if (judgeInode && (*judgeInode) (&info.ili_info, judgeParam, rock) == 0) continue; rename = 0; @@ -1039,7 +1039,7 @@ xfs_ListViceInodes(char *devname, char *mountedOn, char *resultFile, int ListViceInodes(char *devname, char *mountedOn, char *resultFile, int (*judgeInode) (), int judgeParam, int *forcep, int forceR, - char *wpath) + char *wpath, void *rock) { FILE *inodeFile = NULL; char dev[50], rdev[51]; @@ -1070,13 +1070,13 @@ ListViceInodes(char *devname, char *mountedOn, char *resultFile, #ifdef AFS_SGI_XFS_IOPS_ENV if (!strcmp("xfs", root_inode.st_fstype)) { return xfs_ListViceInodes(devname, mountedOn, resultFile, judgeInode, - judgeParam, forcep, forceR, wpath); + judgeParam, forcep, forceR, wpath, rock); } else #endif #ifdef AFS_SGI_EFS_IOPS_ENV if (root_inode.st_ino == EFS_ROOTINO) { return efs_ListViceInodes(devname, mountedOn, resultFile, judgeInode, - judgeParam, forcep, forceR, wpath); + judgeParam, forcep, forceR, wpath, rock); } else #endif { @@ -1114,7 +1114,7 @@ extern char *afs_rawname(); int ListViceInodes(char *devname, char *mountedOn, char *resultFile, int (*judgeInode) (), int judgeParam, int *forcep, int forceR, - char *wpath) + char *wpath, void *rock) { union { #ifdef AFS_AIX_ENV @@ -1212,7 +1212,7 @@ ListViceInodes(char *devname, char *mountedOn, char *resultFile, info.u.param[1] = auxp->aux_param2; info.u.param[2] = auxp->aux_param3; info.u.param[3] = auxp->aux_param4; - if (judgeInode && (*judgeInode) (&info, judgeParam) == 0) + if (judgeInode && (*judgeInode) (&info, judgeParam, rock) == 0) continue; if (fwrite(&info, sizeof info, 1, inodeFile) != 1) { Log("Error writing inode file for partition %s\n", partition); @@ -1421,7 +1421,7 @@ ListViceInodes(char *devname, char *mountedOn, char *resultFile, info.inodeNumber = i; info.byteCount = p->di_size; info.linkCount = p->di_nlink; - if (judgeInode && (*judgeInode) (&info, judgeParam) == 0) + if (judgeInode && (*judgeInode) (&info, judgeParam, rock) == 0) continue; if (fwrite(&info, sizeof info, 1, inodeFile) != 1) { Log("Error writing inode file for partition %s\n", diff --git a/src/vol/namei_ops.h b/src/vol/namei_ops.h index 64a476655..9f0df4a92 100644 --- a/src/vol/namei_ops.h +++ b/src/vol/namei_ops.h @@ -50,11 +50,13 @@ int namei_ListAFSFiles(char *dev, struct ViceInodeInfo * info, char *dir, char *file), FILE * fp, int (*judge_fun) (struct ViceInodeInfo * info, - int vid), int singleVolumeNumber); + int vid, void *rock), + int singleVolumeNumber, void *rock); int ListViceInodes(char *devname, char *mountedOn, char *resultFile, - int (*judgeInode) (struct ViceInodeInfo * info, int vid), + int (*judgeInode) (struct ViceInodeInfo * info, int vid, + void *rock), int singleVolumeNumber, int *forcep, int forceR, - char *wpath); + char *wpath, void *rock); #define NAMEI_LCOMP_LEN 32 diff --git a/src/vol/ntops.c b/src/vol/ntops.c index 57455467e..428588534 100644 --- a/src/vol/ntops.c +++ b/src/vol/ntops.c @@ -935,8 +935,8 @@ static int nt_ListAFSSubDirs(IHandle_t * dirIH, int (*write_fun) (FILE *, struct ViceInodeInfo *, char *, char *), FILE * fp, int (*judgeFun) (struct ViceInodeInfo *, - int vid), - int singleVolumeNumber); + int vid, void *rock), + int singleVolumeNumber, void *rock); /* WriteInodeInfo @@ -972,8 +972,9 @@ WriteInodeInfo(FILE * fp, struct ViceInodeInfo *info, char *dir, char *name) */ int ListViceInodes(char *devname, char *mountedOn, char *resultFile, - int (*judgeInode) (struct ViceInodeInfo * info, int vid), - int singleVolumeNumber, int *forcep, int forceR, char *wpath) + int (*judgeInode) (struct ViceInodeInfo * info, int vid, void *rock), + int singleVolumeNumber, int *forcep, int forceR, char *wpath, + void *rock) { FILE *fp = (FILE *) - 1; int ninodes; @@ -988,7 +989,7 @@ ListViceInodes(char *devname, char *mountedOn, char *resultFile, } ninodes = nt_ListAFSFiles(wpath, WriteInodeInfo, fp, judgeInode, - singleVolumeNumber); + singleVolumeNumber, rock); if (!resultFile) return ninodes; @@ -1041,8 +1042,8 @@ int nt_ListAFSFiles(char *dev, int (*writeFun) (FILE *, struct ViceInodeInfo *, char *, char *), FILE * fp, - int (*judgeFun) (struct ViceInodeInfo *, int), - int singleVolumeNumber) + int (*judgeFun) (struct ViceInodeInfo *, int, void *), + int singleVolumeNumber, void *rock) { IHandle_t h; char name[MAX_PATH]; @@ -1059,7 +1060,7 @@ nt_ListAFSFiles(char *dev, if (!nt_HandleToVolDir(name, &h)) return -1; ninodes = - nt_ListAFSSubDirs(&h, writeFun, fp, judgeFun, singleVolumeNumber); + nt_ListAFSSubDirs(&h, writeFun, fp, judgeFun, singleVolumeNumber, rock); if (ninodes < 0) return ninodes; } else { @@ -1072,7 +1073,7 @@ nt_ListAFSFiles(char *dev, return -1; while (dp = readdir(dirp)) { if (!DecodeVolumeName(dp->d_name, &h.ih_vid)) { - ninodes += nt_ListAFSSubDirs(&h, writeFun, fp, judgeFun, 0); + ninodes += nt_ListAFSSubDirs(&h, writeFun, fp, judgeFun, 0, rock); } } } @@ -1094,8 +1095,8 @@ static int nt_ListAFSSubDirs(IHandle_t * dirIH, int (*writeFun) (FILE *, struct ViceInodeInfo *, char *, char *), FILE * fp, - int (*judgeFun) (struct ViceInodeInfo *, int), - int singleVolumeNumber) + int (*judgeFun) (struct ViceInodeInfo *, int, void *), + int singleVolumeNumber, void *rock) { int i; IHandle_t myIH = *dirIH; @@ -1179,7 +1180,7 @@ nt_ListAFSSubDirs(IHandle_t * dirIH, info.u.param[2] = data.ftCreationTime.dwHighDateTime; info.u.param[3] = data.ftCreationTime.dwLowDateTime; } - if (judgeFun && !(*judgeFun) (&info, singleVolumeNumber)) + if (judgeFun && !(*judgeFun) (&info, singleVolumeNumber, rock)) goto next_file; if ((*writeFun) (fp, &info, path, data.cFileName) < 0) { nt_close(linkHandle.fd_fd); diff --git a/src/vol/ntops.h b/src/vol/ntops.h index e5098e1f0..f1f1f36a4 100644 --- a/src/vol/ntops.h +++ b/src/vol/ntops.h @@ -49,12 +49,12 @@ extern int nt_GetLinkCount(FdHandle_t * h, Inode ino, int lockit); int nt_ListAFSFiles(char *dev, int (*write_fun) (FILE * fp, struct ViceInodeInfo *, char *dir, char *file), FILE * fp, - int (*judge_fun) (struct ViceInodeInfo *, int vid), - int singleVolumeNumber); + int (*judge_fun) (struct ViceInodeInfo *, int vid, void *rock), + int singleVolumeNumber, void *rock); int ListViceInodes(char *devname, char *mountedOn, char *resultFile, - int (*judgeInode) (struct ViceInodeInfo * info, int vid), + int (*judgeInode) (struct ViceInodeInfo * info, int vid, void *rock), int singleVolumeNumber, int *forcep, int forceR, - char *wpath); + char *wpath, void *rock); int nt_HandleToName(char *name, IHandle_t * h); diff --git a/src/volser/volmain.c b/src/volser/volmain.c index ea53c5a02..28d701eb7 100644 --- a/src/volser/volmain.c +++ b/src/volser/volmain.c @@ -100,7 +100,7 @@ int Testing = 0; /* for ListViceInodes */ } -static +static afs_int32 MyBeforeProc(struct rx_call *acall) { VTRANS_LOCK; @@ -109,7 +109,7 @@ MyBeforeProc(struct rx_call *acall) return 0; } -static +static afs_int32 MyAfterProc(struct rx_call *acall, afs_int32 code) { VTRANS_LOCK; @@ -121,7 +121,7 @@ MyAfterProc(struct rx_call *acall, afs_int32 code) /* Called every GCWAKEUP seconds to try to unlock all our partitions, * if we're idle and there are no active transactions */ -static +static void TryUnlock() { /* if there are no running calls, and there are no active transactions, then @@ -135,7 +135,7 @@ TryUnlock() } /* background daemon for timing out transactions */ -static +static void BKGLoop() { struct timeval tv; @@ -161,7 +161,7 @@ BKGLoop() /* Background daemon for sleeping so the volserver does not become I/O bound */ afs_int32 TTsleep, TTrun; -static +static void BKGSleep() { struct volser_trans *tt; @@ -194,9 +194,7 @@ BKGSleep() #ifndef AFS_NT40_ENV int -volser_syscall(a3, a4, a5) - afs_uint32 a3, a4; - void *a5; +volser_syscall(afs_uint32 a3, afs_uint32 a4, void *a5) { afs_uint32 rcode; void (*old) (); @@ -218,16 +216,14 @@ volser_syscall(a3, a4, a5) /* check whether caller is authorized to manage RX statistics */ int -vol_rxstat_userok(call) - struct rx_call *call; +vol_rxstat_userok(struct rx_call *call) { return afsconf_SuperUser(tdir, call, NULL); } #include "AFS_component_version_number.c" -main(argc, argv) - int argc; - char **argv; +int +main(int argc, char **argv) { register afs_int32 code; struct rx_securityClass *(securityObjects[3]); diff --git a/src/volser/volprocs.c b/src/volser/volprocs.c index a4276ae44..6f049b893 100644 --- a/src/volser/volprocs.c +++ b/src/volser/volprocs.c @@ -425,7 +425,7 @@ VolCreateVolume(struct rx_call *acid, afs_int32 apart, char *aname, if (error) { Log("1 Volser: CreateVolume: Unable to create the volume; aborted, error code %u\n", error); LogError(error); - DeleteTrans(tt); + DeleteTrans(tt, 1); return EIO; } V_uniquifier(vp) = 1; @@ -442,7 +442,7 @@ VolCreateVolume(struct rx_call *acid, afs_int32 apart, char *aname, if (error) { Log("1 Volser: create UpdateVolume failed, code %d\n", error); LogError(error); - DeleteTrans(tt); + DeleteTrans(tt, 1); VDetachVolume(&junk, vp); /* rather return the real error code */ return error; } @@ -677,7 +677,7 @@ VolClone(struct rx_call *acid, afs_int32 atrans, afs_int32 purgeId, error = VOLSERTRELE_ERROR; goto fail; } - DeleteTrans(ttc); + DeleteTrans(ttc, 1); return 0; fail: @@ -690,7 +690,7 @@ VolClone(struct rx_call *acid, afs_int32 atrans, afs_int32 purgeId, TRELE(tt); } if (ttc) - DeleteTrans(ttc); + DeleteTrans(ttc, 1); return error; } @@ -840,7 +840,7 @@ VolReClone(struct rx_call *acid, afs_int32 atrans, afs_int32 cloneId) goto fail; } - DeleteTrans(ttc); + DeleteTrans(ttc, 1); { struct DiskPartition *tpartp = originalvp->partition; @@ -856,7 +856,7 @@ VolReClone(struct rx_call *acid, afs_int32 atrans, afs_int32 cloneId) TRELE(tt); } if (ttc) - DeleteTrans(ttc); + DeleteTrans(ttc, 1); return error; } @@ -913,7 +913,7 @@ VolTransCreate(struct rx_call *acid, afs_int32 volume, afs_int32 partition, /* give up */ if (tv) VDetachVolume(&code, tv); - DeleteTrans(tt); + DeleteTrans(tt, 1); return error; } tt->volume = tv; @@ -1387,7 +1387,7 @@ VolEndTrans(struct rx_call *acid, afs_int32 destTrans, afs_int32 *rcode) return ENOENT; } *rcode = tt->returnCode; - DeleteTrans(tt); /* this does an implicit TRELE */ + DeleteTrans(tt, 1); /* this does an implicit TRELE */ return 0; } @@ -1540,10 +1540,6 @@ VolSetInfo(struct rx_call *acid, afs_int32 atrans, td->maxquota = astatus->maxquota; if (astatus->dayUse != -1) td->dayUse = astatus->dayUse; - if (astatus->creationDate != -1) - td->creationDate = astatus->creationDate; - if (astatus->updateDate != -1) - td->updateDate = astatus->updateDate; VUpdateVolume(&error, tv); tt->rxCallPtr = (struct rx_call *)0; if (TRELE(tt)) @@ -1868,7 +1864,7 @@ VolListOneVolume(struct rx_call *acid, afs_int32 partid, afs_int32 tv = (Volume *) 0; } if (ttc) { - DeleteTrans(ttc); + DeleteTrans(ttc, 1); ttc = (struct volser_trans *)0; } @@ -2099,7 +2095,7 @@ VolXListOneVolume(struct rx_call *a_rxCidP, afs_int32 a_partID, tv = (Volume *) 0; } if (ttc) { - DeleteTrans(ttc); + DeleteTrans(ttc, 1); ttc = (struct volser_trans *)0; } @@ -2241,7 +2237,7 @@ VolListVolumes(struct rx_call *acid, afs_int32 partid, afs_int32 flags, drop: if (ttc) { - DeleteTrans(ttc); + DeleteTrans(ttc, 1); ttc = (struct volser_trans *)0; } pntr++; @@ -2258,7 +2254,7 @@ VolListVolumes(struct rx_call *acid, afs_int32 partid, afs_int32 flags, tv = (Volume *) 0; } if (ttc) { - DeleteTrans(ttc); + DeleteTrans(ttc, 1); ttc = (struct volser_trans *)0; } closedir(dirp); @@ -2276,7 +2272,7 @@ VolListVolumes(struct rx_call *acid, afs_int32 partid, afs_int32 flags, tv = (Volume *) 0; } if (ttc) { - DeleteTrans(ttc); + DeleteTrans(ttc, 1); ttc = (struct volser_trans *)0; } GetNextVol(dirp, volname, &volid); @@ -2284,7 +2280,7 @@ VolListVolumes(struct rx_call *acid, afs_int32 partid, afs_int32 flags, } closedir(dirp); if (ttc) - DeleteTrans(ttc); + DeleteTrans(ttc, 1); return 0; } @@ -2495,7 +2491,7 @@ VolXListVolumes(struct rx_call *a_rxCidP, afs_int32 a_partID, * Drop the transaction we have for this volume. */ if (ttc) { - DeleteTrans(ttc); + DeleteTrans(ttc, 1); ttc = (struct volser_trans *)0; } @@ -2522,7 +2518,7 @@ VolXListVolumes(struct rx_call *a_rxCidP, afs_int32 a_partID, tv = (Volume *) 0; } if (ttc) { - DeleteTrans(ttc); + DeleteTrans(ttc, 1); ttc = (struct volser_trans *)0; } closedir(dirp); @@ -2550,7 +2546,7 @@ VolXListVolumes(struct rx_call *a_rxCidP, afs_int32 a_partID, tv = (Volume *) 0; } if (ttc) { - DeleteTrans(ttc); + DeleteTrans(ttc, 1); ttc = (struct volser_trans *)0; } GetNextVol(dirp, volname, &volid); @@ -2562,7 +2558,7 @@ VolXListVolumes(struct rx_call *a_rxCidP, afs_int32 a_partID, */ closedir(dirp); if (ttc) - DeleteTrans(ttc); + DeleteTrans(ttc, 1); return (0); } /*SAFSVolXListVolumes */ diff --git a/src/volser/voltrans.c b/src/volser/voltrans.c index 6dd744c8a..8a137bca3 100644 --- a/src/volser/voltrans.c +++ b/src/volser/voltrans.c @@ -79,9 +79,7 @@ static afs_int32 transCounter = 1; /* create a new transaction, returning ptr to same with high ref count */ struct volser_trans * -NewTrans(avol, apart) - afs_int32 avol; - afs_int32 apart; +NewTrans(afs_int32 avol, afs_int32 apart) { /* set volid, next, partition */ register struct volser_trans *tt; @@ -117,8 +115,7 @@ NewTrans(avol, apart) /* find a trans, again returning with high ref count */ struct volser_trans * -FindTrans(atrans) - register afs_int32 atrans; +FindTrans(register afs_int32 atrans) { register struct volser_trans *tt; VTRANS_LOCK; @@ -135,8 +132,8 @@ FindTrans(atrans) } /* delete transaction if refcount == 1, otherwise queue delete for later. Does implicit TRELE */ -DeleteTrans(atrans) - register struct volser_trans *atrans; +afs_int32 +DeleteTrans(register struct volser_trans *atrans, afs_int32 lock) { register struct volser_trans *tt, **lt; afs_int32 error; @@ -149,7 +146,7 @@ DeleteTrans(atrans) } /* otherwise we zap it ourselves */ - VTRANS_LOCK; + if (lock) VTRANS_LOCK; lt = &allTrans; for (tt = *lt; tt; lt = &tt->next, tt = *lt) { if (tt == atrans) { @@ -158,19 +155,19 @@ DeleteTrans(atrans) tt->volume = NULL; *lt = tt->next; free(tt); - VTRANS_UNLOCK; + if (lock) VTRANS_UNLOCK; return 0; } } - VTRANS_UNLOCK; + if (lock) VTRANS_UNLOCK; return -1; /* failed to find the transaction in the generic list */ } /* THOLD is a macro defined in volser.h */ /* put a transaction back */ -TRELE(at) - register struct volser_trans *at; +afs_int32 +TRELE(register struct volser_trans *at) { if (at->refCount == 0) { Log("TRELE: bad refcount\n"); @@ -179,7 +176,7 @@ TRELE(at) at->time = FT_ApproxTime(); /* we're still using it */ if (at->refCount == 1 && (at->tflags & TTDeleted)) { - DeleteTrans(at); + DeleteTrans(at, 1); return 0; } /* otherwise simply drop refcount */ @@ -191,6 +188,7 @@ TRELE(at) #define OLDTRANSTIME 600 /* seconds */ #define OLDTRANSWARN 300 /* seconds */ static int GCDeletes = 0; +afs_int32 GCTrans() { register struct volser_trans *tt, *nt; @@ -212,7 +210,7 @@ GCTrans() if (tt->time + OLDTRANSTIME < now) { Log("trans %u on volume %u has timed out\n", tt->tid, tt->volid); tt->refCount++; /* we're using it now */ - DeleteTrans(tt); /* drops refCount or deletes it */ + DeleteTrans(tt, 0); /* drops refCount or deletes it */ GCDeletes++; } } diff --git a/src/volser/vsutils.c b/src/volser/vsutils.c index 1be799353..f103a27ed 100644 --- a/src/volser/vsutils.c +++ b/src/volser/vsutils.c @@ -445,128 +445,10 @@ vsu_ClientInit(noAuthFlag, confDir, cellName, sauth, uclientp, secproc) static struct rx_connection *serverconns[VLDB_MAXSERVERS]; char cellstr[64]; - - code = rx_Init(0); - if (code) { - fprintf(STDERR, "vsu_ClientInit: could not initialize rx.\n"); - return code; - } - rx_SetRxDeadTime(90); - - if (sauth) { /* -localauth */ - tdir = afsconf_Open(AFSDIR_SERVER_ETC_DIRPATH); - if (!tdir) { - fprintf(STDERR, - "vsu_ClientInit: Could not process files in configuration directory (%s).\n", - AFSDIR_SERVER_ETC_DIRPATH); - return -1; - } - code = afsconf_ClientAuth(tdir, &sc, &scIndex); /* sets sc,scIndex */ - if (code) { - fprintf(STDERR, - "vsu_ClientInit: Could not get security object for -localAuth\n"); - return -1; - } - code = - afsconf_GetCellInfo(tdir, tdir->cellName, AFSCONF_VLDBSERVICE, - &info); - if (code) { - fprintf(STDERR, - "vsu_ClientInit: can't find cell %s's hosts in %s/%s\n", - cellName, AFSDIR_SERVER_ETC_DIRPATH, - AFSDIR_CELLSERVDB_FILE); - exit(1); - } - } else { /* not -localauth */ - tdir = afsconf_Open(confDir); - if (!tdir) { - fprintf(STDERR, - "vsu_ClientInit: Could not process files in configuration directory (%s).\n", - confDir); - return -1; - } - - if (!cellName) { - code = afsconf_GetLocalCell(tdir, cellstr, sizeof(cellstr)); - if (code) { - fprintf(STDERR, - "vsu_ClientInit: can't get local cellname, check %s/%s\n", - confDir, AFSDIR_THISCELL_FILE); - exit(1); - } - cellName = cellstr; - } - - code = - afsconf_GetCellInfo(tdir, cellName, AFSCONF_VLDBSERVICE, &info); - if (code) { - fprintf(STDERR, - "vsu_ClientInit: can't find cell %s's hosts in %s/%s\n", - cellName, confDir, AFSDIR_CELLSERVDB_FILE); - exit(1); - } - if (noAuthFlag) /* -noauth */ - scIndex = 0; - else { /* not -noauth */ - strcpy(sname.cell, info.name); - sname.instance[0] = 0; - strcpy(sname.name, "afs"); - code = ktc_GetToken(&sname, &ttoken, sizeof(ttoken), NULL); - if (code) { /* did not get ticket */ - fprintf(STDERR, - "vsu_ClientInit: Could not get afs tokens, running unauthenticated.\n"); - scIndex = 0; - } else { /* got a ticket */ - scIndex = 2; - if ((ttoken.kvno < 0) || (ttoken.kvno > 255)) { - fprintf(STDERR, - "vsu_ClientInit: funny kvno (%d) in ticket, proceeding\n", - ttoken.kvno); - } - } - } - - switch (scIndex) { - case 0: - sc = rxnull_NewClientSecurityObject(); - break; - case 2: - sc = rxkad_NewClientSecurityObject(vsu_rxkad_level, - &ttoken.sessionKey, - ttoken.kvno, ttoken.ticketLen, - ttoken.ticket); - break; - default: - fprintf(STDERR, "vsu_ClientInit: unsupported security index %d\n", - scIndex); - exit(1); - break; - } - } - - afsconf_Close(tdir); - - if (secproc) /* tell UV module about default authentication */ - (*secproc) (sc, scIndex); - if (info.numServers > VLDB_MAXSERVERS) { - fprintf(STDERR, - "vsu_ClientInit: info.numServers=%d (> VLDB_MAXSERVERS=%d)\n", - info.numServers, VLDB_MAXSERVERS); - exit(1); - } - for (i = 0; i < info.numServers; i++) { - serverconns[i] = - rx_NewConnection(info.hostAddr[i].sin_addr.s_addr, - info.hostAddr[i].sin_port, USER_SERVICE_ID, sc, - scIndex); - } - *uclientp = 0; - code = ubik_ClientInit(serverconns, uclientp); - if (code) { - fprintf(STDERR, "vsu_ClientInit: ubik client init failed.\n"); - return code; - } - return 0; + return ugen_ClientInit(noAuthFlag, confDir, cellName, sauth, uclientp, + secproc, "vsu_ClientInit", vsu_rxkad_level, + VLDB_MAXSERVERS, AFSCONF_VLDBSERVICE, 90, + 0, 0, USER_SERVICE_ID); } -- 2.39.5