2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
17 #include <afsconfig.h>
18 #include "afs/param.h"
23 #include "afs/sysincludes.h" /* Standard vendor system headers */
24 #include "afsincludes.h" /* Afs-based standard headers */
25 #include <sys/namei.h>
28 /* serious cheating */
30 #define curproc curthread
33 #ifndef AFS_FBSD50_ENV
35 * afs_suser() returns true if the caller is superuser, false otherwise.
37 * Note that it must NOT set errno.
44 if (suser(curproc) == 0) {
52 osi_lookupname(char *aname, enum uio_seg seg, int followlink,
53 struct vnode **dirvpp, struct vnode **vpp)
63 /* if (dirvpp) flags|=WANTPARENT; *//* XXX LOCKPARENT? */
64 NDINIT(&n, LOOKUP, flags, seg, aname, curproc);
65 if (error = namei(&n))
72 /* should we do this? */
73 VOP_UNLOCK(n.ni_vp, 0, curproc);
74 NDFREE(&n, NDF_ONLY_PNBUF);
79 * does not implement security features of kern_time.c:settime()
82 afs_osi_SetTime(osi_timeval_t * atv)
85 printf("afs attempted to set clock; use \"afsd -nosettime\"\n");
88 struct timeval tv, delta;
95 timevalsub(&delta, &tv);
96 ts.tv_sec = atv->tv_sec;
97 ts.tv_nsec = atv->tv_usec * 1000;
100 lease_updatetime(delta.tv_sec);