函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\crypto\fname.c Create Date:2022-07-29 10:57:01
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:scrypt_setup_filename() - prepare to search a possibly encrypted directory*@dir: the directory that will be searched*@iname: the user-provided filename being searched for*@lookup: 1 if we're allowed to proceed without the key because it's* ->lookup() or

函数原型:int fscrypt_setup_filename(struct inode *dir, const struct qstr *iname, int lookup, struct fscrypt_name *fname)

返回类型:int

参数:

类型参数名称
struct inode *dir
const struct qstr *iname
intlookup
struct fscrypt_name *fname
323  memset(fname, 0, sizeof(structfscrypt_name))
324  usr_fname等于iname
326  如果非IS_ENCRYPTED(dir)或fscrypt_is_dot_dotdot(iname)则
327  name等于name
328  len等于len
329  返回:0
331  ret等于fscrypt_get_encryption_info(dir)
332  如果ret则返回:ret
335  如果fscrypt_has_encryption_key(dir)则
336  如果非fscrypt_fname_encrypted_size(dir, len, max_namelen, & len)则返回:负ENAMETOOLONG
340  name等于开辟内存
342  如果非name则返回:负ENOMEM
345  ret等于ame_encrypt() - encrypt a filename* The output buffer must be at least as large as the input buffer.* Any extra space is filled with NUL padding before encryption.* Return: 0 on success, -errno on failure
347  如果ret则转到:errout
349  name等于name
350  len等于len
351  返回:0
353  如果非lookup则返回:负ENOKEY
355  is_ciphertext_name = true
361  如果name[0]恒等于'_'则
362  如果len不等于1加BASE64_CHARS(fscrypt_digested_name的长度)则返回:负ENOENT
365  digested等于1
366  否则
367  如果len大于BASE64_CHARS(FSCRYPT_FNAME_MAX_UNDIGESTED_SIZE)则返回:负ENOENT
370  digested等于0
373  name等于开辟内存
377  如果(name == NULL)则返回:负ENOMEM
380  ret等于base64_decode(name + digested, len - digested, name)
382  如果ret小于0则
383  ret等于负ENOENT
384  转到:errout
386  len等于ret
387  如果digested
388  n等于name
390  hash等于hash
391  minor_hash等于minor_hash
392  否则
393  name等于name
394  len等于len
396  返回:0
398  errout :
399  释放内存
400  返回:ret
调用者
名称描述
__fscrypt_prepare_lookup