Hi,
is there a wayto useauth_userokay()without setgid
to "auth" ?
When testing this code:
#include <stdlib.h>
#include <login_cap.h>
#include <bsd_auth.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("authentication ");
char *user = strdup("me");
char *pass = strdup("pass");
if (!auth_userokay(user, NULL, "auth-mytest", pass))
printf("failed\n");
else
printf("successful\n");
return 0;
}
I get:
$ ./test
test: invalid script: /usr/libexec/auth/login_passwd
authentication failed
So it seems that I have to setgid to "auth", and my binary
must be setuid.
Am I wrong ? Is there a way of authenticatingwithout being
setuid ?
Thanks