Commit Graph

15 Commits

Author SHA1 Message Date
Marco Trevisan (Treviño)
b9265b1c6a transaction: Add support for Binary conversation
PAM upports binary conversations using private protocols, this
can be handled by C but it's not supported here because we
implicitly convert all the messages to string, and this may lead
to issues when this is not the case (as in binary protocol the
pointer could contain zeros that the GoString conversion would
consider them the end of the message).

So, add another conversation handler implementation that allows
to handle the binary protocol, whose function callback accepts
a pointer to the struct (we can't use bytes as the length is
unknown and may be defined in the header of the pointer itself).

However since the binary prompt is not supported by all the
platforms we need to do a compile-time check to disable it in
case is used when not supported.
2023-09-22 04:05:16 +02:00
Marco Trevisan (Treviño)
78ffef4acd transaction: Use cgo.Handle to pass callback data to PAM
Go provides a nicer way to handle Go structs lifetime when they
are passed to C now, so use this instead of a custom
implementation that requires to store them in a map
2023-09-19 20:06:38 +02:00
Didier Roche
bc958bdbd7 Allow to define confdir
PAM has a pam_start_confdir() which allows to define the configuration
directory where all services are located.
This is useful to define your own service on tests in particular, so
that you can control your stack and be independant of the host when
running them.
Allow defining this configuration directory, with a new StartConfDir
function.
Also, allow pre-checking for the API availability with
CheckPamHasStartConfdir().
2022-09-16 08:09:26 +02:00
Michael Steinert
02ccfbfaf0 [ci skip] Update documentation 2015-12-04 10:05:44 -06:00
Michael Steinert
1d0c8bc60c Fix lint 2015-12-04 09:46:42 -06:00
Michael Steinert
7f5fc62ba4 Remove dead code 2015-12-04 09:21:38 -06:00
Michael Steinert
a245f1098c Fix a memory leak 2015-12-04 09:03:39 -06:00
Michael Steinert
8ec1202046 Stop passing Go pointers to C 2015-12-03 14:59:51 -06:00
Michael Steinert
61a0e177d2 Fix golint warnings 2015-04-10 15:04:52 -05:00
Michael Steinert
767cadc80c Small documentation updates 2015-03-30 19:16:13 -05:00
Michael Steinert
3215d873b9 This looks a bit better 2015-03-30 18:20:09 -05:00
Michael Steinert
77471e65f1 Fix a silly bug and add test coverage 2015-03-30 18:13:10 -05:00
Michael Steinert
a0cde3fe01 Rework pam_getenvlist so it doesn't leak 2015-03-30 14:53:16 -05:00
Michael Steinert
9c771166c9 Add a test suite 2015-03-29 11:25:00 -05:00
Michael Steinert
d67bb86e54 Update interface 2015-03-28 17:00:58 -05:00