Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / afs / NBSD / osi_misc.c
CommitLineData
805e021f
CE
1/*
2 * osi_misc.c
3 *
4 * $Id: osi_misc.c,v 1.4 2003/10/09 16:13:16 rees Exp $
5 */
6
7/*
8copyright 2002
9the regents of the university of michigan
10all rights reserved
11
12permission is granted to use, copy, create derivative works
13and redistribute this software and such derivative works
14for any purpose, so long as the name of the university of
15michigan is not used in any advertising or publicity
16pertaining to the use or distribution of this software
17without specific, written prior authorization. if the
18above copyright notice or any other identification of the
19university of michigan is included in any copy of any
20portion of this software, then the disclaimer below must
21also be included.
22
23this software is provided as is, without representation
24from the university of michigan as to its fitness for any
25purpose, and without warranty by the university of
26michigan of any kind, either express or implied, including
27without limitation the implied warranties of
28merchantability and fitness for a particular purpose. the
29regents of the university of michigan shall not be liable
30for any damages, including special, indirect, incidental, or
31consequential damages, with respect to any claim arising
32out of or in connection with the use of the software, even
33if it has been or is hereafter advised of the possibility of
34such damages.
35*/
36
37/*
38 * Copyright 2000, International Business Machines Corporation and others.
39 * All Rights Reserved.
40 *
41 * This software has been released under the terms of the IBM Public
42 * License. For details, see the LICENSE file in the top-level source
43 * directory or online at http://www.openafs.org/dl/license10.html
44 */
45
46#include <afsconfig.h>
47#include "afs/param.h"
48
49
50
51#include "afs/sysincludes.h" /* Standard vendor system headers */
52#include "afs/afsincludes.h" /* Afs-based standard headers */
53
54/*
55 * afs_suser() returns true if the caller is superuser, false otherwise.
56 *
57 * Note that it must NOT set errno.
58 */
59
60/*
61 * Modern NetBSD version of afs_osi_suser(). For cognate code calling
62 * traditional BSD suser, see OBSD/osi_misc.c.
63 */
64int
65afs_osi_suser(void *credp)
66{
67 int code;
68/*
69 * lwp->l_acflag is gone in NBSD50. It was "Accounting" stuff.
70 * lwp->l_ru is what is listed as "accounting information" now, so this
71 * may or may not work...
72 */
73#ifdef AFS_NBSD50_ENV
74 code = kauth_authorize_generic(credp,
75 KAUTH_GENERIC_ISSUSER,
76 &curlwp->l_ru);
77#else
78 code = kauth_authorize_generic(credp,
79 KAUTH_GENERIC_ISSUSER,
80 &curlwp->l_acflag);
81#endif
82 return (code == 0);
83}
84
85int
86afs_syscall_icreate(long dev, long near_inode, long param1, long param2,
87 long param3, long param4, register_t *retval)
88{
89 return EINVAL;
90}
91
92int
93afs_syscall_iopen(int dev, int inode, int usrmod, register_t *retval)
94{
95 return EINVAL;
96}
97
98int
99afs_syscall_iincdec(int dev, int inode, int inode_p1, int amount)
100{
101 return EINVAL;
102}