pam_LOCAL_domain.c revision 4c08db0fb0dda3d27b1184248ca5c800d7ce23f0
/*
SSSD
PAM e credentials
Copyright (C) Sumit Bose <sbose@redhat.com> 2009
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <time.h>
#include <security/pam_modules.h>
#include "util/crypto/sss_crypto.h"
#include "providers/data_provider.h"
goto label; \
} \
} while(0)
goto label; \
} \
} while(0)
struct LOCAL_request {
struct tevent_context *ev;
struct sss_domain_info *domain;
struct sysdb_attrs *mod_attrs;
struct ldb_result *res;
int error;
struct pam_auth_req *preq;
};
{
}
{
int ret;
done:
return;
}
{
int ret;
int failedLoginAttempts;
/* TODO: maybe add more inteligent delay calculation */
0);
(long)failedLoginAttempts);
done:
return;
}
{
const char *disabled;
}
}
{
int ret;
const char *password;
char *salt;
char *new_hash;
if (ret) {
/* TODO: should we allow null passwords via a config option ? */
}
goto done;
}
done:
}
{
struct LOCAL_request *lreq;
static const char *attrs[] = {SYSDB_NAME,
"lastPasswordChange",
"accountExpires",
"passwordHint",
"passwordHistory",
NULL};
struct ldb_result *res;
const char *password;
int ret;
if (!lreq) {
return ENOMEM;
}
DEBUG(0, ("Fatal: Sysdb CTX not found for this domain!\n"));
return ENOENT;
}
&res);
return ret;
}
goto done;
goto done;
}
goto done;
}
case SSS_PAM_AUTHENTICATE:
case SSS_PAM_CHAUTHTOK:
case SSS_PAM_CHAUTHTOK_PRELIM:
/* TODO: maybe this is a candiate for an explicit audit message. */
break;
}
goto done;
}
break;
}
case SSS_PAM_AUTHENTICATE:
break;
case SSS_PAM_CHAUTHTOK:
break;
case SSS_PAM_ACCT_MGMT:
break;
case SSS_PAM_SETCRED:
break;
case SSS_PAM_OPEN_SESSION:
break;
case SSS_PAM_CLOSE_SESSION:
break;
case SSS_PAM_CHAUTHTOK_PRELIM:
break;
default:
}
done:
return EOK;
}