Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"I've seen it. It's rubbish." -- Marvin the Paranoid Android


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
Re: Linux mount: What is the opposite of "nosuid" ?

<wwvedagll9g.fsf@LkoBDZeT.terraraq.uk>

  copy mid

https://news.novabbs.com/devel/article-flat.php?id=11882&group=comp.unix.programmer#11882

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!nntp.terraraq.uk!.POSTED.tunnel.sfere.anjou.terraraq.org.uk!not-for-mail
From: inva...@invalid.invalid (Richard Kettlewell)
Newsgroups: comp.unix.programmer
Subject: Re: Linux mount: What is the opposite of "nosuid" ?
Date: Sun, 05 May 2024 09:23:55 +0100
Organization: terraraq NNTP server
Message-ID: <wwvedagll9g.fsf@LkoBDZeT.terraraq.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>
<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> <v16do4$1ejcv$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: innmantic.terraraq.uk; posting-host="tunnel.sfere.anjou.terraraq.org.uk:172.17.207.6";
logging-data="63581"; mail-complaints-to="usenet@innmantic.terraraq.uk"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:WD0gP2IRSMXexA0IWIKgp/dVrv8=
X-Face: h[Hh-7npe<<b4/eW[]sat,I3O`t8A`(ej.H!F4\8|;ih)`7{@:A~/j1}gTt4e7-n*F?.Rl^
F<\{jehn7.KrO{!7=:(@J~]<.[{>v9!1<qZY,{EJxg6?Er4Y7Ng2\Ft>Z&W?r\c.!4DXH5PWpga"ha
+r0NzP?vnz:e/knOY)PI-
X-Boydie: NO
 by: Richard Kettlewell - Sun, 5 May 2024 08:23 UTC

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
> Johanne Fairchild wrote:
>> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>>> 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?

Multiple cycle-detection algorithms have been well known for decades.

> * What happens if you don’t?

Something gets stuck in a loop.

In the hypothetical where hard-link directories was possible, filesystem
traversers would have to take into account the possibility of
cycles. It’d be an extra implementation detail, comparable to the way
real ones have to take into account the possibility of the filesystem
changing as they progress, or accept with the consequences if they
don’t.

You’re on stronger grounds with “unnecessary” but a three-very bad idea?
Insufficient evidence at best.

--
https://www.greenend.org.uk/rjk/

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

<v17g26$1onvc$1@dont-email.me>

  copy mid

https://news.novabbs.com/devel/article-flat.php?id=11883&group=comp.unix.programmer#11883

  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: Sun, 5 May 2024 08:29:59 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <v17g26$1onvc$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> <v16do4$1ejcv$1@dont-email.me>
<wwvedagll9g.fsf@LkoBDZeT.terraraq.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 05 May 2024 10:29:59 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="33a041cd80492abf930d5e0c5f5526b9";
logging-data="1859564"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18V6GkCN38URgG/ve9a7ALN"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:LsmnkM7QFJBG+ae20EwDYjuDhsk=
 by: Lawrence D'Oliv - Sun, 5 May 2024 08:29 UTC

On Sun, 05 May 2024 09:23:55 +0100, Richard Kettlewell wrote:

> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>
>> * How do you detect reference cycles?
>
> Multiple cycle-detection algorithms have been well known for decades.

How many directories would you have to lock down while checking for cycles?

How deep can your directory tree go?

>> * What happens if you don’t?
>
> Something gets stuck in a loop.
>
> ...
>
> You’re on stronger grounds with “unnecessary” but a three-very bad idea?
> Insufficient evidence at best.

You think getting “stuck in a loop” is not a bad idea?

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

<v17jr0$jmo5$1@news.xmission.com>

  copy mid

https://news.novabbs.com/devel/article-flat.php?id=11884&group=comp.unix.programmer#11884

  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: gaze...@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.unix.programmer
Subject: Re: Linux mount: What is the opposite of "nosuid" ?
Date: Sun, 5 May 2024 09:34:24 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <v17jr0$jmo5$1@news.xmission.com>
References: <uvuae7$3vtqg$1@news.xmission.com> <v16do4$1ejcv$1@dont-email.me> <wwvedagll9g.fsf@LkoBDZeT.terraraq.uk> <v17g26$1onvc$1@dont-email.me>
Injection-Date: Sun, 5 May 2024 09:34:24 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="645893"; 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, 5 May 2024 09:34 UTC

In article <v17g26$1onvc$1@dont-email.me>,
Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
....
>> You're on stronger grounds with unnecessary but a three-very bad idea?
>> Insufficient evidence at best.
>
>You think getting stuck in a loop is not a bad idea?

It *might* be a "bad idea", but it is hardly a damn, damn, damn bad idea.

--
The single most important statistic in the US today - the one that explains all the
others - is this: 63 million people thought it was a good idea to vote for this clown
(and will probably do so again). Everything else is secondary to that. Everything else
could be fixed if we can revert this one statistic. Nothing can be fixed until we do.

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

<slrnv3eu7b.88o.andrews@sdf.org>

  copy mid

https://news.novabbs.com/devel/article-flat.php?id=11885&group=comp.unix.programmer#11885

  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: andr...@sdf.org (Andrew Smallshaw)
Newsgroups: comp.unix.programmer
Subject: Re: Linux mount: What is the opposite of "nosuid" ?
Date: Sun, 5 May 2024 12:17:48 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <slrnv3eu7b.88o.andrews@sdf.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> <v15htf$17gl0$2@dont-email.me>
<v16drh$1ejcv$2@dont-email.me>
Injection-Date: Sun, 05 May 2024 14:17:49 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="15924d50f734f781a611587c2ceb7fad";
logging-data="1947217"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19KVbW+2P0mim1P/cp7rSXq3LOLQuxZXMY="
User-Agent: slrn/1.0.3 (Patched for libcanlock3) (NetBSD)
Cancel-Lock: sha1:3JJF+pdfdNZAQbbd3z6HlUgzmpE=
 by: Andrew Smallshaw - Sun, 5 May 2024 12:17 UTC

On 2024-05-04, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
> 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.

But they're not: it goes to the core of the Unix "everything is a
file" philosophy. Applications can and do read directories as
regular files and extract the parent from them. No on DOS/Windows,
you can't do that, you have to use a specific syscall. It's not
"completely unnecessary", just a different way of acheiving the
same effect.

--
Andrew Smallshaw
andrews@sdf.org

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

<20240505071604.263@kylheku.com>

  copy mid

https://news.novabbs.com/devel/article-flat.php?id=11886&group=comp.unix.programmer#11886

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!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: 643-408-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.unix.programmer
Subject: Re: Linux mount: What is the opposite of "nosuid" ?
Date: Sun, 5 May 2024 14:25:30 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 39
Message-ID: <20240505071604.263@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> <v15htf$17gl0$2@dont-email.me>
<v16drh$1ejcv$2@dont-email.me> <slrnv3eu7b.88o.andrews@sdf.org>
Injection-Date: Sun, 05 May 2024 16:25:31 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c0a2417f6d6a84c52cd91d4c35f44136";
logging-data="2007789"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19NHWKU0D0kn0QnnZ3qAUfr64dA9+228zI="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:OXqeE/SbAbrpi+azYZdpruuzuto=
 by: Kaz Kylheku - Sun, 5 May 2024 14:25 UTC

On 2024-05-05, Andrew Smallshaw <andrews@sdf.org> wrote:
> On 2024-05-04, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
>> 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.
>
> But they're not: it goes to the core of the Unix "everything is a
> file" philosophy. Applications can and do read directories as
> regular files and extract the parent from them.

Can you name one such application? Just as a warm up; then two more.

> No on DOS/Windows,
> you can't do that, you have to use a specific syscall. It's not
> "completely unnecessary", just a different way of acheiving the
> same effect.

No, you can't just read a directory as a flat file, and expect your
program to work on any file system.

Modern (as in within the last 40 years) Unixes support multiple file
systems including DOS. The directory representation is different in
different file systems. Some use B-trees and hash tables and whatnot.

On the Linux kernel, reading from a file descriptor that refers to a
directory is not allowed; it fails with errno == EISDIR. (Not sure
whether that's at the VFS layer, or whether specific filesystems refuse
that individually.)

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

Taking things too literally (Was: Linux mount: What is the opposite of "nosuid" ?)

<v1862h$jtpp$1@news.xmission.com>

  copy mid

https://news.novabbs.com/devel/article-flat.php?id=11887&group=comp.unix.programmer#11887

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!rocksolid2!news.nk.ca!news.snarked.org!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gaze...@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.unix.programmer
Subject: Taking things too literally (Was: Linux mount: What is the opposite of "nosuid" ?)
Date: Sun, 5 May 2024 14:45:37 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <v1862h$jtpp$1@news.xmission.com>
References: <uvuae7$3vtqg$1@news.xmission.com> <v16drh$1ejcv$2@dont-email.me> <slrnv3eu7b.88o.andrews@sdf.org> <20240505071604.263@kylheku.com>
Injection-Date: Sun, 5 May 2024 14:45:37 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="653113"; 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, 5 May 2024 14:45 UTC

In article <20240505071604.263@kylheku.com>,
Kaz Kylheku <643-408-1753@kylheku.com> wrote:
....
>>> 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.
>>
>> But they're not: it goes to the core of the Unix "everything is a
>> file" philosophy. Applications can and do read directories as
>> regular files and extract the parent from them.
>
>Can you name one such application? Just as a warm up; then two more.

I think you're taking him too literally. There are interfaces for reading
directories. Not specifically read(2), but you know better than to pick
nits that way.

>> No on DOS/Windows,
>> you can't do that, you have to use a specific syscall. It's not
>> "completely unnecessary", just a different way of acheiving the
>> same effect.
>
>No, you can't just read a directory as a flat file, and expect your
>program to work on any file system.

He never used the term "flat file". That is *your* construct.

--
I voted for Trump because I thought he'd make pussy grabbing legal.
I honestly don't see any other way America could be made great again.

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

<wwvle4ojopp.fsf@LkoBDZeT.terraraq.uk>

  copy mid

https://news.novabbs.com/devel/article-flat.php?id=11888&group=comp.unix.programmer#11888

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!news.nntp4.net!nntp.terraraq.uk!.POSTED.tunnel.sfere.anjou.terraraq.org.uk!not-for-mail
From: inva...@invalid.invalid (Richard Kettlewell)
Newsgroups: comp.unix.programmer
Subject: Re: Linux mount: What is the opposite of "nosuid" ?
Date: Sun, 05 May 2024 15:52:18 +0100
Organization: terraraq NNTP server
Message-ID: <wwvle4ojopp.fsf@LkoBDZeT.terraraq.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>
<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> <v16do4$1ejcv$1@dont-email.me>
<wwvedagll9g.fsf@LkoBDZeT.terraraq.uk> <v17g26$1onvc$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: innmantic.terraraq.uk; posting-host="tunnel.sfere.anjou.terraraq.org.uk:172.17.207.6";
logging-data="69135"; mail-complaints-to="usenet@innmantic.terraraq.uk"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:TAebld29U8qEGHXW61nZdB+yT4Y=
X-Face: h[Hh-7npe<<b4/eW[]sat,I3O`t8A`(ej.H!F4\8|;ih)`7{@:A~/j1}gTt4e7-n*F?.Rl^
F<\{jehn7.KrO{!7=:(@J~]<.[{>v9!1<qZY,{EJxg6?Er4Y7Ng2\Ft>Z&W?r\c.!4DXH5PWpga"ha
+r0NzP?vnz:e/knOY)PI-
X-Boydie: NO
 by: Richard Kettlewell - Sun, 5 May 2024 14:52 UTC

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
> Richard Kettlewell wrote:
>> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>>> * How do you detect reference cycles?
>>
>> Multiple cycle-detection algorithms have been well known for decades.
>
> How many directories would you have to lock down while checking for cycles?

Could be as little as 2. Depends on the algorithm used, what else you
can assume about the filesystem, etc.

> How deep can your directory tree go?
>
>>> * What happens if you don’t?
>>
>> Something gets stuck in a loop.
>>
>> ...
>>
>> You’re on stronger grounds with “unnecessary” but a three-very bad idea?
>> Insufficient evidence at best.
>
> You think getting “stuck in a loop” is not a bad idea?

I think my previous posting adequately covers this question.

--
https://www.greenend.org.uk/rjk/

Re: Taking things too literally (Was: Linux mount: What is the opposite of "nosuid" ?)

<20240505112347.279@kylheku.com>

  copy mid

https://news.novabbs.com/devel/article-flat.php?id=11889&group=comp.unix.programmer#11889

  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: 643-408-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.unix.programmer
Subject: Re: Taking things too literally (Was: Linux mount: What is the
opposite of "nosuid" ?)
Date: Sun, 5 May 2024 18:28:33 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 50
Message-ID: <20240505112347.279@kylheku.com>
References: <uvuae7$3vtqg$1@news.xmission.com>
<v16drh$1ejcv$2@dont-email.me> <slrnv3eu7b.88o.andrews@sdf.org>
<20240505071604.263@kylheku.com> <v1862h$jtpp$1@news.xmission.com>
Injection-Date: Sun, 05 May 2024 20:28:34 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c0a2417f6d6a84c52cd91d4c35f44136";
logging-data="2108981"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+EmJnGwO7lq6mzdLORWsB8ty9WVQ8KfVM="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:KbqVdTUH8uZ91u1EgQ8PJNoXY9E=
 by: Kaz Kylheku - Sun, 5 May 2024 18:28 UTC

On 2024-05-05, Kenny McCormack <gazelle@shell.xmission.com> wrote:
> In article <20240505071604.263@kylheku.com>,
> Kaz Kylheku <643-408-1753@kylheku.com> wrote:
> ...
>>>> 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.
>>>
>>> But they're not: it goes to the core of the Unix "everything is a
>>> file" philosophy. Applications can and do read directories as
>>> regular files and extract the parent from them.
>>
>>Can you name one such application? Just as a warm up; then two more.
>
> I think you're taking him too literally. There are interfaces for reading
> directories. Not specifically read(2), but you know better than to pick
> nits that way.
>
>>> No on DOS/Windows,
>>> you can't do that, you have to use a specific syscall. It's not
>>> "completely unnecessary", just a different way of acheiving the
>>> same effect.
>>
>>No, you can't just read a directory as a flat file, and expect your
>>program to work on any file system.
>
> He never used the term "flat file". That is *your* construct.

I don't believe you are correct; read the original points again.
They are all quoted above, nothing snipped:

- "Applications [on Unix] can and do read directories as
regular files."

(Regular files are flat: just bytes, so it is legitimate for me to use
that word. That detail is neither here nor there anyway. You can't
read a directory even if you know how to follow its tree structure
or whatever it happens to be.)

- "[O]n DOS/Windows [...] you can't do that, you have to use
a specific syscall."

(That lands under "interfacws for reading directories" that you
allude to. So no, we don't just have to use those on Windows.)

--
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" ?

<v18ps8$21u38$2@dont-email.me>

  copy mid

https://news.novabbs.com/devel/article-flat.php?id=11890&group=comp.unix.programmer#11890

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!news.swapon.de!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: Sun, 5 May 2024 20:23:37 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <v18ps8$21u38$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> <v16drh$1ejcv$2@dont-email.me>
<slrnv3eu7b.88o.andrews@sdf.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 05 May 2024 22:23:37 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="33a041cd80492abf930d5e0c5f5526b9";
logging-data="2160744"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19y6jpXJk8KWkDAwsp3FfZo"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:VF2e0fNxb26wye4FoHJYPsIiPUI=
 by: Lawrence D'Oliv - Sun, 5 May 2024 20:23 UTC

On Sun, 5 May 2024 12:17:48 -0000 (UTC), Andrew Smallshaw wrote:

> On 2024-05-04, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
>
>> 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.
>
> But they're not: it goes to the core of the Unix "everything is a
> file" philosophy. Applications can and do read directories as
> regular files and extract the parent from them.

How do they find those directories? Via their pathname. How do you get a
parent from a pathname? Simple: just drop off the last component. No need
to even read anything from the directory.

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

<v19484$nnj$1@reader1.panix.com>

  copy mid

https://news.novabbs.com/devel/article-flat.php?id=11891&group=comp.unix.programmer#11891

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!weretis.net!feeder9.news.weretis.net!panix!.POSTED.spitfire.i.gajendra.net!not-for-mail
From: cro...@spitfire.i.gajendra.net (Dan Cross)
Newsgroups: comp.unix.programmer
Subject: Re: Linux mount: What is the opposite of "nosuid" ?
Date: Sun, 5 May 2024 23:20:36 -0000 (UTC)
Organization: PANIX Public Access Internet and UNIX, NYC
Message-ID: <v19484$nnj$1@reader1.panix.com>
References: <uvuae7$3vtqg$1@news.xmission.com> <v16drh$1ejcv$2@dont-email.me> <slrnv3eu7b.88o.andrews@sdf.org> <20240505071604.263@kylheku.com>
Injection-Date: Sun, 5 May 2024 23:20:36 -0000 (UTC)
Injection-Info: reader1.panix.com; posting-host="spitfire.i.gajendra.net:166.84.136.80";
logging-data="24307"; mail-complaints-to="abuse@panix.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: cross@spitfire.i.gajendra.net (Dan Cross)
 by: Dan Cross - Sun, 5 May 2024 23:20 UTC

In article <20240505071604.263@kylheku.com>,
Kaz Kylheku <643-408-1753@kylheku.com> wrote:
>On 2024-05-05, Andrew Smallshaw <andrews@sdf.org> wrote:
>> On 2024-05-04, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
>>> 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.
>>
>> But they're not: it goes to the core of the Unix "everything is a
>> file" philosophy. Applications can and do read directories as
>> regular files and extract the parent from them.
>
>Can you name one such application? Just as a warm up; then two more.

Depends on the version of Unix. I'll pick 7th Ed. Here's three
programs that could: `cat`, `dd`, and `od`. Of course, that's
not what you mean, bt I think it's related.

>> No on DOS/Windows,
>> you can't do that, you have to use a specific syscall. It's not
>> "completely unnecessary", just a different way of acheiving the
>> same effect.
>
>No, you can't just read a directory as a flat file, and expect your
>program to work on any file system.
>
>Modern (as in within the last 40 years) Unixes support multiple file
>systems including DOS. The directory representation is different in
>different file systems. Some use B-trees and hash tables and whatnot.
>
>On the Linux kernel, reading from a file descriptor that refers to a
>directory is not allowed; it fails with errno == EISDIR. (Not sure
>whether that's at the VFS layer, or whether specific filesystems refuse
>that individually.)

Sure. But by the time that sort of support for multiple
filesystem types came around, the structure of many Unix file
systems (with hard links for "." and "..") had already existed,
and there was desire to retain compatibility with existing
on-disk filesystem images. So even though the landscape is
radically different now, as you describe, history got us here.

Btw, the bigger reason that hardlinks to directories are
prohibited isn't because file tree walkers would have to be
rewritten to take care when transversing such filesystems, but
rather because automated filesystem checkers like `fsck` would
have to be a _lot_ more sophisticated to cope, and they have
the potential to do real, significant damage if they get it
wrong.

- Dan C.

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

<v190ff$23ioi$1@dont-email.me>

  copy mid

https://news.novabbs.com/devel/article-flat.php?id=11892&group=comp.unix.programmer#11892

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!rocksolid2!news.neodome.net!news.mixmin.net!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: Sun, 5 May 2024 22:16:15 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <v190ff$23ioi$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> <v16do4$1ejcv$1@dont-email.me>
<wwvedagll9g.fsf@LkoBDZeT.terraraq.uk> <v17g26$1onvc$1@dont-email.me>
<wwvle4ojopp.fsf@LkoBDZeT.terraraq.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 06 May 2024 00:16:15 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="5a5e5419d741772afcc61781addc791b";
logging-data="2214674"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/xL8aodCltQ98Hf01mWMP/"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:tMEgRDCI7l77TmGnztj66L7juhY=
 by: Lawrence D'Oliv - Sun, 5 May 2024 22:16 UTC

On Sun, 05 May 2024 15:52:18 +0100, Richard Kettlewell wrote:

> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>
>> You think getting “stuck in a loop” is not a bad idea?
>
> [Non-answer]

Consider three directories A, B and C which point to each other like this:

A → B ↔ C

Note this: the refcount of (number of pointers to) B is 2, and that of C
is 1.

Now consider what happens if B is removed from A. Its refcount goes to 1,
so it is not deleted.

B ↔ C

But there is no way to access it! There are no other pointers to either B
or C, so both of them are now effectively lost as far as users are
concerned--yet their space cannot be reclaimed (or that of any items that
might be in them).

Not, that is, unless you run some kind of “garbage collection” pass over
the filesystem, to reclaim orphaned storage. Filesystems are not typically
designed with this sort of requirement in mind. Wonder why?

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

<wwv7cg4rdnk.fsf@LkoBDZeT.terraraq.uk>

  copy mid

https://news.novabbs.com/devel/article-flat.php?id=11893&group=comp.unix.programmer#11893

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!nntp.terraraq.uk!.POSTED.tunnel.sfere.anjou.terraraq.org.uk!not-for-mail
From: inva...@invalid.invalid (Richard Kettlewell)
Newsgroups: comp.unix.programmer
Subject: Re: Linux mount: What is the opposite of "nosuid" ?
Date: Wed, 08 May 2024 08:00:47 +0100
Organization: terraraq NNTP server
Message-ID: <wwv7cg4rdnk.fsf@LkoBDZeT.terraraq.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>
<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> <v16do4$1ejcv$1@dont-email.me>
<wwvedagll9g.fsf@LkoBDZeT.terraraq.uk> <v17g26$1onvc$1@dont-email.me>
<wwvle4ojopp.fsf@LkoBDZeT.terraraq.uk> <v190ff$23ioi$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: innmantic.terraraq.uk; posting-host="tunnel.sfere.anjou.terraraq.org.uk:172.17.207.6";
logging-data="48478"; mail-complaints-to="usenet@innmantic.terraraq.uk"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:cYG5yz3/GWX9Xegd7FkOwh7PH+M=
X-Face: h[Hh-7npe<<b4/eW[]sat,I3O`t8A`(ej.H!F4\8|;ih)`7{@:A~/j1}gTt4e7-n*F?.Rl^
F<\{jehn7.KrO{!7=:(@J~]<.[{>v9!1<qZY,{EJxg6?Er4Y7Ng2\Ft>Z&W?r\c.!4DXH5PWpga"ha
+r0NzP?vnz:e/knOY)PI-
X-Boydie: NO
 by: Richard Kettlewell - Wed, 8 May 2024 07:00 UTC

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
> Not, that is, unless you run some kind of “garbage collection” pass over
> the filesystem, to reclaim orphaned storage. Filesystems are not typically
> designed with this sort of requirement in mind. Wonder why?

Again, the techniques are well understood; GC has been used in other
contexts for decades. In general you can’t reliably infer from something
not being done that it would be a bad idea, merely that it hasn’t proved
necessary.

--
https://www.greenend.org.uk/rjk/

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

<v1fd81$3rs2d$1@dont-email.me>

  copy mid

https://news.novabbs.com/devel/article-flat.php?id=11894&group=comp.unix.programmer#11894

  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: Wed, 8 May 2024 08:30:57 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <v1fd81$3rs2d$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> <v16do4$1ejcv$1@dont-email.me>
<wwvedagll9g.fsf@LkoBDZeT.terraraq.uk> <v17g26$1onvc$1@dont-email.me>
<wwvle4ojopp.fsf@LkoBDZeT.terraraq.uk> <v190ff$23ioi$1@dont-email.me>
<wwv7cg4rdnk.fsf@LkoBDZeT.terraraq.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 08 May 2024 10:30:57 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="1822188738f589222356150800fb9063";
logging-data="4059213"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18HiW1+zbiA0EA1XPFyxcbv"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:xwkLZT9qix2MFWL0KgadAAt3GhQ=
 by: Lawrence D'Oliv - Wed, 8 May 2024 08:30 UTC

On Wed, 08 May 2024 08:00:47 +0100, Richard Kettlewell wrote:

> GC has been used in other contexts for decades. In general you can’t
> reliably infer from something not being done that it would be a bad
> idea ...

Hint: think about what’s different about filesystems versus management of
main memory.


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