GithubHelp home page GithubHelp logo

Comments (6)

stephenplusplus avatar stephenplusplus commented on August 20, 2024

I don't know how helpful of a message can be provided, since each occurrence of the error would be very different from the last. Can we print out the current perms and ownership of the file and then a whoami? Might be able to check if the ownership matches the whoami result, and then know that permissions are the issue. Either way, displaying that to the user could be helpful. On the other hand, it could be dangerous as well, as they might just try chmodding the world 777 and setting wild chowns.

I would think ownership is more the issue than permissions, but that's just a guess. I don't know if a guide would be more helpful than just printing out how to chmod and chown a file, but we won't know what to recommend setting the permissions to. Maybe easiest is just pasting the link to google, prepopulated with a query that matches the error :-S

I'm typing on an iPad and losing my mind with back spacing, so I'm just going to leave on this note, just to throw something out there:

Hmm, permissions error? Do you know anything about this?
/user/blah/blah.txt - user:group - 600

We don't seem to have the permission to access this file. Can you give it to us?

Try chmod 755 /user/blah/blah.txt

from configstore.

passy avatar passy commented on August 20, 2024

On the other hand, it could be dangerous as well, as they might just try chmodding the world 777 and setting wild chowns.

That's a good point. Let's play it safe and include both commands:

We don't seem to have the permission to access this file. Can you give it to us?
Try:
chmod 750 /path/to/blah.txt
chown $USER:$(id -g -n $USER) /path/to/blah.txt

For the user configuration files 750 should be reasonable, right?

from configstore.

sindresorhus avatar sindresorhus commented on August 20, 2024

Hmm, let's search and see if we can find a good guide we can link to. I agree we should be careful about what we tell the user.

$USER:$(id -g -n $USER)

Why not just $USER? What's the second part?

For the user configuration files 750 should be reasonable, right?

Isn't 755 the norm?

from configstore.

passy avatar passy commented on August 20, 2024

Since user configs could contain sensitive data I don't see why it should be readable by others.

The second part of the chown statement sets it to the user's primary group. That could be useful if it was previously owned by root.

from configstore.

sindresorhus avatar sindresorhus commented on August 20, 2024

Since user configs could contain sensitive data I don't see why it should be readable by others.

Then why not 600?

The second part of the chown statement sets it to the user's primary group. That could be useful if it was previously owned by root.

k, cool. can be shortened to $USER:$(id -gn $USER)

from configstore.

passy avatar passy commented on August 20, 2024

Then why not 600?

Agreed. :)

from configstore.

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.