gocryptfs
gocryptfs copied to clipboard
`ctlsock: bind: address already in use` after interrupted password input
Current behaviour
When mounting with -ctlsock
option is interrupted via SIGINT (CTRL+C), ctlsock is created but not removed, which leads to bind: address already in use
error on the next try.
> gocryptfs -ctlsock /run/user/$(id -u)/gocryptfs-lm.sock ~/cloud/lm ~/ws/lm
Password: ^C
> gocryptfs -ctlsock /run/user/$(id -u)/gocryptfs-lm.sock ~/cloud/lm ~/ws/lm
ctlsock: listen unix /run/user/1000/gocryptfs-lm.sock: bind: address already in use
I sometimes get this because I have a habit of interrupting the password input on a typo. For me, it is easier to retype the whole thing.
Expected behaviour
Interrupting password input should not affect the next try.
> gocryptfs -ctlsock /run/user/$(id -u)/gocryptfs-lm.sock ~/cloud/lm ~/ws/lm
Password: ^C
> gocryptfs -ctlsock /run/user/$(id -u)/gocryptfs-lm.sock ~/cloud/lm ~/ws/lm
Password:
Decrypting master key
Filesystem mounted and ready.
Possible solution
Remove ctlsock
if password input was interrupted.
Version
gocryptfs v2.4.0; go-fuse [vendored]; 2023-06-15 go1.20.5 linux/amd64