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

pipes not working correctly (missing permissions?) #25

Open
rorojasq opened this issue May 7, 2023 · 4 comments
Open

pipes not working correctly (missing permissions?) #25

rorojasq opened this issue May 7, 2023 · 4 comments

Comments

@rorojasq
Copy link

rorojasq commented May 7, 2023

Output from snap programs executed with the commands :! and :r ! is empty.
Possibly because of this, LSP servers using nodejs will not work with the nodejs snap.
Using io.popen to read a snap program output returns the expected result.

@hurricanehrndz
Copy link
Contributor

PR are welcomed. I don't use the snap so can't troubleshoot.

@mrcrgl
Copy link

mrcrgl commented Jan 5, 2024

I have a similar problem. After switching to ubuntu/snap some installation routines are not working due to missing permissions to private-files.

If you, @rorojasq, are not already working on a solution, I`d try to.

Mason error:

  Failed
    ◍ css-lsp
      ▼ Displaying full log
        Initialized npm root.
        Installing npm package [email protected]…
        spawn: npm failed with exit code 243 and signal 0. 

AppArmor debug:

marc@monkey:/etc/apparmor.d$ sudo snappy-debug
INFO: Following '/var/log/syslog'. If have dropped messages, use:
INFO: $ sudo journalctl --output=short --follow --all | sudo snappy-debug
kernel.printk_ratelimit = 0
= AppArmor =
Time: 2024-01-05T14:4
Log: apparmor="DENIED" operation="file_inherit" class="net" profile="/snap/snapd/20671/usr/lib/snapd/snap-confine" pid=1108244 comm="snap-confine" family="unix" sock_type="stream" protocol=0 requested_mask="send receive" denied_mask="send receive" addr=none peer_addr=none

= AppArmor =
Time: 2024-01-05T14:4
Log: apparmor="DENIED" operation="file_inherit" class="net" profile="/snap/snapd/20671/usr/lib/snapd/snap-confine" pid=1108269 comm="snap-confine" family="unix" sock_type="stream" protocol=0 requested_mask="send receive" denied_mask="send receive" addr=none peer_addr=none

= AppArmor =
Time: 2024-01-05T14:4
Log: apparmor="DENIED" operation="file_inherit" class="file" profile="/snap/snapd/20671/usr/lib/snapd/snap-confine" name="/apparmor/.null" pid=1108244 comm="snap-confine" requested_mask="wr" denied_mask="wr" fsuid=0 ouid=0
File: /apparmor/.null (write)
Suggestion:
* adjust program to write to $SNAP_DATA, $SNAP_COMMON, $SNAP_USER_DATA or $SNAP_USER_COMMON

= AppArmor =
Time: 2024-01-05T14:4
Log: apparmor="DENIED" operation="file_inherit" class="file" profile="snap.curl.curl" name="/apparmor/.null" pid=1108269 comm="snap-exec" requested_mask="wr" denied_mask="wr" fsuid=1000 ouid=0
File: /apparmor/.null (write)
Suggestion:
* adjust program to write to $SNAP_DATA, $SNAP_COMMON, $SNAP_USER_DATA or $SNAP_USER_COMMON

= AppArmor =
Time: 2024-01-05T14:4
Log: apparmor="DENIED" operation="file_inherit" class="net" profile="/snap/snapd/20671/usr/lib/snapd/snap-confine" pid=1108332 comm="snap-confine" family="unix" sock_type="stream" protocol=0 requested_mask="send receive" denied_mask="send receive" addr=none peer_addr=none

= AppArmor =
Time: 2024-01-05T14:4
Log: apparmor="DENIED" operation="file_inherit" class="file" profile="/snap/snapd/20671/usr/lib/snapd/snap-confine" name="/apparmor/.null" pid=1108332 comm="snap-confine" requested_mask="wr" denied_mask="wr" fsuid=0 ouid=0
File: /apparmor/.null (write)
Suggestion:
* adjust program to write to $SNAP_DATA, $SNAP_COMMON, $SNAP_USER_DATA or $SNAP_USER_COMMON

= AppArmor =
Time: 2024-01-05T14:4
Log: apparmor="DENIED" operation="file_inherit" class="net" profile="/snap/snapd/20671/usr/lib/snapd/snap-confine" pid=1108390 comm="snap-confine" family="unix" sock_type="stream" protocol=0 requested_mask="send receive" denied_mask="send receive" addr=none peer_addr=none

= AppArmor =
Time: 2024-01-05T14:4
Log: apparmor="DENIED" operation="file_inherit" class="file" profile="snap.curl.curl" name="/apparmor/.null" pid=1108390 comm="snap-exec" requested_mask="wr" denied_mask="wr" fsuid=1000 ouid=0
File: /apparmor/.null (write)
Suggestion:
* adjust program to write to $SNAP_DATA, $SNAP_COMMON, $SNAP_USER_DATA or $SNAP_USER_COMMON

= AppArmor =
Time: 2024-01-05T14:4
Log: apparmor="DENIED" operation="file_inherit" class="net" profile="/snap/snapd/20671/usr/lib/snapd/snap-confine" pid=1108424 comm="snap-confine" family="unix" sock_type="stream" protocol=0 requested_mask="send receive" denied_mask="send receive" addr=none peer_addr=none

= AppArmor =
Time: 2024-01-05T14:4
Log: apparmor="DENIED" operation="file_inherit" class="file" profile="/snap/snapd/20671/usr/lib/snapd/snap-confine" name="/apparmor/.null" pid=1108424 comm="snap-confine" requested_mask="wr" denied_mask="wr" fsuid=0 ouid=0
File: /apparmor/.null (write)
Suggestion:
* adjust program to write to $SNAP_DATA, $SNAP_COMMON, $SNAP_USER_DATA or $SNAP_USER_COMMON

= AppArmor =
Time: 2024-01-05T14:4
Log: apparmor="DENIED" operation="mknod" class="file" profile="snap.curl.curl" name="/home/marc/.local/share/nvim/mason/registries/github/mason-org/mason-registry/registry.json.zip" pid=1108390 comm="curl" requested_mask="c" denied_mask="c" fsuid=1000 ouid=1000
File: /home/marc/.local/share/nvim/mason/registries/github/mason-org/mason-registry/registry.json.zip (write)
Suggestions:
* adjust program to write to $SNAP_DATA, $SNAP_COMMON, $SNAP_USER_DATA or $SNAP_USER_COMMON
* add 'personal-files (see https://forum.snapcraft.io/t/the-personal-files-interface for acceptance criteria)' to 'plugs'

= AppArmor =
Time: 2024-01-05T14:4
Log: apparmor="DENIED" operation="file_inherit" class="net" profile="/snap/snapd/20671/usr/lib/snapd/snap-confine" pid=1108484 comm="snap-confine" family="unix" sock_type="stream" protocol=0 requested_mask="send receive" denied_mask="send receive" addr=none peer_addr=none

= AppArmor =
Time: 2024-01-05T14:4
Log: apparmor="DENIED" operation="file_inherit" class="file" profile="snap.curl.curl" name="/apparmor/.null" pid=1108484 comm="snap-exec" requested_mask="wr" denied_mask="wr" fsuid=1000 ouid=0
File: /apparmor/.null (write)
Suggestion:
* adjust program to write to $SNAP_DATA, $SNAP_COMMON, $SNAP_USER_DATA or $SNAP_USER_COMMON

@rorojasq
Copy link
Author

rorojasq commented Jan 5, 2024

@mrcrgl If you can fix it, please do so!
I tried to work on it but couldn't get lxd to work.

@justinmk justinmk changed the title Pipes not working correctly for snap programs pipes not working correctly (missing permissions?) Oct 3, 2024
@justinmk
Copy link
Member

justinmk commented Oct 3, 2024

Is there a permissions change needed in the snapcraft.yaml? Can someone send an update to https://github.com/neovim/neovim-snap/blob/master/snap/snapcraft.yaml

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