extern int llcrypt_has_permitted_context(struct inode *, struct inode *);
extern int llcrypt_inherit_context(struct inode *, struct inode *,
void *, bool);
+extern bool llcrypt_policy_has_filename_enc(struct inode *inode);
/* keyring.c */
extern void llcrypt_sb_free(struct super_block *sb);
extern int llcrypt_ioctl_add_key(struct file *filp, void __user *arg);
{
return -EOPNOTSUPP;
}
+static inline bool llcrypt_policy_has_filename_enc(struct inode *inode)
+{
+ return false;
+}
/* keyring.c */
static inline void llcrypt_sb_free(struct super_block *sb)
unsigned int max_len,
struct llcrypt_str *disk_link)
{
- if (IS_ENCRYPTED(dir) || llcrypt_dummy_context_enabled(dir))
+ if ((IS_ENCRYPTED(dir) &&
+ likely(llcrypt_policy_has_filename_enc(dir))) ||
+ llcrypt_dummy_context_enabled(dir))
return __llcrypt_prepare_symlink(dir, len, max_len, disk_link);
disk_link->name = (unsigned char *)target;