feat: complete session preferences and PAM fixture gates
This commit is contained in:
@@ -1,9 +1,4 @@
|
||||
// auth — PAM authentication with CGO bindings.
|
||||
//
|
||||
// Uses runtime.LockOSThread to prevent goroutine migration during
|
||||
// PAM transactions, as PAM modules rely on thread-local storage.
|
||||
//
|
||||
// Mirrors vendor/src/auth/pam.rs and vendor/src/auth/mod.rs.
|
||||
// Keep each PAM transaction on one OS thread. PAM modules can use thread-local state.
|
||||
package auth
|
||||
|
||||
/*
|
||||
@@ -12,11 +7,11 @@ package auth
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
// Match the //export-generated signature.
|
||||
// Match the signature that cgo generates for //export.
|
||||
extern int latchd_pam_conv(int, struct pam_message **,
|
||||
struct pam_response **, void *);
|
||||
|
||||
// Store a uintptr_t handle in C heap so the Go GC never sees a Go pointer.
|
||||
// Store the numeric handle in C memory. Do not pass a Go pointer to PAM.
|
||||
static void *storeHandle(uintptr_t h) {
|
||||
uintptr_t *p = malloc(sizeof(uintptr_t));
|
||||
if (p) *p = h;
|
||||
|
||||
Reference in New Issue
Block a user