mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-29 02:59:34 -05:00
Add tty to authz params
This commit is contained in:
parent
6cc1cf81c1
commit
2d93461817
2 changed files with 14 additions and 4 deletions
|
|
@ -359,14 +359,15 @@ static enum nss_status pam_read_authz(
|
|||
|
||||
static enum nss_status pam_do_authz(
|
||||
pld_ctx *ctx, const char *svc, const char *ruser, const char *rhost,
|
||||
int *errnop)
|
||||
const char *tty, int *errnop)
|
||||
{
|
||||
NSS_BYGEN(NSLCD_ACTION_PAM_AUTHZ,
|
||||
WRITE_STRING(fp,ctx->user);
|
||||
WRITE_STRING(fp,ctx->dn);
|
||||
WRITE_STRING(fp,svc);
|
||||
WRITE_STRING(fp,ruser);
|
||||
WRITE_STRING(fp,rhost),
|
||||
WRITE_STRING(fp,rhost);
|
||||
WRITE_STRING(fp,tty),
|
||||
pam_read_authz(fp,ctx,errnop));
|
||||
}
|
||||
|
||||
|
|
@ -374,7 +375,7 @@ int pam_sm_acct_mgmt(
|
|||
pam_handle_t *pamh, int flags, int argc, const char **argv)
|
||||
{
|
||||
int rc, err;
|
||||
const char *username, *svc, *ruser, *rhost;
|
||||
const char *username, *svc, *ruser, *rhost, *tty;
|
||||
int no_warn = 0, ignore_flags = 0;
|
||||
int i;
|
||||
struct pam_conv *appconv;
|
||||
|
|
@ -427,6 +428,11 @@ int pam_sm_acct_mgmt(
|
|||
rc = pam_get_item (pamh, PAM_RHOST, (CONST_ARG void **) &rhost);
|
||||
if (rc != PAM_SUCCESS)
|
||||
return rc;
|
||||
|
||||
rc = pam_get_item (pamh, PAM_TTY, (CONST_ARG void **) &tty);
|
||||
if (rc != PAM_SUCCESS)
|
||||
return rc;
|
||||
|
||||
ctx2.dn = ctx->dn;
|
||||
ctx2.user = ctx->user;
|
||||
rc = pam_do_authz(&ctx2, svc, ruser, rhost, &err);
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ static struct berval uidmsg =
|
|||
|
||||
int pam_authz(nssov_info *ni,TFILE *fp,Operation *op)
|
||||
{
|
||||
struct berval dn, uid, svc, ruser, rhost;
|
||||
struct berval dn, uid, svc, ruser, rhost, tty;
|
||||
struct berval authzmsg = BER_BVNULL;
|
||||
int32_t tmpint32;
|
||||
char dnc[1024];
|
||||
|
|
@ -263,6 +263,7 @@ int pam_authz(nssov_info *ni,TFILE *fp,Operation *op)
|
|||
char svcc[256];
|
||||
char ruserc[32];
|
||||
char rhostc[256];
|
||||
char ttyc[256];
|
||||
int rc = NSLCD_PAM_SUCCESS;
|
||||
Entry *e = NULL;
|
||||
Attribute *a;
|
||||
|
|
@ -284,6 +285,9 @@ int pam_authz(nssov_info *ni,TFILE *fp,Operation *op)
|
|||
READ_STRING_BUF2(fp,svcc,sizeof(rhostc));
|
||||
rhost.bv_val = rhostc;
|
||||
rhost.bv_len = tmpint32;
|
||||
READ_STRING_BUF2(fp,svcc,sizeof(ttyc));
|
||||
tty.bv_val = ttyc;
|
||||
tty.bv_len = tmpint32;
|
||||
|
||||
Debug(LDAP_DEBUG_TRACE,"nssov_pam_authz(%s)\n",dn.bv_val,0,0);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue