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

profiles: ssh: add ${RUNUSER}/gvfsd-sftp #6479

Merged
merged 1 commit into from
Sep 19, 2024
Merged

Conversation

kmk3
Copy link
Collaborator

@kmk3 kmk3 commented Sep 16, 2024

Based on the report by @Saren-Arterius[1]:

Since GNOME gvfs 1.53+, the ssh client options ControlMaster=auto and
ControlPath=/run/user/$UID/gvfsd-sftp/%C are used to mount sftp.

Since /run/user/$UID/gvfsd-sftp is not whitelisted, gvfs sftp mount
with nautilus will fail with a meaningless error message shown in the
UI.

Steps to reproduce[1]:

Prepare ssh server or localhost, then run:

ssh -o"ForwardX11 no" -o"ForwardAgent no" \
    -o"PermitLocalCommand no" -o"ClearAllForwardings yes" \
    -o"NoHostAuthenticationForLocalhost yes" \
    -o"ControlMaster auto" \
    -o"ControlPath=/run/user/${UID}/gvfsd-sftp/test" \
    -s {SSH_HOST} sftp

stderr shows:

unix_listener: cannot bind to path /run/user/$UID/gvfsd-sftp/test.{RANDOM_STRING}: No such file or directory

And ssh exits with error code 255.

Fixes #5816.

[1] #5816 (comment)

Reported-by: @Saren-Arterius
Suggested-by: @Saren-Arterius
Reported-by: @Alex-Farol
Reported-by: @mirko

@kmk3
Copy link
Collaborator Author

kmk3 commented Sep 16, 2024

Any idea if this path is used only by ssh itself or if it could be used by
something like the file picker?

Maybe it would make sense to blacklist this path by default or add it to
whitelist-runuser-common.inc.

Based on the report by @Saren-Arterius[1]:

Since GNOME gvfs 1.53+, the ssh client options `ControlMaster=auto` and
`ControlPath=/run/user/$UID/gvfsd-sftp/%C` are used to mount sftp.

Since `/run/user/$UID/gvfsd-sftp` is not whitelisted, gvfs sftp mount
with nautilus will fail with a meaningless error message shown in the
UI.

Steps to reproduce[1]:

Prepare ssh server or localhost, then run:

    ssh -o"ForwardX11 no" -o"ForwardAgent no" \
        -o"PermitLocalCommand no" -o"ClearAllForwardings yes" \
        -o"NoHostAuthenticationForLocalhost yes" \
        -o"ControlMaster auto" \
        -o"ControlPath=/run/user/${UID}/gvfsd-sftp/test" \
        -s {SSH_HOST} sftp

stderr shows:

    unix_listener: cannot bind to path /run/user/$UID/gvfsd-sftp/test.{RANDOM_STRING}: No such file or directory

And ssh exits with error code 255.

Fixes netblue30#5816.

[1] netblue30#5816 (comment)

Reported-by: @Saren-Arterius
Suggested-by: @Saren-Arterius
Reported-by: @Alex-Farol
Reported-by: @mirko
@kmk3 kmk3 merged commit 271fb1b into netblue30:master Sep 19, 2024
3 checks passed
@kmk3 kmk3 deleted the ssh-allow-gvfsd branch September 19, 2024 10:55
kmk3 added a commit that referenced this pull request Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done (on RELNOTES)
Development

Successfully merging this pull request may close these issues.

ssh: sftp fails in nautilus with GNOME gvfs 1.53+ (ControlMaster, ControlPath)
2 participants