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

Unable to share files/directories in home directory #475

Closed
jkitching opened this issue Nov 24, 2022 · 1 comment
Closed

Unable to share files/directories in home directory #475

jkitching opened this issue Nov 24, 2022 · 1 comment
Labels

Comments

@jkitching
Copy link
Contributor

When attempting to use --share on files or directories in the home directory, they are not shared. With the share target --share=$HOME/.local/share/gnome-shell/extensions, these lines are generated in containerrc:

   165	mkdir -p /home/linolium/.local/share/gnome-shell
   166	ln -s '/home.host/.local/share/gnome-shell/extensions' -T '/home/linolium/.local/share/gnome-shell'

This results in the error:

ln: failed to create symbolic link '/home/linolium/.local/share/gnome-shell': File exists

Based on ln's man page, seems like -T is for specifying the exact name of the symbolic link being created:

SYNOPSIS
       ln [OPTION]... [-T] TARGET LINK_NAME
DESCRIPTION
       In  the  1st form, create a link to TARGET with the name LINK_NAME. 

So I believe the correct command should be one of the following:

ln -s '/home.host/.local/share/gnome-shell/extensions' '/home/linolium/.local/share/gnome-shell'
ln -s '/home.host/.local/share/gnome-shell/extensions' -T '/home/linolium/.local/share/gnome-shell/extensions'

The -T flag was added in 514817f and a2a3a90 to deal with issue #384. Unless I'm missing something, the second commit is incorrect. The line in question should be changed to one of these two options:

                echo "ln -s '$Path' '$(dirname "$Line")'"
                echo "ln -s '$Path' -T '$Line'"

I'd choose the second option, since it is less ambiguous.

In the meantime, a workaround is using --runasuser, e.g.

--runasuser='ln -s /home.host/.local/share/gnome-shell/extensions ~/.local/share/gnome-shell'
jkitching added a commit to jkitching/x11docker that referenced this issue Nov 24, 2022
@mviereck
Copy link
Owner

PR merged, thank you!

@mviereck mviereck added the bug label Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants