Understood.
>> So the file will have the
>> permissions of the group where the file actually resides, right?
What I typed there isn't what I meant; I'm not sure why the word "group"
got into that sentence at all, definitely some kind of brain-fart. I
meant that the file itself, the inode that points to the file data,
defines its ownership and permissions. If its creation was constrained
by the directory where it was originally created, then it would either
have the permissions allowed within that directory, or its attempted
creation would have failed.
> In those terms, the file "actually resides" in two different directories.
I'd quibble with that, pointing out that the inode "owning" the file
itself, is only in... well I suppose "in" only relates to whatever
hardlinks point to it. That inode is only at one place, no matter how
many links point to it.
> Each with it's own permission structure. In reality, the file doesn't
> reside in /either/ directory; only a pointer to the file exists in each
> directory, not the file or it's metadata.
>
> So, no, the file will *not* have the permissions of the group where the
> file "actually resides".
I think we have the same understanding on that.
>> I
>> don't see that as an issue; maybe it is, that's why we test things, not
>> only to verify that they work, but to verify that they do what we want
>> them to do.
>>
>>> Should the act of hardlinking /change/ the file permission bits to match
>>> the target directory's permission bits? And, if so, then how should the
>>> conflict between the permission bits set wrt the original directory vs
>>> the permission bits set wrt the new directory be handled?
>>
>> I don't see why a hardlink should change the file, it doesn't do that
>> now does it?
>
> No, but you are suggesting (by implication) that it should.
The implication exists but I'm not sure it's me who's implying it.
> Consider, you create a directory that enforces specific permission settings
> on it's files, including group ownership. You then hardlink the
> file /etc/passwd into your directory.
What makes you think you should be able to hardlink /etc/passwd into any
given directory? Because that's the way it's always been done on linux,
because it was the way it was always done on Unix? Why is it that
symlinks have no permissions explicitly associated with them [1],
because that's how it's always been done on linux because it's how it
always worked on Unix? Frankly I'm not at all impressed with the way
either type of link works, each has its uses but each also has
drawbacks; it feels like there ought to be a better solution.
> Now, what permissions and ownership should /etc/passwd have? Remember, the
> names may reside in different directories, but the /file/ hasn't changed.
I don't have an answer for that just now.
I'm not even sure that what I end up will be recognizable as "linux".
There are a lot of things people believe about "linux". A lot of people
see it as a system where many users are logged on simultaneously via ssh
or whatever. And that's a valid traditional view, as far as I can tell.
On the other hand, I'm looking at something a bit different. A system
that has a thin-client interface to what people usually think of as
"linux", assuming that's what the thin-client part is connected to...
think of it as a divided linux where one part is pure server and the
other part is thin-client, the thin-client part is turing-complete in
terms of backup, restore, and installation; the pure server part might
be set up as a pure server, or not even configured in at all.
It isn't as though linux as it is today is the best we can ever have;
it's great, it's solid, but it isn't perfect. Lots of the things that
hold it back came over from Unix after the boyz ginned it up in their
spare time. Unix started out ad-hoc, and linux inherited most of that,
and then added its own ad-hoc-ness on top of it. And of course most
everybody has a personal profit motive in it, RedHat, Canonical,
whoever, they're all looking to get rich and retire off linux, and you
don't do that by making lots of basic changes. Well I'm already retired
and all I'm looking to do is put together something maybe a little
different, something to serve as a base for the other stuff that I'd
like to build.
I'm not going to make any friends by listing all the things I see as
"wrong" with linux, and the administrator crowd that believes the
core-commands and their funky option-set were chiseled onto stone
tablets by gods aren't going to convince me that linux is perfect. I've
been around too long to become a linux religious convert, but it seems
like a good solid base to make something out of.