函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\apparmor\path.c Create Date:2022-07-27 21:29:41
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:d_namespace_path - lookup a name associated with a given path*@path: path to lookup (NOT NULL)*@buf: buffer to store path to (NOT NULL)*@name: Returns - pointer for start of path name with in @buf (NOT NULL)*@flags: flags controlling path

函数原型:static int d_namespace_path(const struct path *path, char *buf, char **name, int flags, const char *disconnected)

返回类型:int

参数:

类型参数名称
const struct path *path
char *buf
char **name
intflags
const char *disconnected
92  error等于0
93  connected等于1
94  isdir等于如果flags按位与 path is a directory 则1否则0
95  buflen等于aa_g_path_maxisdir
97  如果mnt_flags按位与MNT_INTERNAL
99  res等于dentry_path(dentry, buf, buflen)
100  name等于res
101  如果是错误
102  name等于buf
103  返回:错误
105  如果s_magic恒等于PROC_SUPER_MAGIC字符串指定长度比较恒等于0则
111  转到:out
112  否则error等于If the path is not connected to the expected root,* check if it is a sysctl and handle specially else remove any* leading / that __d_path may have returned
115  转到:out
119  如果flags按位与 do path lookup relative to chroot
121  get_fs_root(fs, & root)
122  res等于__d_path(path, & root, buf, buflen)
123  path_put( & root)
124  否则
125  res等于d_absolute_path(path, buf, buflen)
126  如果非our_mnt(mnt)则connected等于0
133  如果非res是错误
134  如果错误恒等于负ENAMETOOLONG
135  error等于负ENAMETOOLONG
136  name等于buf
137  转到:out
139  connected等于0
140  res等于dentry_path_raw(dentry, buf, buflen)
141  如果是错误
142  error等于错误
143  name等于buf
144  转到:out
146  否则如果非our_mnt(mnt)则connected等于0
149  name等于res
151  如果非connectederror等于If the path is not connected to the expected root,* check if it is a sysctl and handle specially else remove any* leading / that __d_path may have returned
160  如果d_unlinked(dentry)且d_is_positive(dentry)且非flags按位与 mediate deleted paths 按位或 delegate deleted files 的值的值则
162  error等于负ENOENT
163  转到:out
166  out :
171  如果(!error && isdir && () != '\0' || ) != '/'))则strcpy( & buf[aa_g_path_max - 2], "/")
174  返回:error
调用者
名称描述
aa_path_nameaa_path_name - get the pathname to a buffer ensure dir / is appended*@path: path the file (NOT NULL)*@flags: flags controlling path name generation*@buffer: buffer to put name in (NOT NULL)*@name: Returns - the generated path name if !error (NOT