Re: FILE_DELETE on Mac OS ignores write permissions [message #70390] |
Fri, 09 April 2010 01:06 |
Nigel Wade
Messages: 286 Registered: March 1998
|
Senior Member |
|
|
On Thu, 08 Apr 2010 16:05:02 -0500, Kenneth P. Bowman wrote:
> I discovered a few days ago that in IDL 7.1.1, FILE_DELETE on OS X 10.6
> ignores file permissions and deletes files that have write permission
> turned off.
>
> I create a file named test.txt and turn off write permission. As
> expected, I cannot delete it from the command line without confirming
> that I want to override permissions.
I don't see how it possibly can. If you, the user running IDL, do not
have permission to delete the file then the OS will not allow you to
delete the file regardless of what tool you use to attempt that feat (IDL
included, setuid-root programs excluded).
>
> stretch> touch test.txt
> stretch> chmod u-w test.txt
> stretch> ll test*
> -r--r--r-- 1 bowman bowman 0 Apr 8 15:45 test.txt stretch> rm
> test.txt
> override r--r--r-- bowman/bowman for test.txt? n stretch> ll test*
> -r--r--r-- 1 bowman bowman 0 Apr 8 15:45 test.txt
>
> If I go to IDL and issue this command
>
> IDL> file_delete, 'test.txt', /verbose % FILE_DELETE: Removed file:
> test.txt.
>
> The file is deleted despite the lack of write permission.
>
> stretch> ll test*
> ls: No match.
>
> I have filed a bug report with ITTVIS.
It's perfectly normal behaviour for UNIX-like OS, not a bug in IDL.
You do not need write permission for a file in order to delete it. All
you need is write permission to the directory containing the file. You
can verify it from the command line, it's not IDL doing this.
--
Nigel Wade
|
|
|