Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

The nicest thing about the Alto is that it doesn't run faster at night.


devel / comp.unix.programmer / Re: Linux mount: What is the opposite of "nosuid" ?

SubjectAuthor
* Linux mount: What is the opposite of "nosuid" ?Kenny McCormack
`* Re: Linux mount: What is the opposite of "nosuid" ?Lew Pitcher
 `* Re: Linux mount: What is the opposite of "nosuid" ?Kenny McCormack
  `* Re: Linux mount: What is the opposite of "nosuid" ?candycanearter07
   +* Re: Linux mount: What is the opposite of "nosuid" ?Ben Bacarisse
   |`* Re: Linux mount: What is the opposite of "nosuid" ?candycanearter07
   | `* Re: Linux mount: What is the opposite of "nosuid" ?Lawrence D'Oliveiro
   |  `* Re: Linux mount: What is the opposite of "nosuid" ?candycanearter07
   |   `* Re: Linux mount: What is the opposite of "nosuid" ?vallor
   |    `* Re: Linux mount: What is the opposite of "nosuid" ?Lawrence D'Oliveiro
   |     `* Re: Linux mount: What is the opposite of "nosuid" ?Johanne Fairchild
   |      +- Mark Twain story (Was: Linux mount: What is the opposite of "nosuid" ?)Kenny McCormack
   |      +* Re: Linux mount: What is the opposite of "nosuid" ?Muttley
   |      |+- Re: Linux mount: What is the opposite of "nosuid" ?Kaz Kylheku
   |      |+* Hard links (Was: Linux mount: What is the opposite of "nosuid" ?)Kenny McCormack
   |      ||`- Re: Hard links (Was: Linux mount: What is the opposite of "nosuid" ?)Muttley
   |      |`* Re: Linux mount: What is the opposite of "nosuid" ?Johanne Fairchild
   |      | `- Re: Linux mount: What is the opposite of "nosuid" ?Johanne Fairchild
   |      +* Re: Linux mount: What is the opposite of "nosuid" ?Lew Pitcher
   |      |+* Re: Linux mount: What is the opposite of "nosuid" ?Lew Pitcher
   |      ||`* Re: Linux mount: What is the opposite of "nosuid" ?Lawrence D'Oliveiro
   |      || `* Re: Linux mount: What is the opposite of "nosuid" ?Andrew Smallshaw
   |      ||  +* Re: Linux mount: What is the opposite of "nosuid" ?Kaz Kylheku
   |      ||  |+* Taking things too literally (Was: Linux mount: What is the opposite of "nosuid" Kenny McCormack
   |      ||  ||`- Re: Taking things too literally (Was: Linux mount: What is the opposite of "nosuKaz Kylheku
   |      ||  |`- Re: Linux mount: What is the opposite of "nosuid" ?Dan Cross
   |      ||  `- Re: Linux mount: What is the opposite of "nosuid" ?Lawrence D'Oliveiro
   |      |`* Re: Linux mount: What is the opposite of "nosuid" ?Kaz Kylheku
   |      | `- Re: Linux mount: What is the opposite of "nosuid" ?Johanne Fairchild
   |      `* Re: Linux mount: What is the opposite of "nosuid" ?Lawrence D'Oliveiro
   |       `* Re: Linux mount: What is the opposite of "nosuid" ?Richard Kettlewell
   |        `* Re: Linux mount: What is the opposite of "nosuid" ?Lawrence D'Oliveiro
   |         +- Re: Linux mount: What is the opposite of "nosuid" ?Kenny McCormack
   |         `* Re: Linux mount: What is the opposite of "nosuid" ?Richard Kettlewell
   |          `* Re: Linux mount: What is the opposite of "nosuid" ?Lawrence D'Oliveiro
   |           `* Re: Linux mount: What is the opposite of "nosuid" ?Richard Kettlewell
   |            `- Re: Linux mount: What is the opposite of "nosuid" ?Lawrence D'Oliveiro
   `- Re: Linux mount: What is the opposite of "nosuid" ?Kenny McCormack

Pages:12
Linux mount: What is the opposite of "nosuid" ?

<uvuae7$3vtqg$1@news.xmission.com>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=4165&group=comp.unix.programmer#4165

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gazelle@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.unix.programmer
Subject: Linux mount: What is the opposite of "nosuid" ?
Date: Fri, 19 Apr 2024 17:42:31 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <uvuae7$3vtqg$1@news.xmission.com>
Injection-Date: Fri, 19 Apr 2024 17:42:31 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="4192080"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Fri, 19 Apr 2024 17:42 UTC

I have encountered an interesting situation. I have a USB disk drive
auto-mounted (i.e, mounted by the automounter - I didn't explicitly mount it)
and it is mounted with "nosuid" (which is normal). But I would like it to
be mounted with suid working. It seems I should be able to do something
like:

# mount -o remount,suid /dev/sdb1

but that generates err msg "invalid option or not mounted" (*) (as does
every variation of the above that I've tried). I also tried "nonosuid",
but that doesn't work either.

(*) "mount" is notorious for giving "Ken Thompson style" error messages
(i.e., the only error message you'll ever need is "No").

Notes:
1) Googling finds lots of stuff about how (and why) to mount nosuid,
but not the opposite.
2) (Obviously) I'm not interested in any solutions that need a time
machine or involve editing /etc/fstab or that involve un-mounting
it and mounting it over from scratch.

It seems there should be a way with remount. "man mount" talks a fair bit
about using "--bind" as an alternative to "-o remount", but I did not
follow that very well. I've used "-o remount" many times in the past,
successfully.

--
The randomly chosen signature file that would have appeared here is more than 4
lines long. As such, it violates one or more Usenet RFCs. In order to remain
in compliance with said RFCs, the actual sig can be found at the following URL:
http://user.xmission.com/~gazelle/Sigs/Security

Re: Linux mount: What is the opposite of "nosuid" ?

<uvud53$30gsv$1@dont-email.me>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=4166&group=comp.unix.programmer#4166

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: lew.pitcher@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.unix.programmer
Subject: Re: Linux mount: What is the opposite of "nosuid" ?
Date: Fri, 19 Apr 2024 18:28:51 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <uvud53$30gsv$1@dont-email.me>
References: <uvuae7$3vtqg$1@news.xmission.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 19 Apr 2024 20:28:51 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="d322298682f8bdb3be22000751b8a2df";
logging-data="3163039"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ny7DRAgY/sCKiw2PByRXCSYxXT8kuFiw="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:akbhshZm6b7hzjBd7eB7moES6Mw=
 by: Lew Pitcher - Fri, 19 Apr 2024 18:28 UTC

On Fri, 19 Apr 2024 17:42:31 +0000, Kenny McCormack wrote:

> I have encountered an interesting situation. I have a USB disk drive
> auto-mounted (i.e, mounted by the automounter - I didn't explicitly mount it)
> and it is mounted with "nosuid" (which is normal). But I would like it to
> be mounted with suid working. It seems I should be able to do something
> like:
>
> # mount -o remount,suid /dev/sdb1
>
> but that generates err msg "invalid option or not mounted" (*) (as does
> every variation of the above that I've tried).

That's strange. mount(8) explicitly names "suid" as an option, with the
explanation:
suid Allow set-user-identifier or set-group-identifier bits to take
effect.

BUT.... suid (like a number of other options) only applies iff the underlying
filesystem supports set-user-identifier and set-group-identifier bits. Some
filesystems don't (like FAT and NTFS-based filesystems).

Are you trying to mount a non-unix filesystem?

> I also tried "nonosuid",
> but that doesn't work either.
>
> (*) "mount" is notorious for giving "Ken Thompson style" error messages
> (i.e., the only error message you'll ever need is "No").

[snip]

HTH
--
Lew Pitcher
"In Skills We Trust"

Re: Linux mount: What is the opposite of "nosuid" ?

<uvukqn$3p9$1@news.xmission.com>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=4168&group=comp.unix.programmer#4168

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gazelle@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.unix.programmer
Subject: Re: Linux mount: What is the opposite of "nosuid" ?
Date: Fri, 19 Apr 2024 20:39:51 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <uvukqn$3p9$1@news.xmission.com>
References: <uvuae7$3vtqg$1@news.xmission.com> <uvud53$30gsv$1@dont-email.me>
Injection-Date: Fri, 19 Apr 2024 20:39:51 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="3881"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Fri, 19 Apr 2024 20:39 UTC

In article <uvud53$30gsv$1@dont-email.me>,
Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
>On Fri, 19 Apr 2024 17:42:31 +0000, Kenny McCormack wrote:
>
>> I have encountered an interesting situation. I have a USB disk drive
>> auto-mounted (i.e, mounted by the automounter - I didn't explicitly mount it)
>> and it is mounted with "nosuid" (which is normal). But I would like it to
>> be mounted with suid working. It seems I should be able to do something
>> like:
>>
>> # mount -o remount,suid /dev/sdb1
>>
>> but that generates err msg "invalid option or not mounted" (*) (as does
>> every variation of the above that I've tried).
>
>That's strange. mount(8) explicitly names "suid" as an option, with the
>explanation:
> suid Allow set-user-identifier or set-group-identifier bits to take
> effect.

OK - that's my reason for posting. To find out that it "should" work.
That there is an option for it.

Turns out that it works if I use the mount point rather than the device.
I.e.,:

# mount -o remount,suid /path/to/wherever/it/was/mounted

works as expected. Strange, because for as long as I've been using
"mount", it has always been OK to use either the device name or the mount
point (for a mounted device - i.e., once it has been mounted); they are
basically synonymous. But this seems to be an exception.

--
Kenny, I'll ask you to stop using quotes of mine as taglines.

- Rick C Hodgin -

Re: Linux mount: What is the opposite of "nosuid" ?

<uvvcrr$3euft$2@dont-email.me>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=4172&group=comp.unix.programmer#4172

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: candycanearter07@candycanearter07.nomail.afraid (candycanearter07)
Newsgroups: comp.unix.programmer
Subject: Re: Linux mount: What is the opposite of "nosuid" ?
Date: Sat, 20 Apr 2024 03:30:03 -0000 (UTC)
Organization: the-candyden-of-code
Lines: 38
Message-ID: <uvvcrr$3euft$2@dont-email.me>
References: <uvuae7$3vtqg$1@news.xmission.com>
<uvud53$30gsv$1@dont-email.me> <uvukqn$3p9$1@news.xmission.com>
Injection-Date: Sat, 20 Apr 2024 05:30:03 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="a5b29cbb4849e838c0fe3e3d3a940437";
logging-data="3635709"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/6cOLNfyRaWFqyuPGca+ry0j88fH62JewXwXl/SpD4Qg=="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:N+atRmkQBQxnj0y1w4GABj9Ki30=
X-Face: b{dPmN&%4|lEo,wUO\"KLEOu5N_br(N2Yuc5/qcR5i>9-!^e\.Tw9?/m0}/~:UOM:Zf]%
b+ V4R8q|QiU/R8\|G\WpC`-s?=)\fbtNc&=/a3a)r7xbRI]Vl)r<%PTriJ3pGpl_/B6!8pe\btzx
`~R! r3.0#lHRE+^Gro0[cjsban'vZ#j7,?I/tHk{s=TFJ:H?~=]`O*~3ZX`qik`b:.gVIc-[$t/e
ZrQsWJ >|l^I_[pbsIqwoz.WGA]<D
 by: candycanearter07 - Sat, 20 Apr 2024 03:30 UTC

Kenny McCormack <gazelle@shell.xmission.com> wrote at 20:39 this Friday (GMT):
> In article <uvud53$30gsv$1@dont-email.me>,
> Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
>>On Fri, 19 Apr 2024 17:42:31 +0000, Kenny McCormack wrote:
>>
>>> I have encountered an interesting situation. I have a USB disk drive
>>> auto-mounted (i.e, mounted by the automounter - I didn't explicitly mount it)
>>> and it is mounted with "nosuid" (which is normal). But I would like it to
>>> be mounted with suid working. It seems I should be able to do something
>>> like:
>>>
>>> # mount -o remount,suid /dev/sdb1
>>>
>>> but that generates err msg "invalid option or not mounted" (*) (as does
>>> every variation of the above that I've tried).
>>
>>That's strange. mount(8) explicitly names "suid" as an option, with the
>>explanation:
>> suid Allow set-user-identifier or set-group-identifier bits to take
>> effect.
>
> OK - that's my reason for posting. To find out that it "should" work.
> That there is an option for it.
>
> Turns out that it works if I use the mount point rather than the device.
> I.e.,:
>
> # mount -o remount,suid /path/to/wherever/it/was/mounted
>
> works as expected. Strange, because for as long as I've been using
> "mount", it has always been OK to use either the device name or the mount
> point (for a mounted device - i.e., once it has been mounted); they are
> basically synonymous. But this seems to be an exception.

Strange, I thought remount worked with the block device..
--
user <candycane> is generated from /dev/urandom

Re: Linux mount: What is the opposite of "nosuid" ?

<87r0ezmt6h.fsf@bsb.me.uk>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=4178&group=comp.unix.programmer#4178

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ben.usenet@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.unix.programmer
Subject: Re: Linux mount: What is the opposite of "nosuid" ?
Date: Sun, 21 Apr 2024 01:54:30 +0100
Organization: A noiseless patient Spider
Lines: 46
Message-ID: <87r0ezmt6h.fsf@bsb.me.uk>
References: <uvuae7$3vtqg$1@news.xmission.com> <uvud53$30gsv$1@dont-email.me>
<uvukqn$3p9$1@news.xmission.com> <uvvcrr$3euft$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Sun, 21 Apr 2024 02:54:29 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="7edd0cd40ffde4ad927c29a7948a2e05";
logging-data="4146882"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18j2E1e5z8flBEJEMaP5vhDOrvFikpzYJk="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:2lLPcQvcqlHbJNEbcJa8cLppqTs=
sha1:h0iKq8mFVOK/k44uzEuab57MuWI=
X-BSB-Auth: 1.a8628d859f52beb4f6c1.20240421015430BST.87r0ezmt6h.fsf@bsb.me.uk
 by: Ben Bacarisse - Sun, 21 Apr 2024 00:54 UTC

candycanearter07 <candycanearter07@candycanearter07.nomail.afraid>
writes:

> Kenny McCormack <gazelle@shell.xmission.com> wrote at 20:39 this Friday (GMT):
>> In article <uvud53$30gsv$1@dont-email.me>,
>> Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
>>>On Fri, 19 Apr 2024 17:42:31 +0000, Kenny McCormack wrote:
>>>
>>>> I have encountered an interesting situation. I have a USB disk drive
>>>> auto-mounted (i.e, mounted by the automounter - I didn't explicitly mount it)
>>>> and it is mounted with "nosuid" (which is normal). But I would like it to
>>>> be mounted with suid working. It seems I should be able to do something
>>>> like:
>>>>
>>>> # mount -o remount,suid /dev/sdb1
>>>>
>>>> but that generates err msg "invalid option or not mounted" (*) (as does
>>>> every variation of the above that I've tried).
>>>
>>>That's strange. mount(8) explicitly names "suid" as an option, with the
>>>explanation:
>>> suid Allow set-user-identifier or set-group-identifier bits to take
>>> effect.
>>
>> OK - that's my reason for posting. To find out that it "should" work.
>> That there is an option for it.
>>
>> Turns out that it works if I use the mount point rather than the device.
>> I.e.,:
>>
>> # mount -o remount,suid /path/to/wherever/it/was/mounted
>>
>> works as expected. Strange, because for as long as I've been using
>> "mount", it has always been OK to use either the device name or the mount
>> point (for a mounted device - i.e., once it has been mounted); they are
>> basically synonymous. But this seems to be an exception.
>
> Strange, I thought remount worked with the block device..

I haven't used remount much but I'll make one observation... A block
device can be mounted in more than one place, so it would make sense for
remount to need the mount point rather than the device to be sure of
what needs to be remounted.

--
Ben.

Re: Linux mount: What is the opposite of "nosuid" ?

<v02vnj$2cpn$1@news.xmission.com>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=4179&group=comp.unix.programmer#4179

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gazelle@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.unix.programmer
Subject: Re: Linux mount: What is the opposite of "nosuid" ?
Date: Sun, 21 Apr 2024 12:10:27 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <v02vnj$2cpn$1@news.xmission.com>
References: <uvuae7$3vtqg$1@news.xmission.com> <uvud53$30gsv$1@dont-email.me> <uvukqn$3p9$1@news.xmission.com> <uvvcrr$3euft$2@dont-email.me>
Injection-Date: Sun, 21 Apr 2024 12:10:27 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="78647"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Sun, 21 Apr 2024 12:10 UTC

In article <uvvcrr$3euft$2@dont-email.me>,
candycanearter07 <candycanearter07@candycanearter07.nomail.afraid> wrote:
....
>> Turns out that it works if I use the mount point rather than the device.
>> I.e.,:
>>
>> # mount -o remount,suid /path/to/wherever/it/was/mounted
>>
>> works as expected. Strange, because for as long as I've been using
>> "mount", it has always been OK to use either the device name or the mount
>> point (for a mounted device - i.e., once it has been mounted); they are
>> basically synonymous. But this seems to be an exception.
>
>
>Strange, I thought remount worked with the block device..

Actually, it is pretty clear at this point (moreso now than when I started
this thread - that is a Good Thing. I've learned some things from having
launched this thread) that a "mount" is a data structure associated with a
directory, not with a device. The device is one of the properties of the
data structure (that isn't necessarily present, and isn't present in all
mounts).

So, it makes sense that you should have to specify the directory (referred
to as "the target" in the man pages) in most cases. It turns out that the
one exception to this - umount-ing - is actually an historical anomaly.
According to "man 2 umount", umount used to be "umount(device)", but then
they changed it to "umount(directory)" (for a while both were supported, at
the system call level, but then the "device" form was dropped). So, I
assume that, as a courtesy and for backward compatibility, the "umount"
program substitutes the device name with the directory name before invoking
the system call.

--
Most Southerners interest in, knowledge of, and participation in politics begins with
and ends with: Screw the blacks. If a guy is onboard with that, he's our guy!

Get them back in chains where they belong!

Re: Linux mount: What is the opposite of "nosuid" ?

<v034vi$assg$1@dont-email.me>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=4180&group=comp.unix.programmer#4180

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!news.hispagatos.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: candycanearter07@candycanearter07.nomail.afraid (candycanearter07)
Newsgroups: comp.unix.programmer
Subject: Re: Linux mount: What is the opposite of "nosuid" ?
Date: Sun, 21 Apr 2024 13:40:02 -0000 (UTC)
Organization: the-candyden-of-code
Lines: 50
Message-ID: <v034vi$assg$1@dont-email.me>
References: <uvuae7$3vtqg$1@news.xmission.com>
<uvud53$30gsv$1@dont-email.me> <uvukqn$3p9$1@news.xmission.com>
<uvvcrr$3euft$2@dont-email.me> <87r0ezmt6h.fsf@bsb.me.uk>
Injection-Date: Sun, 21 Apr 2024 15:40:03 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="36b20116b99581859bcb157434ac9bb1";
logging-data="357264"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Pw7jwyCYMbpeacBhmU87j+uPNTj1qrXZEQga3hyXmjA=="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:8e/LXORWji0YfdDGOYSWwhHr2eY=
X-Face: b{dPmN&%4|lEo,wUO\"KLEOu5N_br(N2Yuc5/qcR5i>9-!^e\.Tw9?/m0}/~:UOM:Zf]%
b+ V4R8q|QiU/R8\|G\WpC`-s?=)\fbtNc&=/a3a)r7xbRI]Vl)r<%PTriJ3pGpl_/B6!8pe\btzx
`~R! r3.0#lHRE+^Gro0[cjsban'vZ#j7,?I/tHk{s=TFJ:H?~=]`O*~3ZX`qik`b:.gVIc-[$t/e
ZrQsWJ >|l^I_[pbsIqwoz.WGA]<D
 by: candycanearter07 - Sun, 21 Apr 2024 13:40 UTC

Ben Bacarisse <ben.usenet@bsb.me.uk> wrote at 00:54 this Sunday (GMT):
> candycanearter07 <candycanearter07@candycanearter07.nomail.afraid>
> writes:
>
>> Kenny McCormack <gazelle@shell.xmission.com> wrote at 20:39 this Friday (GMT):
>>> In article <uvud53$30gsv$1@dont-email.me>,
>>> Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
>>>>On Fri, 19 Apr 2024 17:42:31 +0000, Kenny McCormack wrote:
>>>>
>>>>> I have encountered an interesting situation. I have a USB disk drive
>>>>> auto-mounted (i.e, mounted by the automounter - I didn't explicitly mount it)
>>>>> and it is mounted with "nosuid" (which is normal). But I would like it to
>>>>> be mounted with suid working. It seems I should be able to do something
>>>>> like:
>>>>>
>>>>> # mount -o remount,suid /dev/sdb1
>>>>>
>>>>> but that generates err msg "invalid option or not mounted" (*) (as does
>>>>> every variation of the above that I've tried).
>>>>
>>>>That's strange. mount(8) explicitly names "suid" as an option, with the
>>>>explanation:
>>>> suid Allow set-user-identifier or set-group-identifier bits to take
>>>> effect.
>>>
>>> OK - that's my reason for posting. To find out that it "should" work.
>>> That there is an option for it.
>>>
>>> Turns out that it works if I use the mount point rather than the device.
>>> I.e.,:
>>>
>>> # mount -o remount,suid /path/to/wherever/it/was/mounted
>>>
>>> works as expected. Strange, because for as long as I've been using
>>> "mount", it has always been OK to use either the device name or the mount
>>> point (for a mounted device - i.e., once it has been mounted); they are
>>> basically synonymous. But this seems to be an exception.
>>
>> Strange, I thought remount worked with the block device..
>
> I haven't used remount much but I'll make one observation... A block
> device can be mounted in more than one place, so it would make sense for
> remount to need the mount point rather than the device to be sure of
> what needs to be remounted.

Oh, I never considered that. I don't think I've seen multiple mount
points before.
--
user <candycane> is generated from /dev/urandom

Re: Linux mount: What is the opposite of "nosuid" ?

<v0moj7$1arr4$5@dont-email.me>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=4186&group=comp.unix.programmer#4186

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.programmer
Subject: Re: Linux mount: What is the opposite of "nosuid" ?
Date: Mon, 29 Apr 2024 00:11:20 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <v0moj7$1arr4$5@dont-email.me>
References: <uvuae7$3vtqg$1@news.xmission.com> <uvud53$30gsv$1@dont-email.me>
<uvukqn$3p9$1@news.xmission.com> <uvvcrr$3euft$2@dont-email.me>
<87r0ezmt6h.fsf@bsb.me.uk> <v034vi$assg$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 29 Apr 2024 02:11:20 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="04215bbbe15e1cd8ac94ba1cee5d62b8";
logging-data="1404772"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18GMwkD8KrLPeT+I3OcNPAK"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:ErOXdGonEW/fpo/TuVHvPJvV4p8=
 by: Lawrence D'Oliv - Mon, 29 Apr 2024 00:11 UTC

On Sun, 21 Apr 2024 13:40:02 -0000 (UTC), candycanearter07 wrote:

> I don't think I've seen multiple mount points before

Linux calls them “bind mounts”. Very handy, for example with containers,
to give the guest userland visibility into selected parts of the host
filesystem.

Re: Linux mount: What is the opposite of "nosuid" ?

<v12on9$ihfm$6@dont-email.me>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=4187&group=comp.unix.programmer#4187

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!news.swapon.de!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: candycanearter07@candycanearter07.nomail.afraid (candycanearter07)
Newsgroups: comp.unix.programmer
Subject: Re: Linux mount: What is the opposite of "nosuid" ?
Date: Fri, 3 May 2024 13:27:05 -0000 (UTC)
Organization: the-candyden-of-code
Lines: 13
Message-ID: <v12on9$ihfm$6@dont-email.me>
References: <uvuae7$3vtqg$1@news.xmission.com>
<uvud53$30gsv$1@dont-email.me> <uvukqn$3p9$1@news.xmission.com>
<uvvcrr$3euft$2@dont-email.me> <87r0ezmt6h.fsf@bsb.me.uk>
<v034vi$assg$1@dont-email.me> <v0moj7$1arr4$5@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 03 May 2024 15:27:05 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="ad692053f36da33ffdbbcc29eead2b23";
logging-data="607734"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/skAbGtbpiKPfxTbnEjW0XIAR37A9zXOYXYuQyCdbuZQ=="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:xnwyePu7vtpKq1xdOtPfObKemaU=
X-Face: b{dPmN&%4|lEo,wUO\"KLEOu5N_br(N2Yuc5/qcR5i>9-!^e\.Tw9?/m0}/~:UOM:Zf]%
b+ V4R8q|QiU/R8\|G\WpC`-s?=)\fbtNc&=/a3a)r7xbRI]Vl)r<%PTriJ3pGpl_/B6!8pe\btzx
`~R! r3.0#lHRE+^Gro0[cjsban'vZ#j7,?I/tHk{s=TFJ:H?~=]`O*~3ZX`qik`b:.gVIc-[$t/e
ZrQsWJ >|l^I_[pbsIqwoz.WGA]<D
 by: candycanearter07 - Fri, 3 May 2024 13:27 UTC

Lawrence D'Oliveiro <ldo@nz.invalid> wrote at 00:11 this Monday (GMT):
> On Sun, 21 Apr 2024 13:40:02 -0000 (UTC), candycanearter07 wrote:
>
>> I don't think I've seen multiple mount points before
>
> Linux calls them “bind mounts”. Very handy, for example with containers,
> to give the guest userland visibility into selected parts of the host
> filesystem.

Makes sense, since you can't hard link directories.
--
user <candycane> is generated from /dev/urandom

Re: Linux mount: What is the opposite of "nosuid" ?

<v137f0$l6ll$1@dont-email.me>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=4188&group=comp.unix.programmer#4188

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!rocksolid2!news.neodome.net!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: vallor@cultnix.org (vallor)
Newsgroups: comp.unix.programmer
Subject: Re: Linux mount: What is the opposite of "nosuid" ?
Date: Fri, 3 May 2024 17:38:40 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <v137f0$l6ll$1@dont-email.me>
References: <uvuae7$3vtqg$1@news.xmission.com> <uvud53$30gsv$1@dont-email.me>
<uvukqn$3p9$1@news.xmission.com> <uvvcrr$3euft$2@dont-email.me>
<87r0ezmt6h.fsf@bsb.me.uk> <v034vi$assg$1@dont-email.me>
<v0moj7$1arr4$5@dont-email.me> <v12on9$ihfm$6@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 03 May 2024 19:38:41 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="17af542c4391ba766945774ffeb6bceb";
logging-data="694965"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/xWxo0k0QZ0Qpfj5qgHMbn"
User-Agent: Pan/0.158 (Avdiivka; 6a11104 gitlab.gnome.org/GNOME/pan.git;
x86_64-pc-linux-gnu)
Cancel-Lock: sha1:P8QtSpVi6H8bulBR8HMTlZlVwxc=
X-Face: \}2`P"_@pS86<'EM:'b.Ml}8IuMK"pV"?FReF$'c.S%u9<Q#U*4QO)$l81M`{Q/n
XL'`91kd%N::LG:=*\35JS0prp\VJN^<s"b#bff@fA7]5lJA.jn,x_d%Md$,{.EZ
 by: vallor - Fri, 3 May 2024 17:38 UTC

On Fri, 3 May 2024 13:27:05 -0000 (UTC), candycanearter07
<candycanearter07@candycanearter07.nomail.afraid> wrote in
<v12on9$ihfm$6@dont-email.me>:

> Lawrence D'Oliveiro <ldo@nz.invalid> wrote at 00:11 this Monday (GMT):
>> On Sun, 21 Apr 2024 13:40:02 -0000 (UTC), candycanearter07 wrote:
>>
>>> I don't think I've seen multiple mount points before
>>
>> Linux calls them “bind mounts”. Very handy, for example with
>> containers,
>> to give the guest userland visibility into selected parts of the host
>> filesystem.
>
>
> Makes sense, since you can't hard link directories.

Sometimes, you can, depending on OS and filesystem:

https://jameshunt.us/writings/linking-dirs-in-macos/

IIRC, Apple's Time Machine uses this capability.

BTW, I'm not mentioning this because I think it's a good idea;
the Unix puritan in me abhors hard-linked directories.

bind mounts are different, because they don't alter the filesystem
structure. Otherwise, you might end up with an un-fsck-able
filesystem.

--
-v

Re: Linux mount: What is the opposite of "nosuid" ?

<v141ui$rcfn$2@dont-email.me>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=4189&group=comp.unix.programmer#4189

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.programmer
Subject: Re: Linux mount: What is the opposite of "nosuid" ?
Date: Sat, 4 May 2024 01:10:42 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <v141ui$rcfn$2@dont-email.me>
References: <uvuae7$3vtqg$1@news.xmission.com> <uvud53$30gsv$1@dont-email.me>
<uvukqn$3p9$1@news.xmission.com> <uvvcrr$3euft$2@dont-email.me>
<87r0ezmt6h.fsf@bsb.me.uk> <v034vi$assg$1@dont-email.me>
<v0moj7$1arr4$5@dont-email.me> <v12on9$ihfm$6@dont-email.me>
<v137f0$l6ll$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 04 May 2024 03:10:42 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="3e71a75fbbcf81b4a78150d90a6a33ff";
logging-data="897527"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19338SjbgFApAsvVjeUQJ33"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:hotXndUHLhmdR8kmeSuztUOb+gs=
 by: Lawrence D'Oliv - Sat, 4 May 2024 01:10 UTC

On Fri, 3 May 2024 17:38:40 -0000 (UTC), vallor wrote:

> On Fri, 3 May 2024 13:27:05 -0000 (UTC), candycanearter07
> <candycanearter07@candycanearter07.nomail.afraid> wrote in
> <v12on9$ihfm$6@dont-email.me>:
>
>> ... you can't hard link directories.
>
> Sometimes, you can, depending on OS and filesystem:
>
> https://jameshunt.us/writings/linking-dirs-in-macos/
>
> IIRC, Apple's Time Machine uses this capability.
>
> BTW, I'm not mentioning this because I think it's a good idea;
> the Unix puritan in me abhors hard-linked directories.

They are a very, very, very, very bad idea. And completely unnecessary.

> bind mounts are different, because they don't alter the filesystem
> structure. Otherwise, you might end up with an un-fsck-able
> filesystem.

Fun fact: Linux doesn’t actually distinguish between different mounts of
the same filesystem (in the sense that one is the “original” mount and the
others are not). That is, you can keep a later “bind” mount, and remove
the original non-“bind” mount, and it still works.

Re: Linux mount: What is the opposite of "nosuid" ?

<87plu14zrw.fsf@tudado.org>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=4190&group=comp.unix.programmer#4190

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!rocksolid2!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jfairchild@tudado.org (Johanne Fairchild)
Newsgroups: comp.unix.programmer
Subject: Re: Linux mount: What is the opposite of "nosuid" ?
Date: Sat, 04 May 2024 07:50:11 -0300
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <87plu14zrw.fsf@tudado.org>
References: <uvuae7$3vtqg$1@news.xmission.com> <uvud53$30gsv$1@dont-email.me>
<uvukqn$3p9$1@news.xmission.com> <uvvcrr$3euft$2@dont-email.me>
<87r0ezmt6h.fsf@bsb.me.uk> <v034vi$assg$1@dont-email.me>
<v0moj7$1arr4$5@dont-email.me> <v12on9$ihfm$6@dont-email.me>
<v137f0$l6ll$1@dont-email.me> <v141ui$rcfn$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Sat, 04 May 2024 12:50:12 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="62c0efb4ef60700ccdb9378795aef391";
logging-data="1241110"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+cqloI9S8bhIk6MtHxe9Sayca07S5/Kas="
Cancel-Lock: sha1:DeOXc1bqmGnARmUnBwCaQRIV+uk=
sha1:brx6aTfS2gwBKeY8QBYC6myf/dI=
 by: Johanne Fairchild - Sat, 4 May 2024 10:50 UTC

Lawrence D'Oliveiro <ldo@nz.invalid> writes:

> On Fri, 3 May 2024 17:38:40 -0000 (UTC), vallor wrote:
>
>> On Fri, 3 May 2024 13:27:05 -0000 (UTC), candycanearter07
>> <candycanearter07@candycanearter07.nomail.afraid> wrote in
>> <v12on9$ihfm$6@dont-email.me>:
>>
>>> ... you can't hard link directories.
>>
>> Sometimes, you can, depending on OS and filesystem:
>>
>> https://jameshunt.us/writings/linking-dirs-in-macos/
>>
>> IIRC, Apple's Time Machine uses this capability.
>>
>> BTW, I'm not mentioning this because I think it's a good idea;
>> the Unix puritan in me abhors hard-linked directories.
>
> They are a very, very, very, very bad idea. And completely unnecessary.

Why are they a bad idea? Can you show examples? I can't see it. Thanks!

Mark Twain story (Was: Linux mount: What is the opposite of "nosuid" ?)

<v157du$iijb$1@news.xmission.com>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=4191&group=comp.unix.programmer#4191

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!rocksolid2!news.neodome.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gazelle@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.unix.programmer
Subject: Mark Twain story (Was: Linux mount: What is the opposite of "nosuid" ?)
Date: Sat, 4 May 2024 11:50:22 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <v157du$iijb$1@news.xmission.com>
References: <uvuae7$3vtqg$1@news.xmission.com> <v137f0$l6ll$1@dont-email.me> <v141ui$rcfn$2@dont-email.me> <87plu14zrw.fsf@tudado.org>
Injection-Date: Sat, 4 May 2024 11:50:22 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="608875"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Sat, 4 May 2024 11:50 UTC

In article <87plu14zrw.fsf@tudado.org>,
Johanne Fairchild <jfairchild@tudado.org> wrote:
....
>> They are a very, very, very, very bad idea. And completely unnecessary.
>
>Why are they a bad idea? Can you show examples? I can't see it. Thanks!

The poster who used too many "Very"s is a known crank.

Generally, the more "Very"s you use, the worse is your argument.

Or, as Mark Twain once put it:

A young writer asked me how to edit his writing. I told him that he
should go through and replace every occurrence of the word "very" with
the word "damn". His editor would then remove every occurrence of the
later word, and then things would be as they should be.

So at our house, with this story in mind, whenever we use the word "very"
in conversation, we immediately change it to "damn". So, the above would
be:

They are a damn, damn, damn, damn bad idea. And completely unnecessary.

and after editing:

They are a bad idea. And completely unnecessary.

--
Many (most?) Trump voters voted for him because they thought if they
supported Trump enough, they'd get to *be* Trump.

Similarly, Trump believes that if *he* praises Putin enough, he'll get to *be* Putin.

Re: Linux mount: What is the opposite of "nosuid" ?

<v15gcp$18g38$1@dont-email.me>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=4192&group=comp.unix.programmer#4192

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.programmer
Subject: Re: Linux mount: What is the opposite of "nosuid" ?
Date: Sat, 4 May 2024 14:23:21 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <v15gcp$18g38$1@dont-email.me>
References: <uvuae7$3vtqg$1@news.xmission.com> <uvud53$30gsv$1@dont-email.me>
<uvukqn$3p9$1@news.xmission.com> <uvvcrr$3euft$2@dont-email.me>
<87r0ezmt6h.fsf@bsb.me.uk> <v034vi$assg$1@dont-email.me>
<v0moj7$1arr4$5@dont-email.me> <v12on9$ihfm$6@dont-email.me>
<v137f0$l6ll$1@dont-email.me> <v141ui$rcfn$2@dont-email.me>
<87plu14zrw.fsf@tudado.org>
Injection-Date: Sat, 04 May 2024 16:23:22 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="f488aa84402ec06a36c60fcb0f4e7d2e";
logging-data="1327208"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+vzdI+xAKPsLY0FcvPXeIW"
Cancel-Lock: sha1:1eirN0Oi8EaIt9x6Q6cRPccRgxs=
 by: Muttley@dastardlyhq.com - Sat, 4 May 2024 14:23 UTC

On Sat, 04 May 2024 07:50:11 -0300
Johanne Fairchild <jfairchild@tudado.org> wrote:
>Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>
>> On Fri, 3 May 2024 17:38:40 -0000 (UTC), vallor wrote:
>>
>>> On Fri, 3 May 2024 13:27:05 -0000 (UTC), candycanearter07
>>> <candycanearter07@candycanearter07.nomail.afraid> wrote in
>>> <v12on9$ihfm$6@dont-email.me>:
>>>
>>>> ... you can't hard link directories.
>>>
>>> Sometimes, you can, depending on OS and filesystem:
>>>
>>> https://jameshunt.us/writings/linking-dirs-in-macos/
>>>
>>> IIRC, Apple's Time Machine uses this capability.
>>>
>>> BTW, I'm not mentioning this because I think it's a good idea;
>>> the Unix puritan in me abhors hard-linked directories.
>>
>> They are a very, very, very, very bad idea. And completely unnecessary.
>
>Why are they a bad idea? Can you show examples? I can't see it. Thanks!

Probably because there isn't much point (not that IMO there's much point to
hard links anyway) as when you delete the directory you'll delete all the
files inside but the now empty directory will still exist wherever its hard link
is.

Re: Linux mount: What is the opposite of "nosuid" ?

<20240504073429.2@kylheku.com>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=4193&group=comp.unix.programmer#4193

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 643-408-1753@kylheku.com (Kaz Kylheku)
Newsgroups: comp.unix.programmer
Subject: Re: Linux mount: What is the opposite of "nosuid" ?
Date: Sat, 4 May 2024 14:37:24 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <20240504073429.2@kylheku.com>
References: <uvuae7$3vtqg$1@news.xmission.com>
<uvud53$30gsv$1@dont-email.me> <uvukqn$3p9$1@news.xmission.com>
<uvvcrr$3euft$2@dont-email.me> <87r0ezmt6h.fsf@bsb.me.uk>
<v034vi$assg$1@dont-email.me> <v0moj7$1arr4$5@dont-email.me>
<v12on9$ihfm$6@dont-email.me> <v137f0$l6ll$1@dont-email.me>
<v141ui$rcfn$2@dont-email.me> <87plu14zrw.fsf@tudado.org>
<v15gcp$18g38$1@dont-email.me>
Injection-Date: Sat, 04 May 2024 16:37:24 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="af6680eff02e31bc930ebfe2b1561a7a";
logging-data="1324055"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1987AoogO2jiECn0IixGUZdW7YCBmGBKck="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:wgnYkcPM7p6jDTqk0Guf+0ydgi4=
 by: Kaz Kylheku - Sat, 4 May 2024 14:37 UTC

On 2024-05-04, Muttley@dastardlyhq.com <Muttley@dastardlyhq.com> wrote:
> Probably because there isn't much point (not that IMO there's much point to
> hard links anyway) as when you delete the directory you'll delete all the
> files inside but the now empty directory will still exist wherever its hard link
> is.

This problem happens anyway when one or more processes have that
directory as their root or cwd, referring to it by open inode.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: Linux mount: What is the opposite of "nosuid" ?

<v15hb0$17gl0$1@dont-email.me>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=4194&group=comp.unix.programmer#4194

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: lew.pitcher@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.unix.programmer
Subject: Re: Linux mount: What is the opposite of "nosuid" ?
Date: Sat, 4 May 2024 14:39:28 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 42
Message-ID: <v15hb0$17gl0$1@dont-email.me>
References: <uvuae7$3vtqg$1@news.xmission.com>
<uvud53$30gsv$1@dont-email.me> <uvukqn$3p9$1@news.xmission.com>
<uvvcrr$3euft$2@dont-email.me> <87r0ezmt6h.fsf@bsb.me.uk>
<v034vi$assg$1@dont-email.me> <v0moj7$1arr4$5@dont-email.me>
<v12on9$ihfm$6@dont-email.me> <v137f0$l6ll$1@dont-email.me>
<v141ui$rcfn$2@dont-email.me> <87plu14zrw.fsf@tudado.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 04 May 2024 16:39:28 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="3a1fe3952dbb3d094a47af42d62d3bdb";
logging-data="1295008"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/OJWC2kg836CDJ2739oWzSzxPyvN+Nob0="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:vJ/jkMoqwih9L2jxFIxoGzpo89g=
 by: Lew Pitcher - Sat, 4 May 2024 14:39 UTC

On Sat, 04 May 2024 07:50:11 -0300, Johanne Fairchild wrote:

> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>
>> On Fri, 3 May 2024 17:38:40 -0000 (UTC), vallor wrote:
>>
>>> On Fri, 3 May 2024 13:27:05 -0000 (UTC), candycanearter07
>>> <candycanearter07@candycanearter07.nomail.afraid> wrote in
>>> <v12on9$ihfm$6@dont-email.me>:
>>>
>>>> ... you can't hard link directories.
>>>
>>> Sometimes, you can, depending on OS and filesystem:
>>>
>>> https://jameshunt.us/writings/linking-dirs-in-macos/
>>>
>>> IIRC, Apple's Time Machine uses this capability.
>>>
>>> BTW, I'm not mentioning this because I think it's a good idea;
>>> the Unix puritan in me abhors hard-linked directories.
>>
>> They are a very, very, very, very bad idea. And completely unnecessary.
>
> Why are they a bad idea? Can you show examples? I can't see it. Thanks!

A hardlink introduces an undetectable cyclicity in the underlying filesystem.

It must reference an inode within a specific filesystem (and, thus, cannot
cross filesystems or mountpoints), and (unlike softlinks) has no other
distinguishing feature. This means that you can only determine if a
/directory/ hardlink has introduced a cyclical reference by actually
traversing the hardlinked directory structures until you return to the
starting link.

On the other hand, you can detect both softlinks and bind mounts without
directory traversal. A softlink inode contains a very specific flag to
indicate that it contains a softlink, and the system records a bind mount
in the its public mount records.

--
Lew Pitcher
"In Skills We Trust"

Hard links (Was: Linux mount: What is the opposite of "nosuid" ?)

<v15hdm$ilo6$1@news.xmission.com>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=4195&group=comp.unix.programmer#4195

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder9.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gazelle@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.unix.programmer
Subject: Hard links (Was: Linux mount: What is the opposite of "nosuid" ?)
Date: Sat, 4 May 2024 14:40:54 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <v15hdm$ilo6$1@news.xmission.com>
References: <uvuae7$3vtqg$1@news.xmission.com> <v141ui$rcfn$2@dont-email.me> <87plu14zrw.fsf@tudado.org> <v15gcp$18g38$1@dont-email.me>
Injection-Date: Sat, 4 May 2024 14:40:54 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="612102"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Sat, 4 May 2024 14:40 UTC

In article <v15gcp$18g38$1@dont-email.me>, <Muttley@dastardlyhq.com> wrote:
....
>Probably because there isn't much point (not that IMO there's much point to
>hard links anyway) ...

Without hard links, you could not have a Unix filesystem.

So, you do need them.

--
The randomly chosen signature file that would have appeared here is more than 4
lines long. As such, it violates one or more Usenet RFCs. In order to remain
in compliance with said RFCs, the actual sig can be found at the following URL:
http://user.xmission.com/~gazelle/Sigs/BestCLCPostEver

Re: Linux mount: What is the opposite of "nosuid" ?

<v15htf$17gl0$2@dont-email.me>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=4196&group=comp.unix.programmer#4196

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: lew.pitcher@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.unix.programmer
Subject: Re: Linux mount: What is the opposite of "nosuid" ?
Date: Sat, 4 May 2024 14:49:19 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 64
Message-ID: <v15htf$17gl0$2@dont-email.me>
References: <uvuae7$3vtqg$1@news.xmission.com>
<uvud53$30gsv$1@dont-email.me> <uvukqn$3p9$1@news.xmission.com>
<uvvcrr$3euft$2@dont-email.me> <87r0ezmt6h.fsf@bsb.me.uk>
<v034vi$assg$1@dont-email.me> <v0moj7$1arr4$5@dont-email.me>
<v12on9$ihfm$6@dont-email.me> <v137f0$l6ll$1@dont-email.me>
<v141ui$rcfn$2@dont-email.me> <87plu14zrw.fsf@tudado.org>
<v15hb0$17gl0$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 04 May 2024 16:49:19 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="3a1fe3952dbb3d094a47af42d62d3bdb";
logging-data="1295008"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX190SEtw/NtKOZnDhL0Vr+NlBL7MUUL9uZw="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:0ALD/SKb8UHN2fMSNnqdfQzNW/c=
 by: Lew Pitcher - Sat, 4 May 2024 14:49 UTC

On Sat, 04 May 2024 14:39:28 +0000, Lew Pitcher wrote:

> On Sat, 04 May 2024 07:50:11 -0300, Johanne Fairchild wrote:
>
>> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>>
>>> On Fri, 3 May 2024 17:38:40 -0000 (UTC), vallor wrote:
>>>
>>>> On Fri, 3 May 2024 13:27:05 -0000 (UTC), candycanearter07
>>>> <candycanearter07@candycanearter07.nomail.afraid> wrote in
>>>> <v12on9$ihfm$6@dont-email.me>:
>>>>
>>>>> ... you can't hard link directories.
>>>>
>>>> Sometimes, you can, depending on OS and filesystem:
>>>>
>>>> https://jameshunt.us/writings/linking-dirs-in-macos/
>>>>
>>>> IIRC, Apple's Time Machine uses this capability.
>>>>
>>>> BTW, I'm not mentioning this because I think it's a good idea;
>>>> the Unix puritan in me abhors hard-linked directories.
>>>
>>> They are a very, very, very, very bad idea. And completely unnecessary.
>>
>> Why are they a bad idea? Can you show examples? I can't see it. Thanks!
>
> A hardlink introduces an undetectable cyclicity in the underlying filesystem.
>
> It must reference an inode within a specific filesystem (and, thus, cannot
> cross filesystems or mountpoints), and (unlike softlinks) has no other
> distinguishing feature. This means that you can only determine if a
> /directory/ hardlink has introduced a cyclical reference by actually
> traversing the hardlinked directory structures until you return to the
> starting link.

Note that unix filesystems support a limited, controlled subset of hardlinks:
the "." and ".." directories found in each directory. The OS controls the
creation and deletion of /these/ hardlinks from within, as part of the mkdir(2)
and rmdir(2) syscalls. And, the only cyclical hardlink (that I know of, anyway)
lives as "/..", which links to itself.

As for a cyclical hardlink, imagine the following:
# Build a disposable directory
mkdir /tmp/dumb

# Populate the disposable directory with a cyclical hardlink
ln /tmp/dumb /tmp/dumb/dumber

# Now, let's empty the disposable directory
rm -rf /tmp/dumb

What does the "rm -rf" do when that "ln /tmp/dumb /tmp/dumb/dumber" actually
creates a hardlink from /tmp/dumb/dumber to /tmp/dumb ?

--
Lew Pitcher
"In Skills We Trust"

Re: Linux mount: What is the opposite of "nosuid" ?

<20240504075349.523@kylheku.com>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=4197&group=comp.unix.programmer#4197

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 643-408-1753@kylheku.com (Kaz Kylheku)
Newsgroups: comp.unix.programmer
Subject: Re: Linux mount: What is the opposite of "nosuid" ?
Date: Sat, 4 May 2024 15:11:19 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 66
Message-ID: <20240504075349.523@kylheku.com>
References: <uvuae7$3vtqg$1@news.xmission.com>
<uvud53$30gsv$1@dont-email.me> <uvukqn$3p9$1@news.xmission.com>
<uvvcrr$3euft$2@dont-email.me> <87r0ezmt6h.fsf@bsb.me.uk>
<v034vi$assg$1@dont-email.me> <v0moj7$1arr4$5@dont-email.me>
<v12on9$ihfm$6@dont-email.me> <v137f0$l6ll$1@dont-email.me>
<v141ui$rcfn$2@dont-email.me> <87plu14zrw.fsf@tudado.org>
<v15hb0$17gl0$1@dont-email.me>
Injection-Date: Sat, 04 May 2024 17:11:19 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="af6680eff02e31bc930ebfe2b1561a7a";
logging-data="1337950"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19fKVfSb81Pb6uzAApuCLroc/80XFqIhPk="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:7JRnwcUcsNRjunEaKPf8N/NfV/E=
 by: Kaz Kylheku - Sat, 4 May 2024 15:11 UTC

On 2024-05-04, Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
> A hardlink introduces an undetectable cyclicity in the underlying filesystem.

You mean, trouble some cyclicity that is detectable with a lot of
annoying fuss, that has to be done wherever the filesystem is being
recursively traversed.

> It must reference an inode within a specific filesystem (and, thus, cannot
> cross filesystems or mountpoints), and (unlike softlinks) has no other
> distinguishing feature. This means that you can only determine if a
> /directory/ hardlink has introduced a cyclical reference by actually
> traversing the hardlinked directory structures until you return to the
> starting link.

If you keep the path of inodes you have visited in order to reach a
certain directory, then you can detect a cycle by checking whether a
newly visited directory is one of the elements of the path. Since
paths are reasonably short, you don't need any fancy hash data structure
for this; a linear scan will work fine in most cases, and so you can
represent the path as a linked list that is allocated on the stack,
if working in C.

void recurse(..., visited_node *parent)
{
visited_node current = { .up = parent };
// ...
}

The cyclic check is simply chasing the parent->up pointers to see if any
of the visited nodes is the same object as the newly visited one.

The problem is:

1. Everything that performs traversals of the filesystem now *has* to do
this, or risk being stuck in a loop. There is a bad habit in the
Unix programming culture of people rolling their own filesystem
traversal functions. Some of them would get it wrong, ending up in
infinite loops.

2. Even if you have cycle detection, you still have the problem that
every recursive traversal performed anywhere runs the risk of
potentially visiting the entire filesystem!

Directory hard links could be restricted to being downward-only. So that
is to say, if you create a P/C -> D hard link, then X is required to be
a descendant of P, such as P/X/Y/D.

To check that without race conditions, the kernel would have to lock
down all operations on that filesystem during the link operation.
Starting at D, it could navigate the parent .. links until it hits
the root directory, P, or hits a mount point crossing. If it finds P,
then it can conclude that the link can be made. (Without TOCtoTOU
if things are properly locked down.)

Holding a lock over a complex operation like that could open an avenue
to a DOS attack against the filesystem. Imagine a swarm of threads doing
directory linking operations, causing that lock to be excessively held.

The descendant restriction would make directory hardlinks inapplicable
to some people's use cases. (Oh well, they'd have to use symlinks
for those situations.)

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: Hard links (Was: Linux mount: What is the opposite of "nosuid" ?)

<v15l2u$19cnk$1@dont-email.me>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=4198&group=comp.unix.programmer#4198

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.programmer
Subject: Re: Hard links (Was: Linux mount: What is the opposite of "nosuid" ?)
Date: Sat, 4 May 2024 15:43:26 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <v15l2u$19cnk$1@dont-email.me>
References: <uvuae7$3vtqg$1@news.xmission.com> <v141ui$rcfn$2@dont-email.me> <87plu14zrw.fsf@tudado.org> <v15gcp$18g38$1@dont-email.me> <v15hdm$ilo6$1@news.xmission.com>
Injection-Date: Sat, 04 May 2024 17:43:26 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="f488aa84402ec06a36c60fcb0f4e7d2e";
logging-data="1356532"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ArYH9t92nGb2nIJeveGlB"
Cancel-Lock: sha1:4zoiIwn4GHIyyi6+RxbNQQhjAJ0=
 by: Muttley@dastardlyhq.com - Sat, 4 May 2024 15:43 UTC

On Sat, 4 May 2024 14:40:54 -0000 (UTC)
gazelle@shell.xmission.com (Kenny McCormack) wrote:
>In article <v15gcp$18g38$1@dont-email.me>, <Muttley@dastardlyhq.com> wrote:
>....
>>Probably because there isn't much point (not that IMO there's much point to
>>hard links anyway) ...
>
>Without hard links, you could not have a Unix filesystem.

Why not? If you meant "." and ".." FAT copes without having these as actual
filesystem entries - they simply get interpreted by the path string parsing
system. I'm not even sure if NTFS has them as hard links either.

Re: Linux mount: What is the opposite of "nosuid" ?

<v16do4$1ejcv$1@dont-email.me>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=4199&group=comp.unix.programmer#4199

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.programmer
Subject: Re: Linux mount: What is the opposite of "nosuid" ?
Date: Sat, 4 May 2024 22:44:20 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <v16do4$1ejcv$1@dont-email.me>
References: <uvuae7$3vtqg$1@news.xmission.com> <uvud53$30gsv$1@dont-email.me>
<uvukqn$3p9$1@news.xmission.com> <uvvcrr$3euft$2@dont-email.me>
<87r0ezmt6h.fsf@bsb.me.uk> <v034vi$assg$1@dont-email.me>
<v0moj7$1arr4$5@dont-email.me> <v12on9$ihfm$6@dont-email.me>
<v137f0$l6ll$1@dont-email.me> <v141ui$rcfn$2@dont-email.me>
<87plu14zrw.fsf@tudado.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 05 May 2024 00:44:20 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="33a041cd80492abf930d5e0c5f5526b9";
logging-data="1527199"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/coA5aKOUmvZ/t/Si3o/JV"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:HY9PRYk8fl1crBVpS0djvpcXQ4c=
 by: Lawrence D'Oliv - Sat, 4 May 2024 22:44 UTC

On Sat, 04 May 2024 07:50:11 -0300, Johanne Fairchild wrote:

> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>
>> On Fri, 3 May 2024 17:38:40 -0000 (UTC), vallor wrote:
>>
>>> ... the Unix puritan in me abhors hard-linked directories.
>>
>> They are a very, very, very, very bad idea. And completely unnecessary.
>
> Why are they a bad idea?

Consider these two questions:
* How do you detect reference cycles?
* What happens if you don’t?

Re: Linux mount: What is the opposite of "nosuid" ?

<v16drh$1ejcv$2@dont-email.me>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=4200&group=comp.unix.programmer#4200

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.programmer
Subject: Re: Linux mount: What is the opposite of "nosuid" ?
Date: Sat, 4 May 2024 22:46:10 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <v16drh$1ejcv$2@dont-email.me>
References: <uvuae7$3vtqg$1@news.xmission.com> <uvud53$30gsv$1@dont-email.me>
<uvukqn$3p9$1@news.xmission.com> <uvvcrr$3euft$2@dont-email.me>
<87r0ezmt6h.fsf@bsb.me.uk> <v034vi$assg$1@dont-email.me>
<v0moj7$1arr4$5@dont-email.me> <v12on9$ihfm$6@dont-email.me>
<v137f0$l6ll$1@dont-email.me> <v141ui$rcfn$2@dont-email.me>
<87plu14zrw.fsf@tudado.org> <v15hb0$17gl0$1@dont-email.me>
<v15htf$17gl0$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 05 May 2024 00:46:10 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="33a041cd80492abf930d5e0c5f5526b9";
logging-data="1527199"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19bCObb+P52fNwbc/4g6eSd"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:IQk+sq2idwXelSoH/R2PrQ2OeJg=
 by: Lawrence D'Oliv - Sat, 4 May 2024 22:46 UTC

On Sat, 4 May 2024 14:49:19 -0000 (UTC), Lew Pitcher wrote:

> Note that unix filesystems support a limited, controlled subset of
> hardlinks: the "." and ".." directories found in each directory.

Even those are completely unnecessary. Their interpretation could easily
be hard-coded into the path-interpretation routines in the kernel, instead
of wasting space for these entries in every single directory on a
filesystem.

Re: Linux mount: What is the opposite of "nosuid" ?

<87h6fd180o.fsf@tudado.org>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=4201&group=comp.unix.programmer#4201

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jfairchild@tudado.org (Johanne Fairchild)
Newsgroups: comp.unix.programmer
Subject: Re: Linux mount: What is the opposite of "nosuid" ?
Date: Sat, 04 May 2024 20:17:59 -0300
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <87h6fd180o.fsf@tudado.org>
References: <uvuae7$3vtqg$1@news.xmission.com> <uvud53$30gsv$1@dont-email.me>
<uvukqn$3p9$1@news.xmission.com> <uvvcrr$3euft$2@dont-email.me>
<87r0ezmt6h.fsf@bsb.me.uk> <v034vi$assg$1@dont-email.me>
<v0moj7$1arr4$5@dont-email.me> <v12on9$ihfm$6@dont-email.me>
<v137f0$l6ll$1@dont-email.me> <v141ui$rcfn$2@dont-email.me>
<87plu14zrw.fsf@tudado.org> <v15gcp$18g38$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Sun, 05 May 2024 01:18:01 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c474d167924119b081aef87d557899dd";
logging-data="1538049"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18AY5ikvxGqWzWYF6W+mEg4nz7HUIOV6dg="
Cancel-Lock: sha1:dRMPNAofJGoGQTx5Cq2XMoCP8fQ=
sha1:5GbMyjqA03h2/Up8mnYh1lhsDQc=
 by: Johanne Fairchild - Sat, 4 May 2024 23:17 UTC

Muttley@dastardlyhq.com writes:

> On Sat, 04 May 2024 07:50:11 -0300
> Johanne Fairchild <jfairchild@tudado.org> wrote:
>>Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>>
>>> On Fri, 3 May 2024 17:38:40 -0000 (UTC), vallor wrote:
>>>
>>>> On Fri, 3 May 2024 13:27:05 -0000 (UTC), candycanearter07
>>>> <candycanearter07@candycanearter07.nomail.afraid> wrote in
>>>> <v12on9$ihfm$6@dont-email.me>:
>>>>
>>>>> ... you can't hard link directories.
>>>>
>>>> Sometimes, you can, depending on OS and filesystem:
>>>>
>>>> https://jameshunt.us/writings/linking-dirs-in-macos/
>>>>
>>>> IIRC, Apple's Time Machine uses this capability.
>>>>
>>>> BTW, I'm not mentioning this because I think it's a good idea;
>>>> the Unix puritan in me abhors hard-linked directories.
>>>
>>> They are a very, very, very, very bad idea. And completely unnecessary.
>>
>>Why are they a bad idea? Can you show examples? I can't see it. Thanks!
>
> Probably because there isn't much point (not that IMO there's much point to
> hard links anyway) as when you delete the directory you'll delete all the
> files inside but the now empty directory will still exist wherever its hard link
> is.

Oh, I see. And if we were to fix this by removing the directory as well
in the two or more places it was linked to? Wouldn't it be useful as a
single directory that has two absolute paths? That seems useful to me.

Re: Linux mount: What is the opposite of "nosuid" ?

<878r0p17r7.fsf@tudado.org>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=4202&group=comp.unix.programmer#4202

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!news.nntp4.net!news.hispagatos.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jfairchild@tudado.org (Johanne Fairchild)
Newsgroups: comp.unix.programmer
Subject: Re: Linux mount: What is the opposite of "nosuid" ?
Date: Sat, 04 May 2024 20:23:40 -0300
Organization: A noiseless patient Spider
Lines: 66
Message-ID: <878r0p17r7.fsf@tudado.org>
References: <uvuae7$3vtqg$1@news.xmission.com> <uvud53$30gsv$1@dont-email.me>
<uvukqn$3p9$1@news.xmission.com> <uvvcrr$3euft$2@dont-email.me>
<87r0ezmt6h.fsf@bsb.me.uk> <v034vi$assg$1@dont-email.me>
<v0moj7$1arr4$5@dont-email.me> <v12on9$ihfm$6@dont-email.me>
<v137f0$l6ll$1@dont-email.me> <v141ui$rcfn$2@dont-email.me>
<87plu14zrw.fsf@tudado.org> <v15hb0$17gl0$1@dont-email.me>
<20240504075349.523@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Sun, 05 May 2024 01:23:42 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c474d167924119b081aef87d557899dd";
logging-data="1538049"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/FaMUI7AKAwjJxjvEUWWp3El5xvnF4SRI="
Cancel-Lock: sha1:N85LREFgdeGtHd4czs74/LEmF7I=
sha1:fHi1ypT85Q7qGItHEu82ta5QVgc=
 by: Johanne Fairchild - Sat, 4 May 2024 23:23 UTC

Kaz Kylheku <643-408-1753@kylheku.com> writes:

> On 2024-05-04, Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
>> A hardlink introduces an undetectable cyclicity in the underlying filesystem.
>
> You mean, trouble some cyclicity that is detectable with a lot of
> annoying fuss, that has to be done wherever the filesystem is being
> recursively traversed.
>
>> It must reference an inode within a specific filesystem (and, thus, cannot
>> cross filesystems or mountpoints), and (unlike softlinks) has no other
>> distinguishing feature. This means that you can only determine if a
>> /directory/ hardlink has introduced a cyclical reference by actually
>> traversing the hardlinked directory structures until you return to the
>> starting link.
>
> If you keep the path of inodes you have visited in order to reach a
> certain directory, then you can detect a cycle by checking whether a
> newly visited directory is one of the elements of the path. Since
> paths are reasonably short, you don't need any fancy hash data structure
> for this; a linear scan will work fine in most cases, and so you can
> represent the path as a linked list that is allocated on the stack,
> if working in C.
>
> void recurse(..., visited_node *parent)
> {
> visited_node current = { .up = parent };
> // ...
> }
>
> The cyclic check is simply chasing the parent->up pointers to see if any
> of the visited nodes is the same object as the newly visited one.
>
> The problem is:
>
> 1. Everything that performs traversals of the filesystem now *has* to do
> this, or risk being stuck in a loop. There is a bad habit in the
> Unix programming culture of people rolling their own filesystem
> traversal functions. Some of them would get it wrong, ending up in
> infinite loops.
>
> 2. Even if you have cycle detection, you still have the problem that
> every recursive traversal performed anywhere runs the risk of
> potentially visiting the entire filesystem!
>
> Directory hard links could be restricted to being downward-only. So that
> is to say, if you create a P/C -> D hard link, then X is required to be
> a descendant of P, such as P/X/Y/D.
>
> To check that without race conditions, the kernel would have to lock
> down all operations on that filesystem during the link operation.
> Starting at D, it could navigate the parent .. links until it hits
> the root directory, P, or hits a mount point crossing. If it finds P,
> then it can conclude that the link can be made. (Without TOCtoTOU
> if things are properly locked down.)
>
> Holding a lock over a complex operation like that could open an avenue
> to a DOS attack against the filesystem. Imagine a swarm of threads doing
> directory linking operations, causing that lock to be excessively held.
>
> The descendant restriction would make directory hardlinks inapplicable
> to some people's use cases. (Oh well, they'd have to use symlinks
> for those situations.)

Thanks very much Lew Pitcher and Kaz Kylheku for the lecture. (Ignore
my previous post on the thread asking further. It's all clear now.)

Re: Linux mount: What is the opposite of "nosuid" ?

<871q6h17pz.fsf@tudado.org>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=4203&group=comp.unix.programmer#4203

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jfairchild@tudado.org (Johanne Fairchild)
Newsgroups: comp.unix.programmer
Subject: Re: Linux mount: What is the opposite of "nosuid" ?
Date: Sat, 04 May 2024 20:24:24 -0300
Organization: A noiseless patient Spider
Lines: 40
Message-ID: <871q6h17pz.fsf@tudado.org>
References: <uvuae7$3vtqg$1@news.xmission.com> <uvud53$30gsv$1@dont-email.me>
<uvukqn$3p9$1@news.xmission.com> <uvvcrr$3euft$2@dont-email.me>
<87r0ezmt6h.fsf@bsb.me.uk> <v034vi$assg$1@dont-email.me>
<v0moj7$1arr4$5@dont-email.me> <v12on9$ihfm$6@dont-email.me>
<v137f0$l6ll$1@dont-email.me> <v141ui$rcfn$2@dont-email.me>
<87plu14zrw.fsf@tudado.org> <v15gcp$18g38$1@dont-email.me>
<87h6fd180o.fsf@tudado.org>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Sun, 05 May 2024 01:24:26 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c474d167924119b081aef87d557899dd";
logging-data="1538049"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX192D1AMzmBydB/OTWnmFYRahkJyZCmw5Kg="
Cancel-Lock: sha1:vXGtsP1ooe/nmJjI/iLTPeGSYNU=
sha1:6cqRfV68LBkjUTJw2ai6J1a4A1M=
 by: Johanne Fairchild - Sat, 4 May 2024 23:24 UTC

Johanne Fairchild <jfairchild@tudado.org> writes:

> Muttley@dastardlyhq.com writes:
>
>> On Sat, 04 May 2024 07:50:11 -0300
>> Johanne Fairchild <jfairchild@tudado.org> wrote:
>>>Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>>>
>>>> On Fri, 3 May 2024 17:38:40 -0000 (UTC), vallor wrote:
>>>>
>>>>> On Fri, 3 May 2024 13:27:05 -0000 (UTC), candycanearter07
>>>>> <candycanearter07@candycanearter07.nomail.afraid> wrote in
>>>>> <v12on9$ihfm$6@dont-email.me>:
>>>>>
>>>>>> ... you can't hard link directories.
>>>>>
>>>>> Sometimes, you can, depending on OS and filesystem:
>>>>>
>>>>> https://jameshunt.us/writings/linking-dirs-in-macos/
>>>>>
>>>>> IIRC, Apple's Time Machine uses this capability.
>>>>>
>>>>> BTW, I'm not mentioning this because I think it's a good idea;
>>>>> the Unix puritan in me abhors hard-linked directories.
>>>>
>>>> They are a very, very, very, very bad idea. And completely unnecessary.
>>>
>>>Why are they a bad idea? Can you show examples? I can't see it. Thanks!
>>
>> Probably because there isn't much point (not that IMO there's much point to
>> hard links anyway) as when you delete the directory you'll delete all the
>> files inside but the now empty directory will still exist wherever
>> its hard link
>> is.
>
> Oh, I see. And if we were to fix this by removing the directory as well
> in the two or more places it was linked to? Wouldn't it be useful as a
> single directory that has two absolute paths? That seems useful to me.

Scratch all that. I should've read the entire subthread before asking.


devel / comp.unix.programmer / Re: Linux mount: What is the opposite of "nosuid" ?

Pages:12
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor