Giter Club home page Giter Club logo

Comments (6)

emersion avatar emersion commented on May 14, 2024

CGo dependency: libpam

Maybe there is a pure Go PAM implementation out there? libpam is very annoying to use.

maddy needs to access the shadow database (/etc/shadow) on configurations using the local database

We don't need that with PAM. We only need that for #21.

from maddy.

foxcpp avatar foxcpp commented on May 14, 2024

We don't need that with PAM. We only need that for #21.

From pam_unix.so(8):

A helper binary, unix_chkpwd(8), is provided to check the user's password when it is stored in a read protected database. This binary is very simple and will only check the password of the user invoking it. It is called transparently on behalf of the user by the authenticating component of this module. In this way it is possible for applications like xlock(1) to work without being setuid-root.

Ok, didn't know. Perhaps, can we use it for #21 too?

UPD: No, we shouldn't.

The interface of the helper - command line options, and input/output data format are internal to the pam_unix module and it should not be called directly from applications.

from maddy.

foxcpp avatar foxcpp commented on May 14, 2024

Oh, unix_chkpwd works only for current user so it is not useful for us. We need root to access /etc/shadow.

from maddy.

foxcpp avatar foxcpp commented on May 14, 2024

So, what I think should be done.

Create a separate binary called maddy-pam-helper.
When started it reads two \0-terminated lines on stdin (username and password) and sets exit status depending on authentication success.

Generally, when installed to the system, this binary should setuid root (or given CAP_DAC_READ_SEARCH capability on Linux) and be only executable by a group that maddy server runs under (user group "maddy"?).

from maddy.

emersion avatar emersion commented on May 14, 2024

Oh, right. RIP, we need root either way.

from maddy.

foxcpp avatar foxcpp commented on May 14, 2024

https://github.com/foxcpp/maddy/tree/pam

from maddy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.