#ifdef AFS_OBSD_ENV
#include "h/syscallargs.h"
#endif
-#ifdef AFS_FBSD50_ENV
+#ifdef AFS_FBSD_ENV
#include "h/sysproto.h"
#endif
#ifdef AFS_NBSD40_ENV
short afs_waitForeverCount = 0;
afs_int32 afs_showflags = GAGUSER | GAGCONSOLE; /* show all messages */
-#ifdef AFS_DISCON_ENV
afs_int32 afs_is_disconnected;
afs_int32 afs_is_discon_rw;
/* On reconnection, turn this knob on until it finishes,
* then turn it off.
*/
afs_int32 afs_in_sync = 0;
-#endif
struct afs_pdata {
char *ptr;
DECL_PIOCTL(PGetPAG);
#if defined(AFS_CACHE_BYPASS)
DECL_PIOCTL(PSetCachingThreshold);
-DECL_PIOCTL(PSetCachingBlkSize);
#endif
/*
return (code);
}
#elif defined(AFS_XBSD_ENV)
-# if defined(AFS_FBSD50_ENV)
+# if defined(AFS_FBSD_ENV)
# define arg data
int
afs_xioctl(struct thread *td, register struct ioctl_args *uap,
}
if (!ioctlDone) {
-# if defined(AFS_FBSD50_ENV)
+# if defined(AFS_FBSD_ENV)
return ioctl(td, uap);
-# elif defined(AFS_FBSD_ENV)
- return ioctl(p, uap);
# elif defined(AFS_OBSD_ENV)
code = sys_ioctl(p, uap, retval);
# elif defined(AFS_NBSD_ENV)
# endif
}
-#elif defined(AFS_FBSD50_ENV)
+#elif defined(AFS_FBSD_ENV)
int
afs_pioctl(struct thread *td, void *args, int *retval)
{
#elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
int
-# if defined(AFS_FBSD_ENV)
-afs_pioctl(struct thread *td, void *args)
-# else
afs_pioctl(afs_proc_t *p, void *args, int *retval)
-# endif
{
struct a {
char *path;
if (set_parent_pag) {
afs_uint32 pag;
#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
-# if defined(AFS_DARWIN_ENV)
- afs_proc_t *p = current_proc(); /* XXX */
char procname[256];
- proc_selfname(procname, 256);
-# elif defined(AFS_FBSD_ENV)
- struct thread *p = curthread;
- char *procname = p->td_proc->p_comm;
-# elif defined(AFS_NBSD40_ENV)
- afs_proc_t *p = curproc; /* XXX */
- char *procname = p->l_proc->p_comm;
-# else
- afs_proc_t *p = curproc; /* XXX */
- char *procname = p->p_comm;
-# endif
+ osi_procname(procname, 256);
afs_warnuser("Process %d (%s) tried to change pags in PSetTokens\n",
MyPidxx2Pid(MyPidxx), procname);
- if (!setpag(p, acred, -1, &pag, 1)) {
+ if (!setpag(osi_curproc(), acred, -1, &pag, 1)) {
#else
if (!setpag(acred, -1, &pag, 1)) {
#endif
goto loop;
}
#ifdef AFS_DARWIN80_ENV
- if (tvc->f.states & CDeadVnode) {
- if (!(tvc->f.states & CBulkFetching)) {
- ReleaseReadLock(&afs_xvcache);
- afs_osi_Sleep(&tvc->f.states);
- goto loop;
+ if (tvc->f.states & CDeadVnode) {
+ if (!(tvc->f.states & CBulkFetching)) {
+ ReleaseReadLock(&afs_xvcache);
+ afs_osi_Sleep(&tvc->f.states);
+ goto loop;
+ }
}
- }
-#endif
-#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV)
- VN_HOLD(AFSTOV(tvc));
-#elif defined(AFS_DARWIN80_ENV)
vp = AFSTOV(tvc);
if (vnode_get(vp))
continue;
newcred->cr_groupset.gs_union.un_groups[1] = g1;
#elif defined(AFS_LINUX26_ENV)
# ifdef AFS_LINUX26_ONEGROUP_ENV
- set_cr_group_info(newcred, groups_alloc(1)); /* nothing sets this */
+ afs_set_cr_group_info(newcred, groups_alloc(1)); /* nothing sets this */
l = (((g0-0x3f00) & 0x3fff) << 14) | ((g1-0x3f00) & 0x3fff);
h = ((g0-0x3f00) >> 14);
h = ((g1-0x3f00) >> 14) + h + h + h;
- GROUP_AT(cr_group_info(newcred), 0) = ((h << 28) | l);
+ GROUP_AT(afs_cr_group_info(newcred), 0) = ((h << 28) | l);
# else
- set_cr_group_info(newcred, groups_alloc(2));
- GROUP_AT(cr_group_info(newcred), 0) = g0;
- GROUP_AT(cr_group_info(newcred), 1) = g1;
+ afs_set_cr_group_info(newcred, groups_alloc(2));
+ GROUP_AT(afs_cr_group_info(newcred), 0) = g0;
+ GROUP_AT(afs_cr_group_info(newcred), 1) = g1;
# endif
#elif defined(AFS_SUN510_ENV)
gids[0] = g0;
{
afs_int32 getting = 1;
afs_int32 setting = 1;
- afs_int32 threshold;
+ afs_int32 threshold = AFS_CACHE_BYPASS_DISABLED;
if (afs_pd_getInt(ain, &threshold) != 0)
setting = 0;
DECL_PIOCTL(PDiscon)
{
-#ifdef AFS_DISCON_ENV
static afs_int32 mode = 1; /* Start up in 'off' */
afs_int32 force = 0;
int code = 0;
- char flags[3];
+ char flags[4];
+ struct vrequest lreq;
- if (afs_pd_getBytes(ain, &flags, 3) == 0) {
+ if (afs_pd_getBytes(ain, &flags, 4) == 0) {
if (!afs_osi_suser(*acred))
return EPERM;
afs_ConflictPolicy = flags[1] - 1;
if (flags[2])
force = 1;
+ if (flags[3]) {
+ /* Fake InitReq support for UID override */
+ memset(&lreq, 0, sizeof(lreq));
+ lreq.uid = flags[3];
+ areq = &lreq; /* override areq we got */
+ }
/*
* All of these numbers are hard coded in fs.c. If they
return code;
return afs_pd_putInt(aout, mode);
-#else
- return EINVAL;
-#endif
}
DECL_PIOCTL(PNFSNukeCreds)