From owner-freebsd-hackers@freebsd.org Sat Jul 7 12:21:25 2018 Return-Path: Delivered-To: freebsd-hackers@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 B02BA103E5B6 for ; Sat, 7 Jul 2018 12:21:25 +0000 (UTC) (envelope-from munro@penski.net) Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) (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 32C9473DA0 for ; Sat, 7 Jul 2018 12:21:24 +0000 (UTC) (envelope-from munro@penski.net) Received: by mail-ed1-x52e.google.com with SMTP id a5-v6so10517044edt.5 for ; Sat, 07 Jul 2018 05:21:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=penski-net.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:from:date:message-id:subject:to; bh=J+PIzjZ9lUG0Esy1mdW2N2bxp5lt4puGVgGFny5lX88=; b=chiGERjNOCrFOn6Nc53HYcole7iL6ii/9iJoxt4ygWMk+poH7FwuTrkNu7ymnfmxiK t+Wg7bHnOHmRW6LTvtehQ46vWNFabvKAx66IkPg6J0aeDSoNx2H1sWlK4X0SoFz7BWzO /yIZLPR6LlP1jnrr0UKyCsIDcuSl73Tip8DCFT0OH4t5dDNl/48Ix9ibcePoD+Rdrefy 5gg8fD4HWKUoBkhIxUkOg0LsBFMzZrv51SqDyman2lF0YQAItVqTKt1ZeCq7PPJ4yM/Z LZQc7ip7eN+NsC9AULQDeWVoVDcpqLt0QrAgjCjqyhTWspgdrL83+4G+uZfFORfIcntq /fqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to; bh=J+PIzjZ9lUG0Esy1mdW2N2bxp5lt4puGVgGFny5lX88=; b=jvD3nqKiImuOcN2+uTCMV8zuAqWT3HtBxdnXBPOaGPe4ybUBzlMtIpdd2begpBrxt4 /GO8r1DqkaP0gjZ83VcetlsLWKenVLU9jUcWbzDvUsKeZdNlOcR+/oxEZaElHiM/6CbT ziUumktlXWYOvjK0A0zIPCMA0DQ8PtQFb62zAdISmVfoB6CqdZFXUHdajpT8kBF2G+Q9 ZNg/UeJ+En9M5MPXp2F/aGOR2frkdOAnryHWr37/RHMigc9XdmeNpu86Aa6HIns9NwWp E9XevxzZWOpED787riK2oEUnByIZWKHRs4JJyHtcgeWQvA2JjQ/fMTQTYk/RCbSbl9pt i6EQ== X-Gm-Message-State: APt69E09By/GIbFABffnjVfMfOaWkRFQ4+TTTmBhmIxwadU5SKQXDeJH wkidwG93gzwPLjqXBE3DJ9t5pvgaO3xRkMK+6leTBs5R X-Google-Smtp-Source: AAOMgpfeZ4IPr8nDysdBUWWu+WaXFm0tH2I525JODWX9f7VppvDzg9ovY/+FXRs5bKy99loPXD0a2g6IQPF803ONKBU= X-Received: by 2002:aa7:d786:: with SMTP id s6-v6mr11518102edq.228.1530966083058; Sat, 07 Jul 2018 05:21:23 -0700 (PDT) MIME-Version: 1.0 Sender: munro@penski.net Received: by 2002:a50:a1c7:0:0:0:0:0 with HTTP; Sat, 7 Jul 2018 05:21:22 -0700 (PDT) X-Originating-IP: [121.73.38.77] From: Thomas Munro Date: Sun, 8 Jul 2018 00:21:22 +1200 X-Google-Sender-Auth: FgVQx111n8RaX9sif1YrgnvaRRE Message-ID: Subject: Adding an "expose_authtok" option to pam_exec(8) To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 12:21:25 -0000 Hello, On Linux, pam_exec.so has an option "expose_authtok" which causes the authentication token to be sent to the executed program's stdin. That's quite a useful bridge to languages other than C that want to check the password or use it to decrypt something etc, since otherwise you have to provide some kind of .so wrapper providing the PAM C API to get at that. I wrote a patch to implement that and posted it here: https://reviews.freebsd.org/D16171 . I'd be grateful for any feedback. Thanks, Thomas Munro