From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 31229 invoked from network); 6 Jan 2023 15:34:20 -0000 Received: from 9front.inri.net (168.235.81.73) by inbox.vuxu.org with ESMTPUTF8; 6 Jan 2023 15:34:20 -0000 Received: from mail-io1-f51.google.com ([209.85.166.51]) by 9front; Fri Jan 6 10:31:10 -0500 2023 Received: by mail-io1-f51.google.com with SMTP id n63so834137iod.7 for <9front@9front.org>; Fri, 06 Jan 2023 07:31:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:to:references:date:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=RFLuJPMUHZkGc5My/FT6skc8TVLjgp/f7u8QKzRTJuc=; b=kLU4xfmxinvAlfKpXzsd4kHvDnq2A9AyqU7e1zHBKHyE+yoVp/CJdRI8uA1+QIgXJh 8g/jqm1xx7PPFnCL19w4PfWEDTxzozPQ4HPQIeOYgl8i7k/UEioZISUrjjC3lUXOHsTp TFgmMiKV5Er1kcfbwlVEC7gAFbULJ0o54GQPgbgCm5qsWRg4bzsn60Hj7lD1cn+QpSgr BY1yfWScxu0zJIPBG7IpYaBFxGzql4Gy8KQa49xg2EiG4j5a0qTFJSEbKGPye2dkBunn 9xiBoOmIdXB6K5RWZPXltpeAycugqubfHMRXbWuUm6KiskLnMFpdORL1+47eizvdXG8f r51A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=message-id:in-reply-to:to:references:date:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RFLuJPMUHZkGc5My/FT6skc8TVLjgp/f7u8QKzRTJuc=; b=zBqeOvX/uEpBBZcYNPQta+ipBfQxAuhrps7WLTWH9I03VhvbxI8s7a5azQ9UnPsMwf HC5dECiLq8rYE2k6N1MSBswsi4HdfVVtGPb6wzIHMmdYyL7IWmeKwaZYNCgLT/K3xi17 q/5t5rkdu0dV2IzoU6JKebB0xcAgH9+cc58xqeAFCLJg/UeggxWph2MNhiTWqmqlfg4M AJhSAdE8Td19IB5qfIN8Sfd9Nrq2aCrRcilOUyZCLGXakZpmwZZ1rT+pvpUw19RrL8zI zGVyAsaoIUwxM4eHmxlSJ/P2OcXr/EMZgbhhGRwlSmOdhUMQNlUurRr5GcD8vgVvrnqG TA4Q== X-Gm-Message-State: AFqh2kr+XT8DrAWysT/Z3abqpLizhUUhrRO2sAI7AqumRSrk2+gdmOeM 3Dc7ANVLvGV/gdUyY6kx8rQ81LPsG0Y= X-Google-Smtp-Source: AMrXdXvP2fblXZ2VWvaTx0/7OV6vGh1bydIbWnwu4Yj+t1gqqoRuH3TxqnwVfpGPcnSov1khMH23Dg== X-Received: by 2002:a5d:984a:0:b0:6bc:d715:b8fc with SMTP id p10-20020a5d984a000000b006bcd715b8fcmr46833975ios.11.1673019064976; Fri, 06 Jan 2023 07:31:04 -0800 (PST) Return-Path: Received: from smtpclient.apple (c-67-184-39-205.hsd1.il.comcast.net. [67.184.39.205]) by smtp.gmail.com with ESMTPSA id y15-20020a056602178f00b006dfbe8b14cdsm449347iox.8.2023.01.06.07.31.03 for <9front@9front.org> (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Jan 2023 07:31:04 -0800 (PST) From: Xiao-Yong Jin Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\)) Date: Fri, 6 Jan 2023 09:30:53 -0600 References: To: 9front@9front.org In-Reply-To: Message-Id: X-Mailer: Apple Mail (2.3731.300.101.1.3) List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: lossless HTTP lifecycle module dependency-aware optimizer Subject: Re: [9front] drawterm: kern/devfs-posix: fscreate does not respect parent dir's perm Reply-To: 9front@9front.org Precedence: bulk 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