我正在尝试创build一个脚本,它使用ecryptfs(在sshlogin(通过pipe道发送的口令)和一些其他脚本)创build并挂载encryption的目录。 我已经知道ecryptfs-setup-private了。
我在做什么:
#!/bin/bash mkdir 1 &> /dev/null mkdir 2 &> /dev/null echo "passphrase_passwd=zxc" > ecryptfs_passphrase_passwd OPTS="ecryptfs_cipher=aes,ecryptfs_key_bytes=32,ecryptfs_enable_filename_crypto=y,ecryptfs_fnek_sig=7513645981364589,ecryptfs_passthrough=n" cat ecryptfs_passphrase_passwd | \ mount -t ecryptfs -o ${OPTS},key=passphrase:passphrase_passwd_fd=0 1 2
而且由于某种原因,下面的输出失败:
# ./mountit Error attempting to evaluate mount options: [-22] Invalid argument Check your system logs for details on why this happened. Try updating your ecryptfs-utils package, and/or submit a bug report on https://launchpad.net/ecryptfs # tail /var/log/syslog ... Apr 27 19:28:23 debian mount.ecryptfs: Error initializing key module [/usr/lib/ecryptfs/libecryptfs_key_mod_gpg.so]; Apr 27 19:28:23 debian mount.ecryptfs: parse_options_file: mmap failed on fd [0]; rc = [-22] Apr 27 19:28:23 debian mount.ecryptfs: tf_pass_file: Error parsing file for passwd; rc = [-22]
我究竟做错了什么?
你使用的是什么版本的eCryptfs?
我相信我们在ecryptfs-utils-94上发布了一个修正这个bug的方法:
* src/libecryptfs/cmd_ln_parser.c: LP: #683535 - fix passphrase_passwd_fd for pipes - handle memory allocation failures - free memory in error paths
看错误#683535 。
充分披露:我是eCryptfs的作者和维护者之一。