* Performing hard links to directories
@ 1999-02-24 5:00 Olivier ROBERT
1999-02-24 5:00 ` Ron Dilley
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: Olivier ROBERT @ 1999-02-24 5:00 UTC (permalink / raw)
Is it possible to create a hard link to a directory?
I need this because I want to grant access to a user in a directory
which belongs to another user in the same group, but I don't want
everyone in the group to be able to access to that directory.
Performing a hard link to that directory in the first user's home
directory would be a solution...if possible. Can anyone help me?
Thanks!
O.R.
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: Performing hard links to directories
1999-02-24 5:00 Performing hard links to directories Olivier ROBERT
@ 1999-02-24 5:00 ` Ron Dilley
1999-02-26 5:00 ` Olivier ROBERT
1999-02-24 5:00 ` Michael Tosch
` (2 subsequent siblings)
3 siblings, 1 reply; 11+ messages in thread
From: Ron Dilley @ 1999-02-24 5:00 UTC (permalink / raw)
Oliver,
Does your os support acls??
Ron
Olivier ROBERT wrote:
>
> Is it possible to create a hard link to a directory?
> I need this because I want to grant access to a user in a directory
> which belongs to another user in the same group, but I don't want
> everyone in the group to be able to access to that directory.
> Performing a hard link to that directory in the first user's home
> directory would be a solution...if possible. Can anyone help me?
> Thanks!
>
> O.R.
--
+--------------------------------------------------------+
| Ron Dilley Sr. UNIX Network Administrator |
| ron.dilley@ada.com Applied Digital Access |
+--------------------------------------------------------+
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: Performing hard links to directories
1999-02-24 5:00 ` Ron Dilley
@ 1999-02-26 5:00 ` Olivier ROBERT
1999-02-26 5:00 ` Tony Fitzgerald
0 siblings, 1 reply; 11+ messages in thread
From: Olivier ROBERT @ 1999-02-26 5:00 UTC (permalink / raw)
On Wed, 24 Feb 1999 10:23:14 -0800, Ron Dilley <ron.dilley@ada.com>
wrote:
>Does your os support acls??
>
Yes! That's exactly what I was looking for! Thanks!
For those who want to know if their UNIX supports ACLs, type "man
acl", "man setacl", "man getacl" or "man -k acl"
O.R.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Performing hard links to directories
1999-02-26 5:00 ` Olivier ROBERT
@ 1999-02-26 5:00 ` Tony Fitzgerald
0 siblings, 0 replies; 11+ messages in thread
From: Tony Fitzgerald @ 1999-02-26 5:00 UTC (permalink / raw)
In article <36d6b404.2216937@news.unilim.fr>,
Olivier ROBERT <olivierrobert@minitel.net> wrote:
>Yes! That's exactly what I was looking for! Thanks!
>For those who want to know if their UNIX supports ACLs, type "man
>acl", "man setacl", "man getacl" or "man -k acl"
Unless, of course, your Unix is AIX. Commands are aclget, acledit and
aclput.
--
O- J. Anthony Fitzgerald, jaf@UNB.ca, http://www.unb.ca/~jaf -O
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Performing hard links to directories
1999-02-24 5:00 Performing hard links to directories Olivier ROBERT
1999-02-24 5:00 ` Ron Dilley
@ 1999-02-24 5:00 ` Michael Tosch
1999-02-25 5:00 ` void
1999-02-26 5:00 ` Alan J Rosenthal
3 siblings, 0 replies; 11+ messages in thread
From: Michael Tosch @ 1999-02-24 5:00 UTC (permalink / raw)
In article <36d438f7.12866181@news.unilim.fr>, olivierrobert@minitel.net (Olivier ROBERT) writes:
> Is it possible to create a hard link to a directory?
> I need this because I want to grant access to a user in a directory
> which belongs to another user in the same group, but I don't want
> everyone in the group to be able to access to that directory.
> Performing a hard link to that directory in the first user's home
> directory would be a solution...if possible. Can anyone help me?
> Thanks!
>
> O.R.
No, hard links work only with files.
Soft links work, and the effective result is much comparible.
Neither a hard nor a soft link would fulfill your requirement, though.
(Hard-linked files share one inode that holds the permission and ownership,
if you change permission on one link, the other link(s) would change, too.)
A possible approach is: create another group, make both users members of the
group, and do (or have them do) something with newgrp.
Another approach is: give both users the same UID/GID in passwd. The
drawback is, the user that is FIRST in passwd will always appear as owner,
and some applications (e.g. screenlock) might be confused.
--
/// \\\
( ..) (.. )
------------o00-(_)-00o--------o00-(_)-00o-------------------------------
Michael Tosch Ericsson Eurolab Deutschland GmbH
Data Services EED/I 52134 Herzogenrath Kohlscheid
Senior Local System Administrator Germany
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: Performing hard links to directories
1999-02-24 5:00 Performing hard links to directories Olivier ROBERT
1999-02-24 5:00 ` Ron Dilley
1999-02-24 5:00 ` Michael Tosch
@ 1999-02-25 5:00 ` void
1999-02-25 5:00 ` Nick Maclaren
1999-02-25 5:00 ` Christopher J. Mattern
1999-02-26 5:00 ` Alan J Rosenthal
3 siblings, 2 replies; 11+ messages in thread
From: void @ 1999-02-25 5:00 UTC (permalink / raw)
On Wed, 24 Feb 1999 18:01:47 GMT, Olivier ROBERT
<olivierrobert@minitel.net> 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.
--
Ben
"You have your mind on computers, it seems."
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Performing hard links to directories
1999-02-25 5:00 ` void
@ 1999-02-25 5:00 ` Nick Maclaren
1999-02-25 5:00 ` Christopher J. Mattern
1 sibling, 0 replies; 11+ messages in thread
From: Nick Maclaren @ 1999-02-25 5:00 UTC (permalink / raw)
In article <slrn7d9ac2.prl.float@interport.net>,
void <float@interport.net> wrote:
>On Wed, 24 Feb 1999 18:01:47 GMT, Olivier ROBERT
><olivierrobert@minitel.net> 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.
Perhaps. But you had better either check your system out first or
like living dangerously. Some systems don't allow even root to link
to directories and, in others, critical utilities will go bananas.
I can't remember what fsck does.
Remember that a LOT of programs and sometimes even parts of the kernel
(think pathname resolution for "a/../b") assume that a directory has
a single parent, unless it is a mount point.
Regards,
Nick Maclaren,
University of Cambridge Computing Service,
New Museums Site, Pembroke Street, Cambridge CB2 3QG, England.
Email: nmm1@cam.ac.uk
Tel.: +44 1223 334761 Fax: +44 1223 334679
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Performing hard links to directories
1999-02-25 5:00 ` void
1999-02-25 5:00 ` Nick Maclaren
@ 1999-02-25 5:00 ` Christopher J. Mattern
1999-02-26 5:00 ` Olivier ROBERT
1 sibling, 1 reply; 11+ messages in thread
From: Christopher J. Mattern @ 1999-02-25 5:00 UTC (permalink / raw)
In comp.security.unix void <float@interport.net> wrote:
> On Wed, 24 Feb 1999 18:01:47 GMT, Olivier ROBERT
> <olivierrobert@minitel.net> 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
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Performing hard links to directories
1999-02-24 5:00 Performing hard links to directories Olivier ROBERT
` (2 preceding siblings ...)
1999-02-25 5:00 ` void
@ 1999-02-26 5:00 ` Alan J Rosenthal
3 siblings, 0 replies; 11+ messages in thread
From: Alan J Rosenthal @ 1999-02-26 5:00 UTC (permalink / raw)
olivierrobert@minitel.net (Olivier ROBERT) writes:
>Is it possible to create a hard link to a directory?
It's not a good idea anyway because you can put some things like "find" into
infinite loops. The filesystem is supposed to be a tree and some programs
rely on that.
You'll also find that fsck will "fix" it.
>I need this because I want to grant access to a user in a directory
>which belongs to another user in the same group, but I don't want
>everyone in the group to be able to access to that directory.
Then make a new group. Users can be in multiple groups.
Someone suggested giving them the same uid. This is a very bad idea. Giving
two accounts the same uid basically makes them the same account. Group
access is precisely what groups are for.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Performing hard links to directories
@ 1999-02-26 5:00 Tony Langdon
0 siblings, 0 replies; 11+ messages in thread
From: Tony Langdon @ 1999-02-26 5:00 UTC (permalink / raw)
It's 25 Feb 99 21:38:12,
We'll return to float@interport.net and All's
discussion of Performing hard links to directories
fl> Generally, only root is allowed to create hard links to directories,
fl> because with hard links to directories one can potentially make a loop
fl> that unix is not designed to detect.
fl> Do it as root and do it carefully and you'll be fine.
It depends on the OS. The Linux boxes at work will not allow root to
create hard links to directories (been there, tried that).
.. Backup not found: (A)bort (R)etry (S)lap nearest innocent bystander.
--
|Fidonet: Tony Langdon 3:633/284.18
|Internet: tlang@freeway.apana.org.au
|
| Standard disclaimer: The views of this user are strictly his own.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~1999-02-26 5:00 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-02-24 5:00 Performing hard links to directories Olivier ROBERT
1999-02-24 5:00 ` Ron Dilley
1999-02-26 5:00 ` Olivier ROBERT
1999-02-26 5:00 ` Tony Fitzgerald
1999-02-24 5:00 ` Michael Tosch
1999-02-25 5:00 ` void
1999-02-25 5:00 ` Nick Maclaren
1999-02-25 5:00 ` Christopher J. Mattern
1999-02-26 5:00 ` Olivier ROBERT
1999-02-26 5:00 ` Alan J Rosenthal
-- strict thread matches above, loose matches on Subject: below --
1999-02-26 5:00 Tony Langdon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox