Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\tomoyo\realpath.c Create Date:2022-07-28 19:46:06
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:moyo_get_local_path - Get the path of a dentry.*@dentry: Pointer to "struct dentry".*@buffer: Pointer to buffer to return value in.*@buflen: Sizeof @buffer.* Returns the buffer on success, an error code otherwise.

Proto:static char *tomoyo_get_local_path(struct dentry *dentry, char *const buffer, const int buflen)

Type:char

Parameter:

TypeParameterName
struct dentry *dentry
char *constbuffer
const intbuflen
155  sb = The root of the dentry tree
156  pos = moyo_get_dentry_path - Get the path of a dentry.*@dentry: Pointer to "struct dentry".*@buffer: Pointer to buffer to return value in.*@buflen: Sizeof @buffer.* Returns the buffer on success, an error code otherwise.
158  If IS_ERR(pos) Then Return pos
161  If s_magic == PROC_SUPER_MAGIC && pos == '/' Then
163  pid = simple_strtoul - convert a string to an unsigned long*@cp: The start of the string*@endp: A pointer to the end of the parsed string will be placed here*@base: The number base to use* This function is obsolete. Please use kstrtoul instead.
167  pos = ep - 5
168  If pos < buffer Then Go to out
170  memmove(pos, "/self", 5)
172  Go to prepend_filesystem_name
175  If Not MAJOR( search index; _not_ kdev_t ) Then Go to prepend_filesystem_name
178  inode = d_backing_inode - Get upper or lower inode we should be using*@upper: The upper layer* This is the helper that should be used to get at the inode that will be used* if this dentry were to be opened as a file. The inode may be on the upper
184  If Not rename Then Go to prepend_filesystem_name
191  dev = search index; _not_ kdev_t
193  name[ size of name - 1] = '\0'
194  snprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@
196  name_len = strlen - Find the length of a string*@s: The string to be sized
197  pos -= name_len
198  If pos < buffer Then Go to out
200  memmove(pos, name, name_len)
201  Return pos
204  prepend_filesystem_name :
206  name = name
207  name_len = strlen - Find the length of a string*@s: The string to be sized
209  pos -= name_len + 1
210  If pos < buffer Then Go to out
212  memmove(pos, name, name_len)
213  pos[name_len] = ':'
215  Return pos
216  out :
217  Return ERR_PTR( - ENOMEM)
Caller
NameDescribe
tomoyo_realpath_from_pathmoyo_realpath_from_path - Returns realpath(3) of the given pathname but ignores chroot'ed root