9front - general discussion about 9front
 help / color / mirror / Atom feed
From: ori@eigenstate.org
To: 9front@9front.org
Subject: Re: [9front] [PATCH] Permissions for child boards in /srv
Date: Sat, 02 Jul 2022 17:25:34 -0400	[thread overview]
Message-ID: <767DB82332D40F4FCBDC0BF96384869C@eigenstate.org> (raw)
In-Reply-To: <88b93657-5d28-2309-4e43-0cba952fdf20@posixcafe.org>

Quoth Jacob Moody <moody@mail.posixcafe.org>:
> 
> Here's the patch in total now against the now reverted version
> in tree, happy to provide more context. Since this is more or less
> a full rewrite, I've included the full devsrv.c as an attachment if
> that is easier to dig through.
> 

Applied this on shithub, let's see if the front falls off.

I'll also be putting together some code to make more use
of it. Maybe we also want auth/box to grow a way of
running with a private /srv? Maybe even unconditionally?

Something like:

diff d457233c70ef6aa28861dd2978e92968ffba0920 uncommitted
--- a/sys/src/cmd/auth/box.c
+++ b/sys/src/cmd/auth/box.c
@@ -145,11 +145,11 @@
 {
 	char *b;
 	Dir *d;
-	char devs[1024];
-	int dfd;
+	char devs[1024], srvname[24], srvpath[32];
+	int dfd, sfd;
 	char *parts[256];
 	int mflags[256];
-	int nparts;
+	int n, nparts;
 
 	nparts = 0;
 	memset(devs, 0, sizeof devs);
@@ -192,6 +192,14 @@
 
 	rfork(RFNAMEG|RFFDG);
 	skelfs();
+	sfd = open("/srv/clone", OREAD);
+	if(sfd < 0)
+		sysfatal("could not open /srv/clone: %r");
+	if((n = read(sfd, srvname, sizeof(srvname))) == -1)
+		sysfatal("could not read srv id: %r");
+	snprint(srvpath, sizeof(srvpath), "/srv/%.*s", n, srvname);
+	if(bind(srvpath, "/srv", MREPL) < 0)
+		sysfatal("could not bind %s: %r", srvpath);
 	dfd = open("/dev/drivers", OWRITE|OCEXEC);
 	if(dfd < 0)
 		sysfatal("could not /dev/drivers: %r");


      reply	other threads:[~2022-07-02 21:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-24 14:34 Jacob Moody
2022-06-25  3:49 ` Jacob Moody
2022-06-29 14:53   ` Jacob Moody
2022-06-29 16:35     ` cinap_lenrek
2022-06-29 16:42       ` Jacob Moody
2022-06-29 16:46         ` ori
2022-06-29 17:12           ` hiro
2022-06-29 17:20         ` cinap_lenrek
2022-06-29 17:50           ` Jacob Moody
2022-07-02 21:25             ` ori [this message]

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=767DB82332D40F4FCBDC0BF96384869C@eigenstate.org \
    --to=ori@eigenstate.org \
    --cc=9front@9front.org \
    /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 NNTP newsgroup(s).