From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10952f,8bebd5e0e8e16277 X-Google-Attributes: gid10952f,public X-Google-Thread: f72b0,8bebd5e0e8e16277 X-Google-Attributes: gidf72b0,public X-Google-Thread: f678f,8bebd5e0e8e16277 X-Google-Attributes: gidf678f,public From: "Christopher J. Mattern" Subject: Re: Performing hard links to directories Date: 1999/02/25 Message-ID: #1/1 X-Deja-AN: 448302943 References: <36d438f7.12866181@news.unilim.fr> X-Trace: fozzy.nit.gwu.edu 919950733 128.164.127.252 (Thu, 25 Feb 1999 08:52:13 EDT) Organization: The George Washington University User-Agent: tin/pre-1.4-980818 ("Laura") (UNIX) (SunOS/5.6 (sun4u)) NNTP-Posting-Date: Thu, 25 Feb 1999 08:52:13 EDT Newsgroups: comp.unix.misc,comp.unix.osf.misc,comp.security.unix In comp.security.unix void wrote: > On Wed, 24 Feb 1999 18:01:47 GMT, Olivier ROBERT > wrote: >>Is it possible to create a hard link to a directory? > Generally, only root is allowed to create hard links to directories, > because with hard links to directories one can potentially make a loop > that unix is not designed to detect. > Do it as root and do it carefully and you'll be fine. NO. You haven't read his post all the way through. He wants to hard link because he wants to create two sets of permissions for the directory. THIS WILL NOT WORK. Permissions are stored in the i-node, not the directory entry. Both hard links will always have the same permissions, and he can't change that. Therefore, DON'T DO IT. It's dangerous and it won't do what the original poster wants it to do. As a general rule, you rarely need to hard link anything and you *never* need to hard link directories. Use symbolic links instead--which won't do what the original poster needs, but then neither would the hard link. Look into ACLs (Access Control Lists). They are designed to accomplish exactly what original poster wants to do and are supported on many unixen these days. Chris Mattern