Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Space characters in bind-hooks #433

Closed
zhogano opened this issue Feb 13, 2022 · 7 comments
Closed

Space characters in bind-hooks #433

zhogano opened this issue Feb 13, 2022 · 7 comments

Comments

@zhogano
Copy link

zhogano commented Feb 13, 2022

How can I implement bind-hooks if there is a space character in the path relative to $HOME? I enclosed the path names with "" but it did not work. Then I tried using symlink. Tomb opened without problem, but I was unable to close it with tomb close and tomb slam. I am using Tomb 2.9.0. I can not remove the space character from the folder name, because it was created by a software and it won't work if I change it.

jaromil added a commit that referenced this issue Feb 14, 2022
this may fix whitespace issues referred by #433 and previously related
to bind mounts as of #222
jaromil added a commit that referenced this issue Feb 20, 2022
this may fix whitespace issues referred by #433 and previously related
to bind mounts as of #222
jaromil added a commit that referenced this issue Feb 20, 2022
this may fix whitespace issues referred by #433 and previously related
to bind mounts as of #222
@jaromil
Copy link
Member

jaromil commented Feb 25, 2022

Hi! can you please confirm this issue is solved using latest version from git?

@zhogano
Copy link
Author

zhogano commented Mar 7, 2022

Hi @jaromil. It did not work for me. I downloaded the latest version from git, installed it using sudo make install. Made sure the file "tomb" changed in /usr/local/bin/.
Let's say this is the path /home/user/.config/Example Folder which I want to bind-hook to media/ExampleFolder in tomb.

  1. First I tried without symlink. But it could not bind-hook:
    bind-hooks:
    media/ExampleFolder ".config/Example Folder"

Output:
tomb . Commanded to open tomb .doc/secret.tomb
tomb . Valid tomb file found: .doc/secret.tomb
tomb . Key is an image, it might be valid.
tomb . Mountpoint not specified, using default: /run/media/user/secret
tomb (*) Opening secret on /run/media/user/secret
tomb . This tomb is a valid LUKS encrypted device.
tomb . Cipher is "twofish" mode "xts-plain64" hash "sha512"
tomb . A password is required to use key .....
tomb [W] Attempting key recovery.
tomb . Password OK.
DM-UUID for device tomb.secret.d52da4cfad13566f9c357890434340a54752285bd92d14589740aedc17671561.loop14 was truncated.
tomb (*) Success unlocking tomb secret
tomb . Filesystem detected: ext4
tomb . Checking filesystem via /dev/loop14
fsck from util-linux 2.37.4
secret: clean, 24238/3399680 files, 10277943/13567488 blocks
tomb (*) Success opening secret.tomb on /run/media/user/secret
tomb . Last visit by user(1000) from /dev/pts/1 on user-pc
tomb . on date Mon 07 Mar 2022 10:36:37 AM +03
tomb [W] bind-hook target not existent, skipping /home/user/".config/Example

  1. Then I tried using symlink. This way the bind-hook worked, but then it was impossible to close the tomb either by tomb close or tomb slam.

I created symlink with
ln -s "/home/user/.config/ExampleFolder/" Example

bind-hooks file:
media/ExampleFolder Example

output:
$ tomb close
tomb . Closing tomb [secret] mounted on /run/media/user/secret
tomb . Closing tomb bind hook: /home/.../...
tomb . Closing tomb bind hook: /home/user/.config/Example Folder
umount: /home/user/.config/Example\x20Folder: no mount point specified.
tomb [E] Tomb bind hook /home/user/.config/Example Folder is busy, cannot close tomb.

Am I doing something wrong?

@zhogano
Copy link
Author

zhogano commented Mar 7, 2022

Hello again. As a workaround, I could make it work for me using symlink and then just before closing the tomb, I enter:
sudo umount "/home/user/.config/Example Folder" or just
sudo umount Example , where "Example" is the symlink as defined in ln -s "/home/user/.config/ExampleFolder/" Example
then,
tomb close

@Narrat
Copy link
Contributor

Narrat commented Mar 7, 2022

Could you run tomb with -D for debug output? Just curious if it breaks in the region of line 2501

@zhogano
Copy link
Author

zhogano commented Mar 8, 2022

Could you run tomb with -D for debug output? Just curious if it breaks in the region of line 2501

I tried it and it does not give any line numbers, and I don't know how to debug a bash script. But you could try this by creating this folder structure "/home/user/.config/Example Folder" and try to bind-hook to "media/ExampleFolder" in tomb.

@Narrat
Copy link
Contributor

Narrat commented Mar 8, 2022

No, it doesn't give line numbers, but in that region are verbose messages which maybe can tell the state of vars.
But will try to setup hooks. Never did that before with tomb, so I need to read about this.

@benjaminbhollon
Copy link

This does seem to be fixed by #500, at least as a workaround; you can now escape spaces in the target directory with a backslash. I just tested it and it seems to work.

@jaromil jaromil closed this as completed Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants