English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

In a Unix environment, is it possible to set the file permissions such that only the process which created the file can delete it or change it, but other processes are given read access to the file? if no how close to this specification can I get?

2007-03-23 03:02:09 · 2 answers · asked by Anonymous in Computers & Internet Programming & Design

2 answers

The answer is yes.
You set the permissions as below for both directories and files.
drwxr--r--
-rwxr--r--
Use the setting
744

See the link for a full explaination.

2007-03-23 03:15:13 · answer #1 · answered by AnalProgrammer 7 · 0 0

Absolutely it's possible... well, actually, it's possible to set a file permission so the owner of the process (ie the process itself plus any other process run by the same account) can read/write/update the file but no-one else can do anything other than read. Except of course 'root' can always do everything.

Set the process mask to 155... files should be created readable by anyone, writable only by the current owner of the process.

Alternatively... in a program create the file then use:
chmod 644

If you make the process owned by a unique user account used for nothing else that won't allow direct logon then you get very close.

To get even closer, put the file in a directory that is set for rwxr-xr-x permissions (= chmod 755 ) and owned by the account that runs the process... that way only the process / anything that account runs / root will be able to create or delete files in the directory.

2007-03-23 10:15:54 · answer #2 · answered by bambamitsdead 6 · 0 0

fedest.com, questions and answers