Code Monkey home page Code Monkey logo

Comments (13)

tartley avatar tartley commented on August 15, 2024 4

FYI I'm asking snapstore if we can change our snap to 'classic', which should fix this: https://forum.snapcraft.io/t/classic-confinement-request-for-universal-ctags/14687

It seems to take a few days for manual review of security-related requests like this, so I'm not sure whether it'll happen before people disappear for Christmas, etc.

from ctags-snap.

endoped avatar endoped commented on August 15, 2024 2

Not entirely sure if this is related, but I get a similar error when trying to create a tags file on an external HD

ctags -R src/

produces

ctags: cannot open tag file : Permission denied

This is the external drive I'm trying this on:

   *-volume:3
                description: Windows NTFS volume
                vendor: Windows
                physical id: 4
                bus info: scsi@0:0.0.0,4
                logical name: /dev/sda4
                version: 3.1
                serial: aee2-38fc
                size: 965MiB
                capacity: 979MiB
                capabilities: boot precious readonly hidden nomount ntfs initialized
                configuration: clustersize=4096 created=2019-05-14 23:37:20 filesystem=ntfs label=Windows RE tools modified_by_chkdsk=true mounted_on_nt4=true name=Basic data partition resize_log_file=true state=dirty upgrade_on_mount=true

from ctags-snap.

tartley avatar tartley commented on August 15, 2024 2

@en0ped Thanks for the details. Yep, it looks like this is another symptom of the same underlying problem. Namely that snaps cannot, by default, access any files. The current snap has enabled access to the user's home directory, but we cannot use that mechanism to enable access to the whole filesystem.

It looks to me that to fix all this, I'm going to have to declare the snap as "classic mode", which requires manual approval by the snap store.

from ctags-snap.

tartley avatar tartley commented on August 15, 2024

If we need to release in classic mode, this is the request process:
https://forum.snapcraft.io/t/process-for-reviewing-classic-confinement-snaps/1460

from ctags-snap.

tartley avatar tartley commented on August 15, 2024

When this is fixed, maybe add a comment to these, so that interested people hear about it:
universal-ctags/ctags#2017
#5

from ctags-snap.

tartley avatar tartley commented on August 15, 2024

From man universal-ctags (installed using the apt), these are the things I spotted that snaps might not have access to:

FILES

  • $HOME/.ctags.d/*.ctags
  • .ctags.d/*.ctags
  • ctags.d/*.ctags

Experiments confirm that apt universal-ctags does read these, while our snap does not.

ENV VARS

  • CTAGS (contains options? Do snaps see env vars? Try it out.)

OPTIONS

That result in file system access in addition to scanning source files:

-f tagfile
-o tagfile
-L file # containing file names to scan
--options=pathname # contains additional command line options
# searches ["$d/$pathname" for d in $optlib], then "$pathname"

(see ctags-optlib to figure what optlib means)

from ctags-snap.

tartley avatar tartley commented on August 15, 2024

Asking whether the personal-files interface could allow access to config files using wildcards: https://forum.snapcraft.io/t/the-personal-files-interface/9357/8?u=tartley

from ctags-snap.

tartley avatar tartley commented on August 15, 2024

FWIW, I've confirmed that building the snap using 'classic' confinement allows ctags to read all hidden config files, but I haven't yet released this, as it requires manual review by the store, and I want to investigate all other options before committing to it.

from ctags-snap.

tartley avatar tartley commented on August 15, 2024

Trying my best to use 'personal-files' interface, but failing: Here I bleat for help in the snapcraft forums: https://forum.snapcraft.io/t/help-needed-using-personal-files-interface/14031

from ctags-snap.

tartley avatar tartley commented on August 15, 2024

The snap's latest revision (13) uses the 'personal-files' interface to allow access to ~/.ctags.d. For now the user must manually grant permission with a 'snap connect' command shown in the snap description. The store has granted my request for them to make that connection automatically when users install the snap, which will happen imminently.

This does not allow access to arbitrary directories like the one @peara specified using '--options'. I think I've taken the 'personal-files' solution as far as I can take it, and will now have to request classic mode to fix their problem.

from ctags-snap.

tartley avatar tartley commented on August 15, 2024

It should be noted that @peara's problem could be worked around by renaming the directory containing the config files to either:

  • not be a hidden directory (ie not start with a dot), or
  • not be a top-level directory (eg ~/config/.vim should work.)

I appreciate this is not always feasible. Just broadcasting what I know.

from ctags-snap.

tartley avatar tartley commented on August 15, 2024

@en0ped Hey there. Where does your external hard drive get mounted? i.e. What's the full absolute path of your 'src' directory? Thanks.

from ctags-snap.

tartley avatar tartley commented on August 15, 2024

Old news now, but FYI the above request for a change to 'classic' was denied, so a generic fix for all the above issues is not going to happen. I'll review, apply any fixes we can for individual cases (e.g. granting access to /tmp), make sure the situation is documented properly.

from ctags-snap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.