2 .\" Copyright (c) 2005 The DragonFly Project. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in
12 .\" the documentation and/or other materials provided with the
14 .\" 3. Neither the name of The DragonFly Project nor the names of its
15 .\" contributors may be used to endorse or promote products derived
16 .\" from this software without specific, prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 .\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21 .\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22 .\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23 .\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
24 .\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25 .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
26 .\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27 .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
28 .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 .\" $DragonFly: src/share/man/man9/nlookup.9,v 1.10 2007/05/19 17:32:13 swildner Exp $
39 .Nm nlookup_init_raw ,
40 .Nm nlookup_set_cred ,
54 .Fn nlookup "struct nlookupdata *nd"
56 .Fn nlookup_init "struct nlookupdata *nd" "const char *path" "enum uio_seg seg" "int flags"
58 .Fn nlookup_init_raw "struct nlookupdata *nd" "const char *path" "enum uio_seg seg" "int flags" "struct ucred *cred" "struct namecache *ncstart"
60 .Fn nlookup_set_cred "struct nlookupdata *nd" "struct ucred *cred"
62 .Fn nlookup_zero "struct nlookupdata *nd"
64 .Fn nlookup_done "struct nlookupdata *nd"
65 .Ft "struct namecache *"
66 .Fn nlookup_simple "const char *str" "enum uio_seg seg" "int niflags" "int *error"
68 .Fn nlookup_mp "struct mount *mp" "struct namecache **ncpp"
70 .Fn nreadsymlink "struct nlookupdata *nd" "struct namecache *ncp" "struct nlcomponent *nlc"
72 .Fn naccess "struct namecache *ncp" "int vmode" "struct ucred *cred"
74 .Fn naccess_va "struct vattr *va" "int vmode" "struct ucred *cred"
77 does a generic namecache lookup.
79 .Fa "struct nlookupdata"
82 on return, even if an error occurs.
83 If no error occurs the returned nl_ncp
84 is always referenced and locked, otherwise it may or may not be.
85 Intermediate directory elements, including the current directory,
86 require execute (search) permission.
88 does not examine the access permissions on the returned element.
93 is set the last directory must allow
96 .Dv VCREATE Ns / Ns Dv VDELETE
98 and an error code of 0
99 will be returned for a non-existent target.
100 Otherwise a non-existent target will cause
106 .Fa "struct nlookupdata" ,
107 and does an early error
108 return for copyin faults or a degenerate empty string (which is
110 The first process proc0's
111 credentials are used if the calling
112 thread is not associated with a process context.
117 but does not assume a process context.
118 rootncp is always chosen for the root directory and the
120 and starting directory are supplied in the arguments.
123 sets a different credential; this credential will be used by
124 future operations performed on nd.nl_open_vp
131 .Fa "struct nlookupdata" .
136 structure after we are through with
138 This function may be called on any nlookupdata structure
143 is mandatory in all cases except where
145 returns an error, even if as a consumer you believe you
146 have taken all dynamic elements out of the
151 is a simple all-in-one
153 It returns a locked namecache structure or NULL if an error
155 Note that the returned ncp
156 is not checked for permissions,
159 is checked on the directory path leading up to
163 to check the permissions of the returned leaf.
166 is used to resolve a mount point's glue ncp.
167 It creates the illusion of continuity in the namecache tree
168 by connecting the ncp related to the vnode under the mount
169 to the ncp related to the mount's root vnode.
170 If no error occurred a locked, ref'd ncp is stored in
174 reads the contents of a symlink, allocates a path buffer out
175 of the namei_zone and initialize the supplied nlcomponent
177 If an error occurs no buffer will be allocated or returned
181 generally checks the V* access bits from
183 All specified bits must pass for this function to return 0.
186 is specified and the target ncp represents a
187 non-existent file or dir, or if
190 target exists, the parent directory is checked for
194 is specified and the target ncp represents a positive
195 hit, an error is returned.
198 is not specified and the target does not exist
204 does not (and should not) return
206 for non-existent leafs.
207 The passed ncp may or may not be locked.
208 The caller should use a locked ncp on leaf lookups, especially
217 checks the requested access against the given
224 .Pa src/sys/kern/vfs_nlookup.c
226 This man page was written by
229 This man page needs further work.