Owncloud/Nextcloud PAM authentication backend

schneefux 7627939253 hack together a working version 1 year ago
appinfo 7627939253 hack together a working version 1 year ago
members_src 7627939253 hack together a working version 1 year ago
pwauth @ 3b4ba71005 7627939253 hack together a working version 1 year ago
.gitmodules 7627939253 hack together a working version 1 year ago
README.md 7627939253 hack together a working version 1 year ago
user_pam.php 7627939253 hack together a working version 1 year ago

README.md

Based on User PAM backend 0.1.

Edit pwauth/pwauth/config.h and set the web server's user id:

#define SERVER_UIDS x

Compile pwauth: cd pwauth/pwauth && make.

Compile members: cd members_src && make.

Copy both binaries to some directory (e.g. /usr/local/bin), configure plugin's appinfo/app.php

Set suid-flag to allow the script to read /etc/passwd: chmod u+s pwauth

If something does not work, start debugging by adding this line in user_pam.php:

if (fwrite($handle, "$uid\n$password\n") === false)
    return false

$result = pclose( $handle );
if (0 === $result)
    return $uid;

+ error_log($result);
return false;

Error codes are at the bottom of pwauth's INSTALL.