module-transaction: Do not allow parallel conversations by default

Pam conversations per se may also run in parallel, but this implies that
the application supports this.

Since this normally not the case, do not create modules that may invoke
the pam conversations in parallel by default, adding a mutex to protect
such calls.
This commit is contained in:
Marco Trevisan (Treviño)
2023-10-13 19:24:49 +02:00
parent ac879208ea
commit 04ad7bdc73
5 changed files with 51 additions and 12 deletions

View File

@@ -1,4 +1,4 @@
// Code generated by "pam-moduler -type integrationTesterModule"; DO NOT EDIT.
// Code generated by "pam-moduler -type integrationTesterModule -parallel-conv"; DO NOT EDIT.
//go:generate go build "-ldflags=-extldflags -Wl,-soname,pam_go.so" -buildmode=c-shared -o pam_go.so -tags go_pam_module
@@ -43,7 +43,7 @@ func handlePamCall(pamh *C.pam_handle_t, flags C.int, argc C.int,
return C.int(pam.ErrIgnore)
}
mt := pam.NewModuleTransactionInvoker(pam.NativeHandle(pamh))
mt := pam.NewModuleTransactionInvokerParallelConv(pam.NativeHandle(pamh))
err := mt.InvokeHandler(moduleFunc, pam.Flags(flags),
sliceFromArgv(argc, argv))
if err == nil {