Skip to content
This repository has been archived by the owner on Dec 3, 2020. It is now read-only.

startReaper tries to open log file in /usr/lib #17

Open
bwinkler opened this issue Jul 31, 2017 · 1 comment
Open

startReaper tries to open log file in /usr/lib #17

bwinkler opened this issue Jul 31, 2017 · 1 comment

Comments

@bwinkler
Copy link

When trying to use the password caching feature, keepass-dmenu seems to be trying to open a log file at
/usr/lib/node_modules/keepass-dmenu/child.log resulting in the following error:

Error: EACCES: permission denied, open '/usr/lib/node_modules/keepass-dmenu/child.log'
    at Object.fs.openSync (fs.js:584:18)
    at startReaper (/usr/lib/node_modules/keepass-dmenu/lib/startReaper.js:6:18)
    at fn (/usr/lib/node_modules/keepass-dmenu/node_modules/async/lib/async.js:641:34)
    at Immediate.<anonymous> (/usr/lib/node_modules/keepass-dmenu/node_modules/async/lib/async.js:557:34)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
    at processImmediate [as _immediateCallback] (timers.js:617:5)

Making this file writable gets rid of the error, but the log definitely shouldn't be in /usr. I'm also unsure of the purpose of the log. Can't you just send the output of the child process to STDERR?

I'm on Arch linux, if that matters.

@gustavnikolaj
Copy link
Owner

Thanks for the report @bwinkler!

It's been a few years since I used this myself, so I honestly don't remember.

Looking in reaper.js it seems that it's just debug information of the reaping process. I'm not sure that it's actually that useful.

The reason it's not just going out on stderr is that the reaper process is started as a detached process. When configured to do so, the application will leave a cached version of the password-derived key to the database, to allow the user to not write the password every time they open the password dmenu prompt - at least if they do it in quick succession. keepass-dmenu is not a daemon, so starting the detached reaper process is a way to make sure that we will eventually clean up the cached credential. And the detached process cannot meaningfully use stdout/stderr for debug information.

As I am no longer using this piece of software myself, I am hesitant to change it, as I don't have a system to verify my changes on. But I'll try to get a linux machine up and running, so I can fix the few issues there is with it, but it might take me a few days to get around to it :-)

I'm happy to see that there is still people using it though :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants