9front - general discussion about 9front
 help / color / mirror / Atom feed
From: Xiao-Yong Jin <meta.jxy@gmail.com>
To: 9front@9front.org
Subject: Re: [9front] drawterm: kern/devfs-posix: fscreate does not respect parent dir's perm
Date: Fri, 6 Jan 2023 09:30:53 -0600	[thread overview]
Message-ID: <CD97D0B6-E6E3-4453-93F9-459EEE76E8AD@gmail.com> (raw)
In-Reply-To: <FC1C33A21A54CF9D7A6CF4C7A445B709@felloff.net>

better.

> On Jan 6, 2023, at 8:44 AM, cinap_lenrek@felloff.net wrote:
> 
> how about this?
> 
> --- a/./kern/devfs-posix.c
> +++ b/./kern/devfs-posix.c
> @@ -244,8 +244,8 @@
> 
> fd = open(path, 0);
> if(fd >= 0) {
> - chmod(path, perm & 0777);
> - chown(path, uif->uid, uif->uid);
> + chmod(path, uif->mode & perm & 0777);
> + chown(path, -1, uif->gid);
> }
> close(fd);
> 
> @@ -260,8 +260,8 @@
> close(fd);
> fd = open(path, m);
> }
> - chmod(path, perm & 0777);
> - chown(path, uif->uid, uif->gid);
> + chmod(path, uif->mode & perm & 0666);
> + chown(path, -1, uif->gid);
> }
> if(fd < 0)
> error(strerror(errno));
> 
> --
> cinap


  reply	other threads:[~2023-01-06 15:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-03 22:29 Xiao-Yong Jin
2023-01-06 14:21 ` cinap_lenrek
2023-01-06 14:44 ` cinap_lenrek
2023-01-06 15:30   ` Xiao-Yong Jin [this message]
2023-01-06 15:40 ` cinap_lenrek
2023-01-06 18:20 ` cinap_lenrek

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=CD97D0B6-E6E3-4453-93F9-459EEE76E8AD@gmail.com \
    --to=meta.jxy@gmail.com \
    --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).