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=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 25912 invoked from network); 29 Jun 2021 20:10:30 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 29 Jun 2021 20:10:30 -0000 Received: (qmail 9590 invoked by uid 550); 29 Jun 2021 20:10:28 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 9569 invoked from network); 29 Jun 2021 20:10:27 -0000 Date: Tue, 29 Jun 2021 16:10:15 -0400 From: Rich Felker To: Alexey Kodanev Cc: musl@lists.openwall.com Message-ID: <20210629201014.GQ13220@brightrain.aerifal.cx> References: <20210629133130.143543-1-aleksei.kodanev@bell-sw.com> <20210629144834.GP13220@brightrain.aerifal.cx> <0a862f77-4e57-fe2f-d1b3-ea8bcd626aa3@bell-sw.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0a862f77-4e57-fe2f-d1b3-ea8bcd626aa3@bell-sw.com> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] [PATCH] nice: return EPERM instead of EACCES On Tue, Jun 29, 2021 at 06:45:42PM +0300, Alexey Kodanev wrote: > On 29.06.2021 17:48, Rich Felker wrote: > > Is there actually an issue here? setpriority is specified to fail with > > EACCES already for this case; EPERM is only specified for targeting > > other processes you don't have permission to target. Is Linux getting > > this wrong for setpriority? > > No, it's fine for setpriority(), it just seems wrong for nice() > to return EACCES in this case. > > LTP/nice04 test (setting nice(-10)) is failing with musl and POSIX > indeed says that the errno should be EPERM, for nice(). Oh, sorry, I read it backwards and was thinking it was replacing EPERM with EACCES. Indeed nice is supposed to return EPERM where setpriority would return EACCES so I think this patch is correct. Rich