From nobody Thu Aug 22 11:04:39 2024 X-Original-To: bugs@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 4WqL1z2nsKz5Sgrl for ; Thu, 22 Aug 2024 11:04:39 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WqL1z0Glmz4Ry0 for ; Thu, 22 Aug 2024 11:04:39 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724324679; a=rsa-sha256; cv=none; b=L3ELcATkbVAcnmM5kfIBfkxZanvQFwhGAg1VEuWX1BUr/1c9CeEa3j6JIX/lr6MgCJJq7l 2IUN/8yAuErERSdV1mcB0AYbbWastNxrdRj73GbPOeFITdJDpZ0jUtn7OwV5A8qGcVNn1y +R87JGfJ2nZpQ0sWqC247Gfh/jQqhONYS0VfwTNwva9JZ1wDW6g1BpW23Jc6FYh4KgkhU+ ggj+55JuEsrQKvSst1UKc0AecMyoZraVBR7QSAadDpm0RZysl7/9HCYcKTKnvpS3mP893m OnHulJ6XNW2/bw1cvReZpCazITsJOEGY2nVcnvvfkQaaCWjNuCXen6foeT0LDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724324679; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=buR7BdVGvUwnd51WbHq3yHc0azovC3UH6CD6nW65HzM=; b=SnOVakSxKq7EvJxzECcQ17QtzWL0d+ksFKopow2MKw+r6BJPQH/5BeZ1BdnSSYbRvnPSF2 1/Umvj+PQ6jWmmBbCSG5pXLdFZtZ9gC40/yAbHuEURMfs03JBBo81jWwJ5JEE7WO1yfaw2 wVjsGNicroZqtDhb+DN16PVW6d3ItC/D4IViXgfWWl2xVeNCqhJtG1xHyKwae7+bZaTDv9 ElBAdFbngQ74dKS04ljtrNhP8lpxVekg2Fo3K4eW4izfPYt1sEJyIEJWBS4+RwCBwy2hke Ze1aGjXuUflIi8cUwhqug42Vyr8yP7Du9/fd7e3DSJwnbEudusk8Y8+0WQ++wg== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WqL1y708ZzPmV for ; Thu, 22 Aug 2024 11:04:38 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 47MB4cs1011764 for ; Thu, 22 Aug 2024 11:04:38 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 47MB4c6d011763 for bugs@FreeBSD.org; Thu, 22 Aug 2024 11:04:38 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 280995] [PATCH] pwdbopen: don't check effective UID Date: Thu, 22 Aug 2024 11:04:39 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: misc X-Bugzilla-Version: 14.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: me@levitati.ng X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D280995 Bug ID: 280995 Summary: [PATCH] pwdbopen: don't check effective UID Product: Base System Version: 14.1-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: misc Assignee: bugs@FreeBSD.org Reporter: me@levitati.ng Currently if pwdbopen detects that the running user is not privileged the unprivileged passwd database is used. However it can be useful for non-privileged processes to be able to retrieve encrypted passwords. This patch for instance makes the pam_unix.so PAM module work, as long as t= he process has read access to /etc/spwd.db. diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c index 1cbf97e7eb5..cdaa27ea539 100644 --- a/lib/libc/gen/getpwent.c +++ b/lib/libc/gen/getpwent.c @@ -722,8 +722,7 @@ pwdbopen(int *version) DBT key, entry; int rv; - if (geteuid() !=3D 0 || - (res =3D dbopen(_PATH_SMP_DB, O_RDONLY, 0, DB_HASH, NULL)) =3D= =3D NULL) + if ((res =3D dbopen(_PATH_SMP_DB, O_RDONLY, 0, DB_HASH, NULL)) =3D= =3D NULL) res =3D dbopen(_PATH_MP_DB, O_RDONLY, 0, DB_HASH, NULL); if (res =3D=3D NULL) return (NULL); --=20 You are receiving this mail because: You are the assignee for the bug.=