Permissions depending on parameters passed to application

Posted by Engineiro on Ask Ubuntu See other posts from Ask Ubuntu or by Engineiro
Published on 2013-03-26T16:31:11Z Indexed on 2013/10/29 4:17 UTC
Read the original article Hit count: 202

Filed under:
|
|

I have a java app that writes to a very important table I have. This is sudo protected, but this app takes a parameters for where the output should go. The default is the REAL DEAL but the "output" parameter takes priority over the default, so if a user provides a path that they have write permission for, say: /home/username/mystuff then I would like for users to be allowed to write to these directories.

The app is launched in a shell script, so I am wondering if I can check that the string does not equal /path/to/real/deal and not empty (since /path/to/real/deal is the default) and allow users to write to places they have permissions for.

My impression of linux permissions is that it is tied to the application itself and cannot be conditionally approved, but I wonder if there is some bash fu or alternative method I can perform to get me my desired result.

Using Ubuntu 10.04.4 LTS

© Ask Ubuntu or respective owner

Related posts about bash

Related posts about permissions