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

Funny tool: who is doing what? #67

Open
e-gaulue opened this issue Jan 30, 2020 · 0 comments
Open

Funny tool: who is doing what? #67

e-gaulue opened this issue Jan 30, 2020 · 0 comments

Comments

@e-gaulue
Copy link

Dear all,

I spent a little bit of time on incron, trying to use it as cron. In cron, you can specify a user to execute the command, here you can't, but any user can add incrontab.

So to start with I did system incron. Following the cron logic, I wanted my script to be run by a specific user, so I did: /.../my_file IN_CLOSE_WRITE sudo -u my_user my_bash. This results into every command in bash script executed as my_user, but redirections or pipes in the script belonged to root. But if I just sudo -u my_user my_bash in my shell, everything is alright.

Then I switched to user incron. So: /.../my_file IN_CLOSE_WRITE my_bash set by user my_user. Same results.

So I tried /.../my_file IN_CLOSE_WRITE sudo -u my_user my_bash through user incron set by my user. It's nearly good. But in my script, I've got an unzip command, and now the unzipped file that before belonged to my_user, now belonged to root.

I didn't look into the code, but this sounds magical to me.

Regards,

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

1 participant