From: Jim Rees Date: Fri, 18 Oct 2002 18:09:27 +0000 (+0000) Subject: openbsd-20021018 X-Git-Tag: openafs-devel-1_3_50~553 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=12d6de6dd05637e97d419418a269267cc4cc6c2a;p=packages%2Fo%2Fopenafs.git openbsd-20021018 OpenBSD kernel module builds now. --- diff --git a/src/afs/VNOPS/afs_vnop_lookup.c b/src/afs/VNOPS/afs_vnop_lookup.c index ff779de8d..defe6a866 100644 --- a/src/afs/VNOPS/afs_vnop_lookup.c +++ b/src/afs/VNOPS/afs_vnop_lookup.c @@ -33,20 +33,8 @@ RCSID("$Header$"); #include "afs/afs_osidnlc.h" -/** - * A few definitions. This is until we have a proper header file - * which has prototypes for all functions - */ - extern struct DirEntry * afs_dir_GetBlob(); -extern afs_rwlock_t afs_xvcache; -extern afs_rwlock_t afs_xcbhash; -extern struct afs_exporter *afs_nfsexporter; -extern char *afs_sysname; -extern char *afs_sysnamelist[]; -extern int afs_sysnamecount; -extern struct afs_q VLRU; /*vcache LRU*/ #ifdef AFS_LINUX22_ENV extern struct inode_operations afs_symlink_iops, afs_dir_iops; #endif @@ -62,32 +50,6 @@ int afs_fakestat_enable = 0; /* 1: fakestat-all, 2: fakestat-crosscell */ * what "@sys" is in binary... */ #define AFS_EQ_ATSYS(name) (((name)[0]=='@')&&((name)[1]=='s')&&((name)[2]=='y')&&((name)[3]=='s')&&(!(name)[4])) -char *afs_strcat(register char *s1, register char *s2) -{ - register char *os1; - - AFS_STATCNT(strcat); - os1 = s1; - while (*s1++) - ; - --s1; - while ((*s1++ = *s2++)) - ; - return (os1); -} - - -char *afs_index(register char *a, register char c) -{ - register char tc; - AFS_STATCNT(afs_index); - while ((tc = *a)) { - if (tc == c) return a; - else a++; - } - return NULL; -} - /* call under write lock, evaluate mvid field from a mt pt. * avc is the vnode of the mount point object; must be write-locked. * advc is the vnode of the containing directory (optional; if NULL and @@ -120,7 +82,7 @@ int EvalMountPoint(register struct vcache *avc, struct vcache *advc, /* Determine which cell and volume the mointpoint goes to */ type = avc->linkData[0]; /* '#'=>Regular '%'=>RW */ - cpos = afs_index(&avc->linkData[1], ':'); /* if cell name present */ + cpos = afs_strchr(&avc->linkData[1], ':'); /* if cell name present */ if (cpos) { volnamep = cpos+1; *cpos = 0; @@ -1394,7 +1356,7 @@ afs_lookup(adp, aname, avcp, acred) ConvertSToRLock(&tvc->lock); code = 0; } - if (!code && !strchr(tvc->linkData, ':')) + if (!code && !afs_strchr(tvc->linkData, ':')) force_eval = 1; ReleaseReadLock(&tvc->lock); } diff --git a/src/afs/afs_call.c b/src/afs/afs_call.c index 9ed277015..f3d626886 100644 --- a/src/afs/afs_call.c +++ b/src/afs/afs_call.c @@ -308,7 +308,7 @@ afs_syscall_call(parm, parm2, parm3, parm4, parm5, parm6) long parm, parm2, parm3, parm4, parm5, parm6; { afs_int32 code = 0; -#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) size_t bufferSize; #else /* AFS_SGI61_ENV */ u_int bufferSize; @@ -467,7 +467,7 @@ long parm, parm2, parm3, parm4, parm5, parm6; while (!afs_InitSetup_done) afs_osi_Sleep(&afs_InitSetup_done); -#if defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) temp = AFS_MINBUFFERS; /* Should fix this soon */ #else /* number of 2k buffers we could get from all of the buffer space */ @@ -1132,7 +1132,8 @@ Afs_syscall(register struct afssysa *uap, rval_t *rvp) { int *retval = &rvp->r_val1; #else /* AFS_SUN5_ENV */ -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +int afs3_syscall(p, args, retval) struct proc *p; void *args; @@ -1203,13 +1204,11 @@ Afs_syscall () #endif /* UKERNEL */ #if defined(AFS_DEC_ENV) int *retval = &u.u_r.r_val1; -#else -#if defined(AFS_HPUX_ENV) +#elif defined(AFS_HPUX_ENV) long *retval = &u.u_rval1; #else int *retval = &u.u_rval1; #endif -#endif #endif /* AFS_LINUX20_ENV */ #endif /* AFS_OSF_ENV */ #endif /* AFS_SUN5_ENV */ @@ -1289,7 +1288,7 @@ Afs_syscall () AFS_GUNLOCK(); #else AFS_GLOCK(); -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) code = afs_setpag(p, args, retval); #else /* AFS_OSF_ENV */ code = afs_setpag(); @@ -1301,7 +1300,7 @@ Afs_syscall () #ifdef AFS_SUN5_ENV code = afs_syscall_pioctl(uap->parm1, uap->parm2, uap->parm3, uap->parm4, rvp, CRED()); #else -#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) code = afs_syscall_pioctl(uap->parm1, uap->parm2, uap->parm3, uap->parm4, p->p_cred->pc_ucred); #else code = afs_syscall_pioctl(uap->parm1, uap->parm2, uap->parm3, uap->parm4); @@ -1322,7 +1321,7 @@ Afs_syscall () iparams.param3, iparams.param4, rvp, CRED()); #else code = afs_syscall_icreate(uap->parm1, uap->parm2, iparams.param1, iparams.param2, -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) iparams.param3, iparams.param4, retval); #else iparams.param3, iparams.param4); @@ -1332,7 +1331,7 @@ Afs_syscall () #ifdef AFS_SUN5_ENV code = afs_syscall_iopen(uap->parm1, uap->parm2, uap->parm3, rvp, CRED()); #else -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) code = afs_syscall_iopen(uap->parm1, uap->parm2, uap->parm3, retval); #else code = afs_syscall_iopen(uap->parm1, uap->parm2, uap->parm3); @@ -1537,7 +1536,7 @@ void shutdown_afstest(void) /* In case there is a bunch of dynamically build bkg daemons to free */ void afs_shutdown_BKG(void) { - AFS_STATCNT(shutdown_BKG); + AFS_STATCNT(shutdown_BKG); } @@ -1572,7 +1571,7 @@ Afscall_icl(long opcode, long p1, long p2, long p3, long p4, long *retval) register afs_int32 code; struct afs_icl_log *logp; struct afs_icl_set *setp; -#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) size_t temp; #else /* AFS_SGI61_ENV */ afs_uint32 temp; diff --git a/src/afs/afs_pioctl.c b/src/afs/afs_pioctl.c index c14dd46f9..852d1955b 100644 --- a/src/afs/afs_pioctl.c +++ b/src/afs/afs_pioctl.c @@ -13,6 +13,9 @@ RCSID("$Header$"); #include "afs/sysincludes.h" /* Standard vendor system headers */ +#ifdef AFS_OBSD_ENV +#include "h/syscallargs.h" +#endif #include "afsincludes.h" /* Afs-based standard headers */ #include "afs/afs_stats.h" /* afs statistics */ #include "afs/vice.h" @@ -394,7 +397,7 @@ kioctl(fdes, com, arg, ext) #endif } u_uap, *uap = &u_uap; #else -#ifdef AFS_SUN5_ENV +#if defined(AFS_SUN5_ENV) struct afs_ioctl_sys { int fd; @@ -406,8 +409,7 @@ afs_xioctl (uap, rvp) struct afs_ioctl_sys *uap; rval_t *rvp; { -#else -#ifdef AFS_OSF_ENV +#elif defined(AFS_OSF_ENV) afs_xioctl (p, args, retval) struct proc *p; void *args; @@ -418,20 +420,20 @@ afs_xioctl (p, args, retval) u_long com; caddr_t arg; } *uap = (struct a *)args; -#else /* AFS_OSF_ENV */ -#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) struct ioctl_args { - int fd; - u_long com; - caddr_t arg; + int fd; + u_long com; + caddr_t arg; }; + +int afs_xioctl(p, uap, retval) struct proc *p; register struct ioctl_args *uap; register_t *retval; { -#else -#ifdef AFS_LINUX22_ENV +#elif defined(AFS_LINUX22_ENV) struct afs_ioctl_sys { unsigned int com; unsigned long arg; @@ -442,58 +444,52 @@ asmlinkage int afs_xioctl(struct inode *ip, struct file *fp, struct afs_ioctl_sys ua, *uap = &ua; #else int afs_xioctl (void) - { - register struct a { +{ + register struct a { int fd; int com; caddr_t arg; - } *uap = (struct a *)u.u_ap; -#endif /* AFS_LINUX22_ENV */ -#endif /* AFS_DARWIN_ENV || AFS_FBSD_ENV */ -#endif /* AFS_OSF_ENV */ + } *uap = (struct a *)u.u_ap; #endif /* AFS_SUN5_ENV */ #endif -#ifndef AFS_LINUX22_ENV -#if defined(AFS_AIX32_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) - struct file *fd; -#else - register struct file *fd; -#endif +#if defined(AFS_AIX32_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) + struct file *fd; +#elif !defined(AFS_LINUX22_ENV) + register struct file *fd; #endif -#if defined(AFS_FBSD_ENV) - register struct filedesc *fdp; +#if defined(AFS_XBSD_ENV) + register struct filedesc *fdp; #endif - register struct vcache *tvc; - register int ioctlDone = 0, code = 0; + register struct vcache *tvc; + register int ioctlDone = 0, code = 0; - AFS_STATCNT(afs_xioctl); -#if defined(AFS_FBSD_ENV) - fdp=p->p_fd; - if ((u_int)uap->fd >= fdp->fd_nfiles || - (fd = fdp->fd_ofiles[uap->fd]) == NULL) - return EBADF; - if ((fd->f_flag & (FREAD | FWRITE)) == 0) - return EBADF; + AFS_STATCNT(afs_xioctl); +#if defined(AFS_XBSD_ENV) + fdp=p->p_fd; + if ((u_int)uap->fd >= fdp->fd_nfiles || + (fd = fdp->fd_ofiles[uap->fd]) == NULL) + return EBADF; + if ((fd->f_flag & (FREAD | FWRITE)) == 0) + return EBADF; #else #if defined(AFS_DARWIN_ENV) - if ((code=fdgetf(p, uap->fd, &fd))) - return code; + if ((code=fdgetf(p, uap->fd, &fd))) + return code; #else #ifdef AFS_LINUX22_ENV ua.com = com; ua.arg = arg; #else #ifdef AFS_AIX32_ENV - uap->fd = fdes; - uap->com = com; - uap->arg = arg; + uap->fd = fdes; + uap->com = com; + uap->arg = arg; #ifdef AFS_AIX51_ENV - uap->arg2 = arg2; - uap->arg3 = arg3; + uap->arg2 = arg2; + uap->arg3 = arg3; #endif - - if (setuerror(getf(uap->fd, &fd))) { + if (setuerror(getf(uap->fd, &fd))) { return -1; } #else @@ -504,34 +500,34 @@ int afs_xioctl (void) #else /* AFS_OSF_ENV */ #ifdef AFS_SUN5_ENV #if defined(AFS_SUN57_ENV) - fd = getf(uap->fd); - if (!fd) return(EBADF); + fd = getf(uap->fd); + if (!fd) return(EBADF); #elif defined(AFS_SUN54_ENV) - fd = GETF(uap->fd); - if (!fd) return(EBADF); + fd = GETF(uap->fd); + if (!fd) return(EBADF); #else - if (code = getf(uap->fd, &fd)) { - return (code); - } + if (code = getf(uap->fd, &fd)) { + return (code); + } #endif #else - fd = getf(uap->fd); - if (!fd) return(EBADF); + fd = getf(uap->fd); + if (!fd) return(EBADF); #endif #endif #endif #endif #endif #endif - /* first determine whether this is any sort of vnode */ -#ifdef AFS_LINUX22_ENV - tvc = VTOAFS(ip); - { + /* first determine whether this is any sort of vnode */ +#if defined(AFS_LINUX22_ENV) + tvc = VTOAFS(ip); + { #else -#ifdef AFS_SUN5_ENV - if (fd->f_vnode->v_type == VREG || fd->f_vnode->v_type == VDIR) { +#ifdef AFS_SUN5_ENV + if (fd->f_vnode->v_type == VREG || fd->f_vnode->v_type == VDIR) { #else - if (fd->f_type == DTYPE_VNODE) { + if (fd->f_type == DTYPE_VNODE) { #endif /* good, this is a vnode; next see if it is an AFS vnode */ #if defined(AFS_AIX32_ENV) || defined(AFS_SUN5_ENV) @@ -542,150 +538,142 @@ int afs_xioctl (void) #endif /* AFS_LINUX22_ENV */ if (tvc && IsAfsVnode(AFSTOV(tvc))) { #ifdef AFS_DEC_ENV - tvc = VTOAFS(afs_gntovn((struct gnode *) tvc)); - if (!tvc) { /* shouldn't happen with held gnodes */ - u.u_error = ENOENT; - return; - } -#endif - /* This is an AFS vnode */ - if (((uap->com >> 8) & 0xff) == 'V') { - register struct afs_ioctl *datap; - AFS_GLOCK(); - datap = (struct afs_ioctl *) osi_AllocSmallSpace(AFS_SMALLOCSIZ); - AFS_COPYIN((char *)uap->arg, (caddr_t) datap, sizeof (struct afs_ioctl), code); - if (code) { - osi_FreeSmallSpace(datap); - AFS_GUNLOCK(); -#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - return code; + tvc = VTOAFS(afs_gntovn((struct gnode *) tvc)); + if (!tvc) { /* shouldn't happen with held gnodes */ + u.u_error = ENOENT; + return; + } +#endif + /* This is an AFS vnode */ + if (((uap->com >> 8) & 0xff) == 'V') { + register struct afs_ioctl *datap; + AFS_GLOCK(); + datap = (struct afs_ioctl *) osi_AllocSmallSpace(AFS_SMALLOCSIZ); + AFS_COPYIN((char *)uap->arg, (caddr_t) datap, sizeof (struct afs_ioctl), code); + if (code) { + osi_FreeSmallSpace(datap); + AFS_GUNLOCK(); +#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) + return code; #else #if defined(AFS_SUN5_ENV) #ifdef AFS_SUN54_ENV - releasef(uap->fd); + releasef(uap->fd); #else - releasef(fd); + releasef(fd); #endif - return (EFAULT); + return (EFAULT); #else #ifdef AFS_OSF_ENV #ifdef AFS_OSF30_ENV - FP_UNREF_ALWAYS(fd); + FP_UNREF_ALWAYS(fd); #else - FP_UNREF(fd); + FP_UNREF(fd); #endif - return code; + return code; #else /* AFS_OSF_ENV */ #ifdef AFS_AIX41_ENV - ufdrele(uap->fd); + ufdrele(uap->fd); #endif #ifdef AFS_LINUX22_ENV - return -code; + return -code; #else - setuerror(code); - return; + setuerror(code); + return; #endif #endif #endif #endif - } - code = HandleIoctl(tvc, uap->com, datap); - osi_FreeSmallSpace(datap); - AFS_GUNLOCK(); - ioctlDone = 1; + } + code = HandleIoctl(tvc, uap->com, datap); + osi_FreeSmallSpace(datap); + AFS_GUNLOCK(); + ioctlDone = 1; #ifdef AFS_AIX41_ENV - ufdrele(uap->fd); + ufdrele(uap->fd); #endif #ifdef AFS_OSF_ENV #ifdef AFS_OSF30_ENV - FP_UNREF_ALWAYS(fd); + FP_UNREF_ALWAYS(fd); #else - FP_UNREF(fd); + FP_UNREF(fd); #endif #endif - } + } #if defined(AFS_LINUX22_ENV) - else - code = EINVAL; + else + code = EINVAL; #endif } - } + } - if (!ioctlDone) { + if (!ioctlDone) { #ifdef AFS_AIX41_ENV - ufdrele(uap->fd); + ufdrele(uap->fd); #ifdef AFS_AIX51_ENV - code = okioctl(fdes, com, arg, ext, arg2, arg3); + code = okioctl(fdes, com, arg, ext, arg2, arg3); #else - code = okioctl(fdes, com, arg, ext); + code = okioctl(fdes, com, arg, ext); #endif - return code; + return code; #else #ifdef AFS_AIX32_ENV - okioctl(fdes, com, arg, ext); -#else -#if defined(AFS_SUN5_ENV) + okioctl(fdes, com, arg, ext); +#elif defined(AFS_SUN5_ENV) #if defined(AFS_SUN57_ENV) releasef(uap->fd); #elif defined(AFS_SUN54_ENV) - RELEASEF(uap->fd); + RELEASEF(uap->fd); #else - releasef(fd); + releasef(fd); #endif - code = ioctl(uap, rvp); -#else -#if defined(AFS_FBSD_ENV) + code = ioctl(uap, rvp); +#elif defined(AFS_FBSD_ENV) return ioctl(p, uap); -#else -#if defined(AFS_DARWIN_ENV) +#elif defined(AFS_OBSD_ENV) + code = sys_ioctl(p, uap, retval); +#elif defined(AFS_DARWIN_ENV) return ioctl(p, uap, retval); -#else -#ifdef AFS_OSF_ENV - code = ioctl(p, args, retval); +#elif defined(AFS_OSF_ENV) + code = ioctl(p, args, retval); #ifdef AFS_OSF30_ENV - FP_UNREF_ALWAYS(fd); + FP_UNREF_ALWAYS(fd); #else - FP_UNREF(fd); -#endif - return code; -#else /* AFS_OSF_ENV */ -#ifndef AFS_LINUX22_ENV - ioctl(); -#endif -#endif -#endif -#endif + FP_UNREF(fd); #endif + return code; +#elif !defined(AFS_LINUX22_ENV) + ioctl(); #endif #endif - } + } #ifdef AFS_SUN5_ENV - if (ioctlDone) + if (ioctlDone) #ifdef AFS_SUN54_ENV - releasef(uap->fd); + releasef(uap->fd); #else - releasef(fd); + releasef(fd); #endif - return (code); + return (code); #else #ifdef AFS_LINUX22_ENV - return -code; + return -code; #else #if defined(KERNEL_HAVE_UERROR) - if (!getuerror()) - setuerror(code); + if (!getuerror()) + setuerror(code); #if defined(AFS_AIX32_ENV) && !defined(AFS_AIX41_ENV) - return (getuerror() ? -1 : u.u_ioctlrv); + return (getuerror() ? -1 : u.u_ioctlrv); #else - return getuerror() ? -1 : 0; + return getuerror() ? -1 : 0; #endif #endif #endif /* AFS_LINUX22_ENV */ #endif /* AFS_SUN5_ENV */ -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - return (code); +#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) + return (code); #endif - } +} #endif /* AFS_SGI_ENV */ #endif /* AFS_HPUX102_ENV */ @@ -733,7 +721,8 @@ afs_pioctl(p, args, retval) } #else /* AFS_OSF_ENV */ -#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +int afs_pioctl(p, args, retval) struct proc *p; void *args; @@ -761,12 +750,13 @@ afs_pioctl(p, args, retval) #define PIOCTL_FREE_CRED() #endif +int #ifdef AFS_SUN5_ENV afs_syscall_pioctl(path, com, cmarg, follow, rvp, credp) rval_t *rvp; struct AFS_UCRED *credp; #else -#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) afs_syscall_pioctl(path, com, cmarg, follow, credp) struct AFS_UCRED *credp; #else @@ -871,32 +861,11 @@ afs_syscall_pioctl(path, com, cmarg, follow) #else code = Prefetch(path, &data, follow, osi_curcred()); #endif -#if !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) - if (foreigncreds) { -#ifdef AFS_AIX41_ENV - crset(tmpcred); /* restore original credentials */ -#else -#if defined(AFS_HPUX101_ENV) - set_p_cred(u.u_procp, tmpcred); /* restore original credentials */ -#else -#ifndef AFS_SUN5_ENV -#ifdef AFS_SGI_ENV - OSI_SET_CURRENT_CRED(tmpcred); /* restore original credentials */ -#else - u.u_cred = tmpcred; /* restore original credentials */ -#endif -#endif -#endif /* AFS_HPUX101_ENV */ - crfree(foreigncreds); -#endif - } -#endif /* AFS_LINUX22_ENV */ - PIOCTL_FREE_CRED(); + vp = NULL; #if defined(KERNEL_HAVE_UERROR) - return (setuerror(code), code); -#else - return (code); + setuerror(code); #endif + goto rescred; } if (path) { AFS_GUNLOCK(); @@ -914,36 +883,15 @@ afs_syscall_pioctl(path, com, cmarg, follow) #endif /* AFS_AIX41_ENV */ AFS_GLOCK(); if (code) { -#if !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) - if (foreigncreds) { -#ifdef AFS_AIX41_ENV - crset(tmpcred); /* restore original credentials */ -#else -#if defined(AFS_HPUX101_ENV) - set_p_cred(u.u_procp, tmpcred); /* restore original credentials */ -#else -#if !defined(AFS_SUN5_ENV) -#ifdef AFS_SGI_ENV - OSI_SET_CURRENT_CRED(tmpcred); /* restore original credentials */ -#else - u.u_cred = tmpcred; /* restore original credentials */ -#endif /* AFS_SGI64_ENV */ -#endif -#endif /* AFS_HPUX101_ENV */ - crfree(foreigncreds); -#endif - } -#endif /* AFS_LINUX22_ENV */ - PIOCTL_FREE_CRED(); + vp = NULL; #if defined(KERNEL_HAVE_UERROR) - return(setuerror(code), code); -#else - return (code); + setuerror(code); #endif + goto rescred; } } else vp = NULL; - + /* now make the call if we were passed no file, or were passed an AFS file */ if (!vp || IsAfsVnode(vp)) { #ifdef AFS_DEC_ENV @@ -990,7 +938,7 @@ afs_syscall_pioctl(path, com, cmarg, follow) code = afs_HandlePioctl(vp, com, &data, follow, &credp); } #else -#if defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) code = afs_HandlePioctl(vp, com, &data, follow, &credp); #else code = afs_HandlePioctl(vp, com, &data, follow, &u.u_cred); @@ -1013,26 +961,23 @@ afs_syscall_pioctl(path, com, cmarg, follow) #endif } + rescred: #if !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) if (foreigncreds) { #ifdef AFS_AIX41_ENV - crset(tmpcred); + crset(tmpcred); /* restore original credentials */ #else #if defined(AFS_HPUX101_ENV) set_p_cred(u.u_procp, tmpcred); /* restore original credentials */ -#else -#ifndef AFS_SUN5_ENV -#ifdef AFS_SGI_ENV +#elif defined(AFS_SGI_ENV) OSI_SET_CURRENT_CRED(tmpcred); /* restore original credentials */ -#else - u.u_cred = tmpcred; /* restore original credentials */ -#endif /* ASF_SGI64_ENV */ -#endif +#elif !defined(AFS_SUN5_ENV) + osi_curcred() = tmpcred; /* restore original credentials */ #endif /* AFS_HPUX101_ENV */ crfree(foreigncreds); -#endif +#endif /* AIX41 */ } -#endif /* AFS_LINUX22_ENV */ +#endif /* LINUX, DARWIN, FBSD */ if (vp) { #ifdef AFS_LINUX22_ENV dput(dp); @@ -1961,7 +1906,7 @@ static int Prefetch(char *apath, struct afs_ioctl *adata, int afollow, struct AF { register char *tp; register afs_int32 code; -#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) size_t bufferSize; #else u_int bufferSize; @@ -2438,7 +2383,7 @@ DECL_PIOCTL(PFlushVolumeData) #if defined(AFS_SGI_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV) VN_HOLD(AFSTOV(tvc)); #else -#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) osi_vnhold(tvc, 0); #else VREFCOUNT_INC(tvc); diff --git a/src/afs/afs_prototypes.h b/src/afs/afs_prototypes.h index 1f02f95be..985b99097 100644 --- a/src/afs/afs_prototypes.h +++ b/src/afs/afs_prototypes.h @@ -553,6 +553,7 @@ extern afs_int32 afs_waitForever; extern short afs_waitForeverCount; extern afs_int32 afs_showflags; extern int afs_defaultAsynchrony; +extern int afs_syscall_pioctl(); /* afs_segments.c */ extern int afs_StoreMini(register struct vcache *avc, struct vrequest *areq); @@ -655,6 +656,7 @@ extern void afs_SetPrimary(register struct unixuser *au, register int aflag); extern char *afs_cv2string(char *ttp, afs_uint32 aval); extern int afs_strcasecmp(char *s1, char *s2); extern char *afs_strdup(char *s); +extern char *afs_strcat(char *s1, char *s2); extern char *afs_strchr(char *s, int c); extern void print_internet_address(char *preamble, struct srvAddr *sa, char *postamble, int flag); diff --git a/src/afs/afs_util.c b/src/afs/afs_util.c index 114510936..296e3445c 100644 --- a/src/afs/afs_util.c +++ b/src/afs/afs_util.c @@ -85,6 +85,19 @@ int afs_strcasecmp(char *s1, char *s2) return *s1 - *s2; } +char *afs_strcat(char *s1, char *s2) +{ + char *os1; + + os1 = s1; + while (*s1++) + ; + --s1; + while ((*s1++ = *s2++)) + ; + return (os1); +} + char *afs_strchr(char *s, int c) { char *p; diff --git a/src/config/param.i386_obsd31.h b/src/config/param.i386_obsd31.h index b2264684c..198d053f7 100644 --- a/src/config/param.i386_obsd31.h +++ b/src/config/param.i386_obsd31.h @@ -48,6 +48,7 @@ #define AFS_HAVE_FFS 1 /* Use system's ffs. */ #define AFS_HAVE_STATVFS 0 /* System doesn't supports statvfs */ +#define RXK_LISTENER_ENV 1 #define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */ #define AFS_USE_GETTIMEOFDAY 1 /* use gettimeofday to implement rx clock */ diff --git a/src/fsint/afsaux.c b/src/fsint/afsaux.c index 8be1d1e43..bde2f4a75 100644 --- a/src/fsint/afsaux.c +++ b/src/fsint/afsaux.c @@ -65,7 +65,7 @@ static afs_int32 bslosers = 0; #endif #if (defined(AFS_AIX_ENV) && !defined(AUTH_DES)) || (!defined(AFS_SUN_ENV)) && !defined(AFS_SGI_ENV) && !defined(AFS_ALPHA_ENV) && !defined(AFS_SUN5_ENV) #ifndef AFS_AIX32_ENV -#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) +#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_XBSD_ENV) /* * XDR chars; from user mode xdr package. */ diff --git a/src/libafs/MakefileProto.OBSD.in b/src/libafs/MakefileProto.OBSD.in index 886ffac26..898d748b4 100644 --- a/src/libafs/MakefileProto.OBSD.in +++ b/src/libafs/MakefileProto.OBSD.in @@ -28,11 +28,9 @@ AFS_OS_OBJS = \ osi_vm.o \ osi_vnodeops.o -AFS_OS_NFSOBJS = \ - osi_vfsops_nfs.o +#AFS_OS_NFSOBJS = osi_vfsops_nfs.o -AFS_OS_NONFSOBJS = \ - osi_vfsops.o +AFS_OS_NONFSOBJS = osi_vfsops.o # This tells Makefile.common to use its single directory build target. COMPDIRS = single_compdir @@ -71,7 +69,8 @@ setup: # Below this line are targets when in the COMMON directory: LIBAFS = libafs.o -LIBAFSNONFS = libafs.nonfs.o +LIBAFSNONFS = libafs.o +#LIBAFSNONFS = libafs.nonfs.o INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS} INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/${LIBAFSNONFS}