From: Bengt Richter <bokr@bokr.com>
To: divoplade <d@divoplade.fr>
Cc: 44186@debbugs.gnu.org, zimoun <zimon.toutoune@gmail.com>
Subject: bug#44186: Recursive mkdir
Date: Sun, 25 Oct 2020 05:13:50 +0100 [thread overview]
Message-ID: <20201025041350.GA14747@LionPure> (raw)
In-Reply-To: <1a7ae91ae083eecc3ab1043e8ed571bfe972c3a4.camel@divoplade.fr>
Hi divoplade,
On +2020-10-24 08:17:47 +0200, divoplade wrote:
> Hello,
>
> Le samedi 24 octobre 2020 à 01:32 +0200, Bengt Richter a écrit :
> > An alternate solution could be programmed using ffi, as documented in
> > [1], n'est-ce pas?
> To be clear, you would rather have that function as guile code rather
> than extending the C function? I'm OK with that, but in which file
> should I put that function? My instinct was to put the code near the
> mkdir function, and that happened to be in a C file, so I went C.
>
Seems logical, and probably where I'd go, but please be careful!
Don't make a C version of this hack:
┌───────────────────────────────────────────────────────────────────────────────┐
│ (define (my-mkdir-p path . ignore) (system (string-append "mkdir -p " path))) │
└───────────────────────────────────────────────────────────────────────────────┘
You can then write (my-mkdir-p "foo-dir/bar-dir") and it'll do the job.
But it's definitely safer to skip the hack and write
┌─────────────────────────────────────┐
│ (system "mkdir -p foo-dir/bar-dir") │
└─────────────────────────────────────┘
and not give anything a chance to inject something bad via unsanitized parameters.
E.g.,
┌─────────────────────────────────────┐
│ (my-mkdir-p "here/below;tree here") │
│ here │
│ └── below │
└─────────────────────────────────────┘
It does the intended, so no suspicous change in that part, and
my-mkdir-p looks innocent enough. (Did you notice the danger? ;)
Well, introducing something like this, but more subtle,
could be the first move by a mole working for
<insert favorite bogeyman organization>
to compromise or disrupt/discredit GNU FLOSS competition.
Is that unhappy thought too paranoid?
I hope so, but I'm not convinced ;/
> > What would guix best-practice guidance say about that?
> I'm not sure to follow, now this is a guile matter, guix has nothing to
> do about it. I'm sorry I messed a few things up with the mailing lists
> (I should have listened to them, "don't cross the streams"). Could you
> elaborate?
>
Sorry, you are right: it does become a guile matter, but...
... it also becomes part of guix if it's part of the guile version
a guix version depends on, so thereby it becomes a guix quality/security item
to be careful about.
So I was wondering whether guix architects have preferences
for where and how a function should be implemented, all things considered.
> Best regards,
>
> divoplade
>
--
Regards,
Bengt Richter
next prev parent reply other threads:[~2020-10-25 4:13 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <6ff632f5c1e378647cecc7177b7018fb8a0ee6d4.camel@divoplade.fr>
[not found] ` <86sga420pw.fsf@gmail.com>
2020-10-23 22:00 ` bug#44186: Recursive mkdir divoplade
2020-10-23 22:07 ` zimoun
2020-10-23 23:32 ` Bengt Richter
2020-10-24 6:17 ` divoplade
2020-10-25 4:13 ` Bengt Richter [this message]
2020-10-25 7:45 ` Ricardo Wurmus
2020-10-25 9:07 ` divoplade
2020-10-25 10:44 ` divoplade
[not found] ` <handler.44186.B.16034904223692.ack@debbugs.gnu.org>
2020-10-23 22:46 ` divoplade
2020-10-26 21:05 ` Leo Prikler
2020-10-27 7:01 ` divoplade
2020-10-27 9:19 ` Leo Prikler
2020-10-27 10:21 ` divoplade
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201025041350.GA14747@LionPure \
--to=bokr@bokr.com \
--cc=44186@debbugs.gnu.org \
--cc=d@divoplade.fr \
--cc=zimon.toutoune@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).