|
Re: create file that is readable only [message #73236 is a reply to message #73164] |
Fri, 29 October 2010 09:01  |
Carsten Lechte
Messages: 124 Registered: August 2006
|
Senior Member |
|
|
On 29/10/10 16:08, Truong Le wrote:
> How can I set that using the FILE_CHMODE command in IDL?
I do not think that changing the owner of a file can be done with IDL,
since you need to be a privileged user to do it, and you usually do
not want to be a privileged user while running IDL.
On unix, one might try SPAWN-ing a command line using sudo (like 'sudo
chown newuser file') from the IDL session to temporarily get the
required privileges, but I have not tried it and I am not saying that
it is a good idea.
Depending on your workflows, you might want to do the file-protection
stuff outside of IDL, before you package the data to the "hostile" users.
chl
|
|
|
Re: create file that is readable only [message #73238 is a reply to message #73164] |
Fri, 29 October 2010 08:16  |
penteado
Messages: 866 Registered: February 2018
|
Senior Member Administrator |
|
|
On Oct 29, 12:08 pm, Truong Le <truong...@gmail.com> wrote:
> I have set
>
> FILE_CHMOD, filename, U_WRITE=0, G_WRITE=0,O_WRITE=0
>
> and I thought this should only create a readable file only. However,
> when I gave this file to someone to test it the person was able to
> modify the file without any problem. Any help is appreciated.
What do you mean by "gave"? If that someone is making a copy of the
file, that someone will be the owner of the copy, and thus able to do
anything to it. Only users that do not own a file can be prevented
from altering it. If the file is set without write permission to the
owner, all that means is that applications run by the owner can choose
not to write to it based on the lack of permission, but this is not
enforceable.
|
|
|
Re: create file that is readable only [message #73239 is a reply to message #73164] |
Fri, 29 October 2010 07:08  |
Truong Le
Messages: 42 Registered: September 2010
|
Member |
|
|
On Oct 29, 4:23 am, Carsten Lechte <c...@toppoint.de> wrote:
> On 28/10/10 22:53, Truong Le wrote:
>
>> Is there anyway we can set full restriction such that NO ONE is allow
>> to modify it?
>
> If you want to prevent anyone from restoring write permissions on the
> file and then modifying it, you have to change the owner of the file
> and then give only read permission to other users. As far as I know,
> this owner change can only be done by the super user/system
> administrator. It is how all the system files are protected against
> modification by regular users. If you also want to prevent deletion of
> the file, its containing directory must also be owned by a different user.
>
> chl
How can I set that using the FILE_CHMODE command in IDL?
I have set
FILE_CHMOD, filename, U_WRITE=0, G_WRITE=0,O_WRITE=0
and I thought this should only create a readable file only. However,
when I gave this file to someone to test it the person was able to
modify the file without any problem. Any help is appreciated.
Thanks,
|
|
|