[Zope-Coders] Re: [Zope-dev] Speaking of 2.6...
Shane Hathaway
shane@zope.com
Wed, 10 Apr 2002 13:17:35 -0400
Mario Valente wrote:
> Hard links in Unix can be renamed. They rename the original object.
What do you mean? Renaming a hard link does not rename the original file.
[shane@shane tmp]$ ls -l
total 11608
-rw-r--r-- 1 shane shane 11886453 Apr 8 12:11 procmail-log
[shane@shane tmp]$ ln procmail-log procmail-log2
[shane@shane tmp]$ ls -l
total 23216
-rw-r--r-- 2 shane shane 11886453 Apr 8 12:11 procmail-log
-rw-r--r-- 2 shane shane 11886453 Apr 8 12:11 procmail-log2
[shane@shane tmp]$ mv procmail-log2 procmail-log3
[shane@shane tmp]$ ls -l
total 23216
-rw-r--r-- 2 shane shane 11886453 Apr 8 12:11 procmail-log
-rw-r--r-- 2 shane shane 11886453 Apr 8 12:11 procmail-log3
[shane@shane tmp]$
What's even more interesting is that changing the file mode *does*
propagate:
[shane@shane tmp]$ chmod a-w procmail-log
[shane@shane tmp]$ ls -l
total 23216
-r--r--r-- 2 shane shane 11886453 Apr 8 12:11 procmail-log
-r--r--r-- 2 shane shane 11886453 Apr 8 12:11 procmail-log3
[shane@shane tmp]$
> Actually, if you look at the code, what Zope does right now is that an
> object on the Zope tree is a hard link to an object on the ZODB. Zope just
> doesnt allow multiple references to the object in the ZODB thus prohibiting
> more than one hard link :-)
ZMI prohibits multiple references for a good reason. I wrote the
Symlink product a couple of years ago, and a few people tried it, but
the ID problem was just too significant. I tried changing attribute
names without changing IDs, and it worked, but broke the ZMI. I looked
at different ways of resolving this, but the dual ID storage runs deep.
I thought about modifying acquisition to solve it, but at that point,
I wasn't willing to work that hard. :-)
If you have a solid way to solve this issue and the security issues,
links in Zope will be great. But you can't ignore these issues. In
Zope 3 we're avoiding storing IDs in two places, and that will make a
big difference.
Shane