....
 

Guardian Digital Inc. > InfoCenter > Mailing List Archives > Amavis

Amavis Mailing List Archive

From: Mark Martinec (Mark.Martinec+amavis@ijs.si)
Date: Fri Dec 17 2004 - 12:25:06 EST


Martin,

> It's not just Perl. I wrote a test C program to simply rename a file to
> itself which succeeds even without access to the directory. I then looked
> in my kernel sources (2.4.28 from kernel.org) and fs/namei.c contains
> if (old_dentry->d_inode == new_dentry->d_inode) return 0;
> at the top of the vfs_rename_other function, before permission checks i.e.
> it seems that the kernel deliberately allows this.
>
> In fact from the Single Unix Specification
> (http://www.opengroup.org/onlinepubs/007908799/xsh/rename.html):
> If the old argument and the new argument both refer to, and both link to
> the same existing file, rename() returns successfully and performs no other
> action.

Thanks for the research! This explains why Linux is different.
FreeBSD seems to first check the directory protection.

  Mark

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
AMaViS-user mailing list
AMaViS-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/



[ About Guardian Digital ] - [ Press Center ] - [ Contact Us ] - [ System Activation ] - [ Reseller Info ] - [ Online Store ] - [ Site Map ]
Copyright (c) 2000 - 2004 Guardian Digital, Inc. Linux Lockbox and EnGarde are Trademarks of Guardian Digital, Inc.