Function report |
Source Code:security\smack\smack_lsm.c |
Create Date:2022-07-28 19:20:51 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:smack_inode_setxattr - Smack check for setting xattrs*@dentry: the object*@name: name of the attribute*@value: value of the attribute*@size: size of the value*@flags: unused* This protects the Smack attribute explicitly
Proto:static int smack_inode_setxattr(struct dentry *dentry, const char *name, const void *value, size_t size, int flags)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct dentry * | dentry | |
| const char * | name | |
| const void * | value | |
| size_t | size | |
| int | flags |
| 1259 | check_priv = 0 |
| 1260 | check_import = 0 |
| 1261 | check_star = 0 |
| 1262 | rc = 0 |
| 1267 | If strcmp(name, XATTR_NAME_SMACK) == 0 || strcmp(name, XATTR_NAME_SMACKIPIN) == 0 || strcmp(name, XATTR_NAME_SMACKIPOUT) == 0 Then |
| 1270 | check_priv = 1 |
| 1271 | check_import = 1 |
| 1272 | Else if strcmp(name, XATTR_NAME_SMACKEXEC) == 0 || strcmp(name, XATTR_NAME_SMACKMMAP) == 0 Then |
| 1277 | Else if strcmp(name, XATTR_NAME_SMACKTRANSMUTE) == 0 Then |
| 1278 | check_priv = 1 |
| 1279 | If size != TRANS_TRUE_SIZE || strncmp(value, TRANS_TRUE, TRANS_TRUE_SIZE) != 0 Then rc = -EINVAL |
| 1285 | If check_priv && Not smack_privileged(Allow MAC configuration or state changes) Then rc = -EPERM |
| 1288 | If rc == 0 && check_import Then |
| 1289 | skp = size ? smk_import_entry(value, size) : NULL |
| 1292 | Else if skp == NULL || check_star && ( skp == smack_known_star || skp == smack_known_web ) Then rc = -EINVAL |
| 1298 | smk_ad_setfield_u_fs_path_dentry( & ad, dentry) |
| 1300 | If rc == 0 Then |
| 1305 | Return rc |
| 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 |