From owner-freebsd-current@freebsd.org Mon Jul 9 19:13:43 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0613104808B for ; Mon, 9 Jul 2018 19:13:43 +0000 (UTC) (envelope-from guy.helmer@gmail.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 562EC80526 for ; Mon, 9 Jul 2018 19:13:43 +0000 (UTC) (envelope-from guy.helmer@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 151681048085; Mon, 9 Jul 2018 19:13:43 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1B661048084 for ; Mon, 9 Jul 2018 19:13:42 +0000 (UTC) (envelope-from guy.helmer@gmail.com) Received: from mail-io0-x229.google.com (mail-io0-x229.google.com [IPv6:2607:f8b0:4001:c06::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6CFE180522 for ; Mon, 9 Jul 2018 19:13:42 +0000 (UTC) (envelope-from guy.helmer@gmail.com) Received: by mail-io0-x229.google.com with SMTP id i18-v6so2316802ioj.13 for ; Mon, 09 Jul 2018 12:13:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=x8YFbBe2vg8OUiAegsQir+NJcUuWvn0FTI6ZGVdIoF4=; b=AnfEx7oieUhL9GBJdv+Xlij9VdYmKJ3Q9VlS58syEZ0ZuECiUumfuChi0l9OHnZ/D4 3sqdAR3E9/9xNJ95yf9GNKzRX+kW2cq7qLnSLfX7GxVFoGDzYIaha1OLGsDsAnwQKwt2 wJAj2oS5TLDvtdrj8frrE1Izfe4lGnErMXsD7ZFPKZ8wJZvfp4OrcelPJ+cIp+ywMEe4 /H1HPUsxTxAdnyqjwmBAbaubnc/DDJMNkxcozX/7eVmTaR8o0VlviGzj22iTfdAKrI4i crsGTApyUeaL1e/+DN7QOlykKO6UkJkB9Cri7hTg23IgFQbKVILMuZTo7XRh6iSnjV6x LyIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=x8YFbBe2vg8OUiAegsQir+NJcUuWvn0FTI6ZGVdIoF4=; b=Obv0DPgIJWzUy35zEk4ch3ihOguiTl2hYQ3PkJVsSQijjfvJ5h1f0Wk5rq2Wk/p+41 LY981up+Tm95xmoy8KWtZU6ad/+T+vPOg38/8cXCuEeJe3cSTx0Hzf5MWVYUC4VTNd8n 4HD1Hig9eF0eVhQ4OLIBNw9VKno1mPVTbT4/zzKXI1lWf9gwZI9gzlj/stB6A9yC9FPA gInkmhUstk5Y9oqKJkItMHU7Who+RHpJ7gku4ecviTEqaX5J9u8aAUpwdvlpKgw2IOI5 BWytRxirY86CoaFUhnGf4h838OcXTVe/j5Xq+cNuDKBJP/5XVkxgo0mALJUgKFvtX7I4 aDBQ== X-Gm-Message-State: AOUpUlEZWqC0n9hQJsEoIuhQpec/4Q/T+8pteMSQiPnYtfRewrbg8MuA aJ/Ga5KWV+FdE6Adv3/XQkSgdknZ X-Google-Smtp-Source: AAOMgpeQ9Pm9UL19FlwUy/LlGinY8tkxidfOoqyUUUHlimioG9TmdnSqqSW2RlKhtK/YopaeEwyQrA== X-Received: by 2002:a6b:1741:: with SMTP id 62-v6mr16456522iox.1.1531163621799; Mon, 09 Jul 2018 12:13:41 -0700 (PDT) Received: from [172.22.132.117] ([192.119.231.58]) by smtp.gmail.com with ESMTPSA id l26-v6sm605724ioh.27.2018.07.09.12.13.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Jul 2018 12:13:41 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: How to add su to /rescue ? From: Guy Helmer In-Reply-To: <201807091154.w69Bs7Ha024391@fire.js.berklix.net> Date: Mon, 9 Jul 2018 14:13:40 -0500 Cc: current@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <2ACD0DE9-3C43-48DE-BD5A-E074E1A4740E@gmail.com> References: <201807091154.w69Bs7Ha024391@fire.js.berklix.net> To: "Julian H. Stacey" X-Mailer: Apple Mail (2.3273) X-Mailman-Approved-At: Mon, 09 Jul 2018 20:36:33 +0000 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2018 19:13:44 -0000 > On Jul 9, 2018, at 6:54 AM, Julian H. Stacey wrote: >=20 > Hi current@ > I want to add su to /rescue, but got stuck on pam. > Old unix su didn't suffer from pam. > There's no #define in su to turn off pam. > Man src.conf says WITHOUT_PAM is deprecated & does nothing. >=20 > Can someone please offer a solution ? > Or better to include a simple BSD su pre pam ? > I would happily develop a patch for that. Hi, Aside from not being able to use pam from a static executable, please = don=E2=80=99t try to make the crunched hard-linked executable in /rescue = setuid-root (su is useless without it). That would mean anyone running = /rescue/sh gets a root shell :-) Conceptually, a separate crunchgen binary could be made for setuid-root = purposes, but having a setuid-root binary in /rescue (outside of the = normal hierarchy) makes me nervous. Regards, Guy=20 >=20 > Notes to explain the need, & patches from my > http://berklix.com/~jhs/src/bsd/fixes/freebsd/src/gen/rescue/ > --------- >=20 > Patch[es] below to solve this emailed scenario: >> Please on prison-host cp /lib/libc.so.7 = /tank/ezjail/my-domain/lib/libc.so.7 >> I am logged in on jail-host, but only as normal-user, not root, so I = cannot run >> /rescue/cp /usr/obj/usr/src/lib/libc/libc.so.7 /lib/libc.so.7 >>=20 >> a my make installworld on jail-host.my-domain previously failed with >> =3D=3D=3D> lib/libc (install) >> install -C -o root -g wheel -m 444 libc.a /usr/lib >> install -C -o root -g wheel -m 444 libc_p.a /usr/lib >> install -s -o root -g wheel -m 444 -fschg -S libc.so.7 /lib >> install: /lib/libc.so.7: chflags: Operation not permitted >> *** Error code 71 >> (might or not be an artifact of being in a jail) >>=20 >> unfortunately I had run the command as >> xs make installworld >> (xs is my own little root wrapper) >> so when it exited, I was just normal-user not root, & I had forgotten = to >> open another xterm & leave it logged in as root, >> & I found no /rescue/su >=20