9front - general discussion about 9front
 help / color / mirror / Atom feed
From: ori@eigenstate.org
To: 9front@9front.org
Subject: Re: [9front] user none: cwfs vs hjfs
Date: Thu, 21 Jan 2021 08:22:19 -0800	[thread overview]
Message-ID: <154A2B81E5307985989F46BE958ACBAC@eigenstate.org> (raw)
In-Reply-To: <YAdV+yLpy9swIBlT@alice>

Quoth Anthony Martin <ality@pbrane.org>:
> /sys/src/cmd/cwfs/sub.c:/^iaccess
> /sys/src/cmd/hjfs/auth.c:/^permcheck
> /sys/src/cmd/fossil/9p.c:/^permFile
> 
> Hjfs is the odd man out.
> 
> Cheers,
>   Anthony

Unfortunately I can't test, since I don't currently
have hjfs -- but I think this change brings hjfs
in sync.

diff -r 01125acb5565 sys/src/cmd/hjfs/auth.c
--- a/sys/src/cmd/hjfs/auth.c	Tue Jan 19 19:56:38 2021 -0800
+++ b/sys/src/cmd/hjfs/auth.c	Thu Jan 21 08:21:34 2021 -0800
@@ -301,10 +301,13 @@
 	if((fs->flags & FSNOPERM) != 0)
 		return 1;
 	perm = d->mode & 0777;
-	if(d->uid == uid)
-		perm >>= 6;
-	else if(ingroup(fs, uid, d->gid, 0))
-		perm >>= 3;
+	/* uid none gets only other permissions */
+	if(d->uid != 0) {
+		if(d->uid == uid)
+			perm >>= 6;
+		else if(ingroup(fs, uid, d->gid, 0))
+			perm >>= 3;
+	}
 	switch(mode & 3){
 	case OREAD:
 		return (perm & 4) != 0;


  reply	other threads:[~2021-01-21 16:51 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-19 20:16 Stanley Lieber
2021-01-19 20:36 ` hiro
2021-01-19 20:51 ` Silas McCroskey
2021-01-19 20:57   ` Silas McCroskey
2021-01-19 21:35     ` Stanley Lieber
2021-01-19 21:54       ` hiro
2021-01-19 21:58         ` Anthony Martin
2021-01-21 16:22           ` ori [this message]
2021-01-21 17:05             ` sirjofri
2021-01-21 17:36               ` Stanley Lieber
2021-01-21 22:01                 ` hiro
2021-01-21 22:15                   ` Stanley Lieber
2021-01-21 22:51                     ` hiro
2021-01-21 22:55                       ` hiro
2021-01-21 23:26                         ` Silas McCroskey
2021-01-21 23:55                           ` Stanley Lieber
2021-01-22  0:13                             ` Silas McCroskey
2021-01-23 15:08                               ` cinap_lenrek
2021-01-22  0:24                             ` ori
2021-01-22  0:53                               ` Stanley Lieber
2021-01-22  9:53                                 ` hiro
2021-01-22  0:10                           ` Anthony Martin
2021-01-21 23:44                         ` Stanley Lieber
2021-01-22  0:00                           ` Silas McCroskey
2021-01-22  9:14                           ` hiro
2021-01-22 14:51                             ` Stanley Lieber
2021-01-22 15:01                               ` hiro
2021-01-22 15:39                                 ` Stanley Lieber
2021-01-22  9:41                           ` hiro
2021-01-21 23:00                       ` Stanley Lieber
2021-01-21 23:08                         ` Stanley Lieber
2021-01-19 23:04         ` Silas McCroskey
2021-01-20  1:12           ` hiro
2021-01-20  1:50             ` Stanley Lieber
2021-01-19 21:07   ` Stanley Lieber

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=154A2B81E5307985989F46BE958ACBAC@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).