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

Attempting to write to usr/lib when launched for non-sudo user. #189

Open
Weaselgrease opened this issue Nov 21, 2018 · 2 comments
Open

Comments

@Weaselgrease
Copy link

Program launched for local user in their home directory after installing there, but fails to save because it's saving to the /usr/lib/ directory. There's no reason to elevate to root privileges for a script like this. Over-all it sounds like a pretty easy fix.

[weasel@ArchGrease ~]$ mkdir .node && cd .node
[weasel@ArchGrease .node]$ npm install fb-messenger-cli

> puppeteer@1.10.0 install /home/weasel/.node/node_modules/puppeteer
> node install.js

npm WARN saveError ENOENT: no such file or directory, open '/home/weasel/.node/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/home/weasel/.node/package.json'
npm WARN .node No description
npm WARN .node No repository field.
npm WARN .node No README data
npm WARN .node No license field.

+ fb-messenger-cli@2.1.1
added 143 packages from 185 contributors and audited 254 packages in 4.708s
found 0 vulnerabilities
[weasel@ArchGrease lib]$ fb-messenger-cli
Login verification failed: Warning: Settings not found, saving default values
Facebook credentials:
Email: 
Password:
Attempting login...
Fetching login cookie
Login verification failed: No saved profile, please login
Facebook credentials:
Email:
Password:
Attempting login...
Fetching login cookie
Error saving .settings file: Error: EACCES: permission denied, open '/usr/lib/node_modules/fb-messenger-cli/.settings'
Thanks for using fb-messenger-cli
Bye!
[weasel@ArchGrease lib]$
@aearil
Copy link

aearil commented Jun 2, 2019

Agreed, to store things like .settings the program should use $XDG_CONFIG_HOME when launched by a normal user.

aearil added a commit to aearil/fb-messenger-cli that referenced this issue Jun 2, 2019
This change makes it so .settings and .kryptonite are now saved under
$XDG_CONFIG_HOME/fb-messenger-cli or $HOME/.config/fb-messenger-cli if
XDG_CONFIG_HOME isn't set. This allows to use the program without root
access even when the program is installed system wide.
aearil added a commit to aearil/fb-messenger-cli that referenced this issue Jun 2, 2019
This change makes it so .settings and .kryptonite are now saved under
$XDG_CONFIG_HOME/fb-messenger-cli or $HOME/.config/fb-messenger-cli if
XDG_CONFIG_HOME isn't set. This allows to use the program without root
access even when the program is installed system wide.
@reece146
Copy link

Has there been a regression on this? I am trying to run as a non-root user and this issue is still occurring. The app is ignoring XDG_CONFIG_HOME.

Error saving .settings file: Error: EACCES: permission denied, open '/usr/local/lib/node_modules/fb-messenger-cli/.settings'

fb-messenger-cli cloned today (2.1.1), nodejs-8.10, npm-3.5.2, elementary Linux 5.1.2 (Ubuntu 18.04.4 LTS)

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

3 participants