www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/04/20/17:42:12

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <003601c42720$42f7f680$66fda287@docbill002>
From: "Bill C. Riemers" <cygwin AT docbill DOT net>
To: <cygwin AT cygwin DOT com>
References: <F76C9B2DA2FC4C4CA0A18E288BBCBCF7082177FA AT nihexchange24 DOT nih DOT gov> <00da01c42709$d9daca80$66fda287 AT docbill002> <20040420203516 DOT GB31665 AT cygbert DOT vinschen DOT de>
Subject: Re: Emulating hard links on FAT et al.
Date: Tue, 20 Apr 2004 17:40:49 -0400
MIME-Version: 1.0
X-IsSubscribed: yes

I stand corrected.  Only some flavors of Unix allow hardlinks to carry
separate permissions.  I believe I became confused, because hardlinks
always allow separate path permissions.

i.e.

   mkdir /tmp/fi
   mkdir /tmp/bar
   touch /tmp/fi/foo.txt
   ln /tmp/fi/foo.txt /tmp/bar/foo.txt
   chmod 000 /tmp/fi
   chmod 777 /tmp/bar

Now that I think about it the last time I saw a Unix system that allowed the
actual files to have separate permissions was TitanOS.  And that was a bad
idea, since most users used this feature to cheat the disk quota system.

                                           Bill

----- Original Message ----- 
From: "Corinna Vinschen" <corinna-cygwin AT cygwin DOT com>
To: <cygwin AT cygwin DOT com>
Sent: Tuesday, April 20, 2004 4:35 PM
Subject: Re: Emulating hard links on FAT et al.


> On Apr 20 15:00, Bill C. Riemers wrote:
> > One obvious thing hard links allow is a way to have the same file with
> > different permissions.  With a symbolic link you need both access
> > permissions for the symbolic link and actual file.  i.e.
> >
> >   ln -s /tmp/foo.exe /home/bcr/foo.exe
> >   chmod ugo-x /tmp/foo.exe
> >   chmod ugo+x /home/bcr/foo.exe
> >
> > With a hardlink, you only need access permissions for the hardlink...
>
> That's not how it works.  Hardlinks are nothing but multiple directory
> entries for the same file.  The directory entry typically only consists
> of a name and a inode number.  The inode contains the file specific
> control information.  Obviously hardlinks to the same file point to
> the same inode.  Therefore all hardlinks to the same file have the same
> permissions, owner, etc, since it's *one* file with *one* owner and *one*
> set of permissions.  And, yes, it's implemented on NTFS like this.
>
>
> Corinna
>
> -- 
> Corinna Vinschen                  Please, send mails regarding Cygwin to
> Cygwin Co-Project Leader          mailto:cygwin AT cygwin DOT com
> Red Hat, Inc.
>
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Problem reports:       http://cygwin.com/problems.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
>



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019