From 1cec58d1f5060c2042c2c615d3b40f7a18396432 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 21 Aug 2012 18:29:37 -0500 Subject: Making PAM call the auth check utility --- src/pam-freerdp.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'src/pam-freerdp.c') diff --git a/src/pam-freerdp.c b/src/pam-freerdp.c index 9fc43ed..b06a56a 100644 --- a/src/pam-freerdp.c +++ b/src/pam-freerdp.c @@ -130,15 +130,13 @@ pam_sm_authenticate (pam_handle_t *pamh, int flags, int argc, const char **argv) case 0: { /* child */ dup2(stdinpipe[0], 0); - char * args[7]; + char * args[5]; - args[0] = XFREERDP; - args[1] = "--plugin"; - args[2] = "rdpsnd.so"; - args[3] = "--no-nla"; - args[4] = "-f"; - args[5] = "--from-stdin"; - args[6] = NULL; + args[0] = AUTH_CHECK; + args[1] = rhost; + args[2] = ruser; + args[3] = rdomain; + args[4] = NULL; struct passwd * pwdent = getpwnam(username); if (pwdent == NULL) { @@ -164,14 +162,7 @@ pam_sm_authenticate (pam_handle_t *pamh, int flags, int argc, const char **argv) int forkret = 0; int bytesout = 0; - bytesout += write(stdinpipe[1], ruser, strlen(ruser)); - bytesout += write(stdinpipe[1], " ", 1); - bytesout += write(stdinpipe[1], password, strlen(password)); - bytesout += write(stdinpipe[1], " ", 1); - bytesout += write(stdinpipe[1], rdomain, strlen(rdomain)); - bytesout += write(stdinpipe[1], " ", 1); - bytesout += write(stdinpipe[1], rhost, strlen(rhost)); - bytesout += write(stdinpipe[1], " ", 1); + bytesout = write(stdinpipe[1], password, strlen(password)); close(stdinpipe[1]); -- cgit v1.2.3 From efeb59db64ab1981a270f30f001c0a812047581e Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 21 Aug 2012 18:34:41 -0500 Subject: A newline for scanf --- src/pam-freerdp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/pam-freerdp.c') diff --git a/src/pam-freerdp.c b/src/pam-freerdp.c index b06a56a..5295098 100644 --- a/src/pam-freerdp.c +++ b/src/pam-freerdp.c @@ -162,7 +162,8 @@ pam_sm_authenticate (pam_handle_t *pamh, int flags, int argc, const char **argv) int forkret = 0; int bytesout = 0; - bytesout = write(stdinpipe[1], password, strlen(password)); + bytesout += write(stdinpipe[1], password, strlen(password)); + bytesout += write(stdinpipe[1], "\n", 1); close(stdinpipe[1]); -- cgit v1.2.3