summaryrefslogtreecommitdiffstats
path: root/sesman/verify_user.c
diff options
context:
space:
mode:
authorjsorg71 <jsorg71>2005-07-07 03:08:03 +0000
committerjsorg71 <jsorg71>2005-07-07 03:08:03 +0000
commitef1be2c6d3251139a50e1cf5c5e812741471b34a (patch)
tree0e6b17035fd98cec3e15a2b8ebf54a18bcb58c1b /sesman/verify_user.c
parentc2ff24010a345442a9d6f96274a22f454bfa3918 (diff)
downloadxrdp-proprietary-ef1be2c6d3251139a50e1cf5c5e812741471b34a.tar.gz
xrdp-proprietary-ef1be2c6d3251139a50e1cf5c5e812741471b34a.zip
pam changes
Diffstat (limited to 'sesman/verify_user.c')
-rw-r--r--sesman/verify_user.c55
1 files changed, 4 insertions, 51 deletions
diff --git a/sesman/verify_user.c b/sesman/verify_user.c
index 60ff48c0..7ee660d5 100644
--- a/sesman/verify_user.c
+++ b/sesman/verify_user.c
@@ -20,54 +20,8 @@
*/
-#ifdef USE_PAM
-
-#include <security/pam_userpass.h>
-
-#define SERVICE "xrdp"
-
-/******************************************************************************/
-/* returns boolean */
-int auth_userpass(char* user, char* pass)
-{
- pam_handle_t* pamh;
- pam_userpass_t userpass;
- struct pam_conv conv = {pam_userpass_conv, &userpass};
- const void* template1;
- int status;
-
- userpass.user = user;
- userpass.pass = pass;
- if (pam_start(SERVICE, user, &conv, &pamh) != PAM_SUCCESS)
- {
- return 0;
- }
- status = pam_authenticate(pamh, 0);
- if (status != PAM_SUCCESS)
- {
- pam_end(pamh, status);
- return 0;
- }
- status = pam_acct_mgmt(pamh, 0);
- if (status != PAM_SUCCESS)
- {
- pam_end(pamh, status);
- return 0;
- }
- status = pam_get_item(pamh, PAM_USER, &template1);
- if (status != PAM_SUCCESS)
- {
- pam_end(pamh, status);
- return 0;
- }
- if (pam_end(pamh, PAM_SUCCESS) != PAM_SUCCESS)
- {
- return 0;
- }
- return 1;
-}
-
-#else
+#include "arch.h"
+#include "os_calls.h"
#define _XOPEN_SOURCE
#include <unistd.h>
@@ -77,7 +31,8 @@ int auth_userpass(char* user, char* pass)
/******************************************************************************/
/* returns boolean */
-int auth_userpass(char* user, char* pass)
+int DEFAULT_CC
+auth_userpass(char* user, char* pass)
{
char salt[13] = "$1$";
char hash[35] = "";
@@ -133,5 +88,3 @@ int auth_userpass(char* user, char* pass)
}
return 1;
}
-
-#endif