Changeset 39 in openpam for trunk/lib/pam_info.c


Ignore:
Timestamp:
Feb 7, 2002, 12:22:08 PM (19 years ago)
Author:
Dag-Erling Smørgrav
Message:

Introduce pam_v{info,error,prompt}().
Move OpenPAM API extensions into <security/openpam.h> to avoid
namespace pollution for apps or modules that do not use them.

Sponsored by: DARPA, NAI Labs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/pam_info.c

    r16 r39  
    4040
    4141#include <security/pam_appl.h>
     42#include <security/openpam.h>
    4243
    4344/*
     
    5253        ...)
    5354{
    54         char msgbuf[PAM_MAX_MSG_SIZE];
    55         struct pam_message msg;
    56         const struct pam_message *msgp;
    57         struct pam_response *rsp;
    58         struct pam_conv conv;
    5955        va_list ap;
     56        char *rsp;
    6057        int r;
    6158
    62         if ((r = pam_get_item(pamh, PAM_CONV, (void *)&conv)) != PAM_SUCCESS)
    63                 return (r);
    6459        va_start(ap, fmt);
    65         vsnprintf(msgbuf, PAM_MAX_MSG_SIZE, fmt, ap);
     60        r = pam_vprompt(pamh, PAM_TEXT_INFO, &rsp, fmt, ap);
    6661        va_end(ap);
    67         msg.msg_style = PAM_TEXT_INFO;
    68         msg.msg = msgbuf;
    69         msgp = &msg;
    70         r = (conv.conv)(1, &msgp, &rsp, conv.appdata_ptr);
    7162        free(rsp); /* ignore response */
    7263        return (r);
Note: See TracChangeset for help on using the changeset viewer.