Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\crypto\fname.c Create Date:2022-07-28 20:23:39
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: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

Proto:int fscrypt_setup_filename(struct inode *dir, const struct qstr *iname, int lookup, struct fscrypt_name *fname)

Type:int

Parameter:

TypeParameterName
struct inode *dir
const struct qstr *iname
intlookup
struct fscrypt_name *fname
323  memset(fname, 0, sizeof(structfscrypt_name))
324  usr_fname = iname
326  If Not IS_ENCRYPTED(dir) || fscrypt_is_dot_dotdot(iname) Then
327  name = name
328  len = len
329  Return 0
331  ret = fscrypt_get_encryption_info(dir)
332  If ret Then Return ret
335  If fscrypt_has_encryption_key(dir) Then
336  If Not fscrypt_fname_encrypted_size(dir, len, max_namelen, & len) Then Return -ENAMETOOLONG
340  name = Allocation memory
342  If Not name Then Return -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  If ret Then Go to errout
349  name = name
350  len = len
351  Return 0
353  If Not lookup Then Return -ENOKEY
355  is_ciphertext_name = true
361  If name[0] == '_' Then
362  If len != 1 + BASE64_CHARS( size of fscrypt_digested_name ) Then Return -ENOENT
365  digested = 1
366  Else
367  If len > BASE64_CHARS(FSCRYPT_FNAME_MAX_UNDIGESTED_SIZE) Then Return -ENOENT
370  digested = 0
373  name = Allocation memory
377  If (name == NULL) Then Return -ENOMEM
380  ret = base64_decode(name + digested, len - digested, name)
382  If ret < 0 Then
383  ret = -ENOENT
384  Go to errout
386  len = ret
387  If digested Then
388  n = name
390  hash = hash
391  minor_hash = minor_hash
392  Else
393  name = name
394  len = len
396  Return 0
398  errout :
399  kfree(name)
400  Return ret
Caller
NameDescribe
__fscrypt_prepare_lookup