// GetEnv is used to retrieve a PAM environment variable. func (t *Transaction) GetEnv(name string) string { cs := C.CString(name) defer C.free(unsafe.Pointer(cs)) value := C.pam_getenv(t.handle, cs) if value == nil { return "" } return C.GoString(value) }
// pam_getenv. Returns an additional argument indicating // the actual existence of the given environment variable. func (t *Transaction) GetEnv(name string) (string, bool) { cs := C.CString(name) defer C.free(unsafe.Pointer(cs)) value := C.pam_getenv(t.handle, cs) if value != nil { return C.GoString(value), true } return "", false }