manjari1
asked on
Is it possible to know the user label permission for a particular file at server side?
Hi,
I need to execute a script at the rmid server. And I want the server to be strict enough to check the user label permission for client before executing that script. One possiblity is that server can do some thing like 'ls -l' to get the file permission and split it to collect the group id. Then check whether the client is a member of that group. This is not a cleaner way and is also OS specific. Can anyone please suggest me any other approach for this problem?
Thanks,
Manjari
I need to execute a script at the rmid server. And I want the server to be strict enough to check the user label permission for client before executing that script. One possiblity is that server can do some thing like 'ls -l' to get the file permission and split it to collect the group id. Then check whether the client is a member of that group. This is not a cleaner way and is also OS specific. Can anyone please suggest me any other approach for this problem?
Thanks,
Manjari
ASKER
I want to implement it in java. By default the rmid server is assigned "All permissionPolicy". Changing the policy file and specifying the valid user lists for each script doesn't sound good. So I want to handle it while executing the command.
Thanks,
Manjari.
Thanks,
Manjari.
Easiest to let the OS to handle it by running the script as whatever user is making the calling using sudo or something similiar.
ASKER
Thank you for your responses.
Here the server is going to execute the script on behalf of the client. Definitely the server is having permission to execute any script. The client will just send a command to server( which might be running on some other location) for execution of a script and the client doesn't need to sudo as a particular group user. The server has the information about it's client. But it just needs to be smart enough to retrieve the user permission from a file.
I don't know whether it's possible to extract whether the user has execution permission on a script through java. Any pointers on what to do regarding this.
Thanks,
Manjari.
Here the server is going to execute the script on behalf of the client. Definitely the server is having permission to execute any script. The client will just send a command to server( which might be running on some other location) for execution of a script and the client doesn't need to sudo as a particular group user. The server has the information about it's client. But it just needs to be smart enough to retrieve the user permission from a file.
I don't know whether it's possible to extract whether the user has execution permission on a script through java. Any pointers on what to do regarding this.
Thanks,
Manjari.
realised all that, thats why I was suggesting using an OS utility to run the script as the correct user. That would require knowing there password of course.
Otherwise you're probably stuck with using Runtime.exec() to determine the permissions and handling it yourself. Pretty yucky solution really.
Otherwise you're probably stuck with using Runtime.exec() to determine the permissions and handling it yourself. Pretty yucky solution really.
ASKER
Could you please elaborate a little how to use OS utility in this front?
Thanks,
Manjari
Thanks,
Manjari
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What makes you think it won't do that automatically?