From nobody Sun Jan 14 22:07:17 2024 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TCqBp58zXz57G5G for ; Sun, 14 Jan 2024 22:07:30 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from www121.sakura.ne.jp (www121.sakura.ne.jp [153.125.133.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4TCqBp0kc6z4JQ7; Sun, 14 Jan 2024 22:07:29 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Authentication-Results: mx1.freebsd.org; none Received: from kalamity.joker.local (123-1-91-49.area1b.commufa.jp [123.1.91.49]) (authenticated bits=0) by www121.sakura.ne.jp (8.17.1/8.17.1/[SAKURA-WEB]/20201212) with ESMTPA id 40EM7IjP057692; Mon, 15 Jan 2024 07:07:18 +0900 (JST) (envelope-from junchoon@dec.sakura.ne.jp) Date: Mon, 15 Jan 2024 07:07:17 +0900 From: Tomoaki AOKI To: Craig Leres Cc: freebsd-hackers@freebsd.org Subject: Re: poudriere 3.4.0 regression: -i runs as NON_ROOT user Message-Id: <20240115070717.90a337c666aaa86003e7c231@dec.sakura.ne.jp> In-Reply-To: <0b1ea9f1-4ed6-42c9-af21-844da9fb5c63@freebsd.org> References: <0b1ea9f1-4ed6-42c9-af21-844da9fb5c63@freebsd.org> Organization: Junchoon corps X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4TCqBp0kc6z4JQ7 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:7684, ipnet:153.125.128.0/18, country:JP] On Sun, 14 Jan 2024 13:31:57 -0800 Craig Leres wrote: > On 1/12/24 22:17, Derek Schrock wrote: > > It seems like you have PORTBUILD_UID set in poudriere.conf? UID is just > > id -u and pw useradd command uses that var. But it's 65534 for me (the > > default) I'm using -devel though. > > Nope: > > zinc 363 # fgrep PORTBUILD_UID /usr/local/etc/poudriere.conf > # Default: nobody (uid PORTBUILD_UID) > #PORTBUILD_UID=65534 > > But I find it interesting that poudriere.conf.sample says the default > user/gid is nobody/65534 but when I poudriere bulk (non interactively) > the jobs run as root! > > On 1/12/24 23:49, Gleb Popov wrote: > > Now you mentioned that, I wonder if this change will fix the problem > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=276259 > > My testing shows it does not fix the problem. I think that even as > poudriere is creating the -i shell as user nobody it also defines UID to > 0 in make. So this change: > > +UID?= ${.MAKE.UID} > > has no effect. > > It seems poudriere intends to run as a non-root user now. But what I see > happening is that it runs as root for non-interactive bulk builds and as > nobody for interactive. And either way UID is defined in make as 0. Even > when make itself knows it's running with UID 65534. > > Craig > > [with the patch from 276259 applied] > zinc 188 # poudriere bulk -i -j 13release -p current ports-mgmt/pkg > [...] > nobody@zinc:/usr/ports/ports-mgmt/pkg % whoami > nobody > nobody@zinc:/usr/ports/ports-mgmt/pkg % cd /usr/ports/ports-mgmt/pkg > nobody@zinc:/usr/ports/ports-mgmt/pkg % make -V UID > 0 > nobody@zinc:/usr/ports/ports-mgmt/pkg % make -V .MAKE.UID > 65534 IIRC, poudriere[-devel] ran as nobody (65534) initially, but it started running as root (0) when I started using ccache. -- Tomoaki AOKI