Andrew Watkins <awatkins1966@gmail.com> writes:
> You are right Solaris is missing "const"
> struct pam_conv {
> int (*conv)(int, struct pam_message **, struct pam_response **,
> void *);
> void *appdata_ptr;
> };
So I tried to replicate this issue on an OpenIndiana VM (OI 2024.04),
and got no failure. Digging into /usr/include/security/pam_appl.h,
I found the reason:
struct pam_conv {
#ifdef _PAM_LEGACY_NONCONST
int (*conv)(int, struct pam_message **,
#else
int (*conv)(int, const struct pam_message **,
#endif
struct pam_response **, void *);
void *appdata_ptr; /* Application data ptr */
};
So that's just annoying as all get-out: it means some "Solaris"
platforms do have this declaration with the "const", and even
there it's going to be dependent on compilation environment.
I still see a way to avoid a configure check though: let's make
src/include/port/solaris.h "#define _PAM_LEGACY_NONCONST".
That should make OpenIndiana enough like other Solaris-alikes
for the purpose, and we can also use that same symbol to cue
our code how to declare the callback function.
Or we could create a configure check, but that seems like a lot
of work, and it would add some extra time to everybody's build.
regards, tom lane