}
#endif /* defined(AFS_SGI_ENV) && (_MIPS_SZLONG==64) */
-#if defined(AFS_LINUX_64BIT_KERNEL) && !defined(AFS_ALPHA_LINUX20_ENV) && !defined(AFS_IA64_LINUX20_ENV) && !defined(AFS_AMD64_LINUX20_ENV)
+#if defined(AFS_LINUX_64BIT_KERNEL) && !defined(AFS_ALPHA_LINUX20_ENV) && !defined(AFS_IA64_LINUX20_ENV)
struct afs_ioctl32 dst32;
#ifdef AFS_SPARC64_LINUX24_ENV
if (current->thread.flags & SPARC_FLAG_32BIT)
-#elif AFS_SPARC64_LINUX20_ENV
+#elif defined(AFS_SPARC64_LINUX20_ENV)
if (current->tss.flags & SPARC_FLAG_32BIT)
+#elif defined(AFS_AMD64_LINUX20_ENV)
+ if (current->thread.flags & THREAD_IA32)
#else
#error Not done for this linux type
-#endif /* AFS_SPARC64_LINUX20_ENV */
+#endif
{
AFS_COPYIN(cmarg, (caddr_t) &dst32, sizeof dst32, code);
if (!code)
return u.u_error;
#endif
}
-#endif /* AFS_SGI_ENV */
-#ifdef AFS_OSF_ENV
+#elif defined(AFS_OSF_ENV)
afs_pioctl(p, args, retval)
struct proc *p;
void *args;
return (afs_syscall_pioctl(uap->path, uap->cmd, uap->cmarg, uap->follow));
}
-#else /* AFS_OSF_ENV */
-#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#elif defined(AFS_FBSD50_ENV)
+int
+afs_pioctl(td, args, retval)
+ struct thread *td;
+ void *args;
+ int *retval;
+{
+ struct a {
+ char *path;
+ int cmd;
+ caddr_t cmarg;
+ int follow;
+ } *uap = (struct a *) args;
+
+ AFS_STATCNT(afs_pioctl);
+ return (afs_syscall_pioctl(uap->path, uap->cmd, uap->cmarg, uap->follow, td->td_ucred));
+}
+
+#elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
int
afs_pioctl(p, args, retval)
struct proc *p;
return (afs_syscall_pioctl(uap->path, uap->cmd, uap->cmarg, uap->follow, p->p_cred->pc_ucred));
}
-#else /* AFS_OSF_ENV */
-#endif
#endif
/* macro to avoid adding any more #ifdef's to pioctl code. */
return EINVAL; /* out of range */
}
inSize = ablob->in_size;
- if (inSize >= PIGGYSIZE) return E2BIG;
+
+ /* Do all range checking before continuing */
+ if (inSize >= PIGGYSIZE || inSize < 0 || ablob->out_size < 0)
+ return E2BIG;
+
inData = osi_AllocLargeSpace(AFS_LRALLOCSIZ);
if (inSize > 0) {
AFS_COPYIN(ablob->in, inData, inSize, code);