diff options
Diffstat (limited to 'pam')
| -rw-r--r-- | pam/pam.c | 5 | ||||
| -rw-r--r-- | pam/pam.go | 7 | ||||
| -rw-r--r-- | pam/pam.h | 3 |
3 files changed, 15 insertions, 0 deletions
@@ -20,6 +20,7 @@ #include "pam.h" #include <security/pam_appl.h> +#include <security/pam_ext.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -107,3 +108,7 @@ void freeSecret(pam_handle_t* pamh, char* data, int error_status) { munlock(data, size); free(data); } + +void infoMessage(pam_handle_t* pamh, const char* message) { + pam_info(pamh, "%s", message); +} @@ -166,6 +166,13 @@ func (h *Handle) err() error { return errors.New(s) } +// InfoMessage sends a message to the application using pam_info(). +func (h *Handle) InfoMessage(message string) { + cMessage := C.CString(message) + defer C.free(unsafe.Pointer(cMessage)) + C.infoMessage(h.handle, cMessage) +} + // Transaction represents a wrapped pam_handle_t type created with pam_start // form an application. type Transaction Handle @@ -41,4 +41,7 @@ void *copyIntoSecret(void *data); // CleaupFunc that Zeros wipes a C string and unlocks and frees its memory. void freeSecret(pam_handle_t *pamh, char *data, int error_status); +// Sends a message to the application using pam_info(). +void infoMessage(pam_handle_t *pamh, const char *message); + #endif // FSCRYPT_PAM_H |