Function report |
Source Code:security\commoncap.c |
Create Date:2022-07-28 18:36:12 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:getsecurity: We are called for security
Proto:int cap_inode_getsecurity(struct inode *inode, const char *name, void **buffer, bool alloc)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
struct inode * | inode | |
const char * | name | |
void ** | buffer | |
bool | alloc |
375 | char * tmpbuf = NULL |
381 | If strcmp(name, "capability") != 0 Then Return -EOPNOTSUPP |
384 | dentry = d_find_any_alias(inode) |
388 | size = sizeof(structvfs_ns_cap_data) |
389 | ret = vfs_getxattr_alloc(dentry, XATTR_NAME_CAPS, & tmpbuf, size, GFP_NOFS) |
398 | If is_v2header((size_t)ret, cap) Then |
406 | Else if Not is_v3header((size_t)ret, cap) Then |
412 | root = le32_to_cpu(rootid) |
418 | If (mappedroot != (uid_t) - 1 && mappedroot != (uid_t)0) Then |
427 | If Not rootid_owns_currentns(kroot) Then |
429 | Return -EOPNOTSUPP |
433 | size = sizeof(structvfs_cap_data) |
434 | If alloc Then |
435 | buffer = Allocation memory |
436 | If buffer Then |
439 | magic = VFS_CAP_REVISION_2 |
440 | nsmagic = le32_to_cpu(magic_etc) |
441 | If nsmagic & VFS_CAP_FLAGS_EFFECTIVE Then magic |= VFS_CAP_FLAGS_EFFECTIVE |
444 | Little endian = cpu_to_le32(magic) |
445 | Else |
450 | Return size |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |