summaryrefslogtreecommitdiffstats
path: root/sesman/sesman.c
diff options
context:
space:
mode:
authorjsorg71 <jsorg71>2005-06-04 23:51:51 +0000
committerjsorg71 <jsorg71>2005-06-04 23:51:51 +0000
commit74a67d2d3f9fd1e4e120373e49e6b02858d92bb9 (patch)
tree67eed529006be30b659e3571fb9adb57d66a3b66 /sesman/sesman.c
parent86ecad1197c04520d98ac62a8906e7b55a8b6e8d (diff)
downloadxrdp-proprietary-74a67d2d3f9fd1e4e120373e49e6b02858d92bb9.tar.gz
xrdp-proprietary-74a67d2d3f9fd1e4e120373e49e6b02858d92bb9.zip
added non pam authentication
Diffstat (limited to 'sesman/sesman.c')
-rw-r--r--sesman/sesman.c53
1 files changed, 5 insertions, 48 deletions
diff --git a/sesman/sesman.c b/sesman/sesman.c
index ae791fec..78cc41ee 100644
--- a/sesman/sesman.c
+++ b/sesman/sesman.c
@@ -37,16 +37,14 @@
#include "d3des.h"
-#include <security/pam_userpass.h>
-
#include "arch.h"
#include "parse.h"
#include "os_calls.h"
-#define SERVICE "xrdp"
+int auth_userpass(char* user, char* pass);
-int g_sck;
-int g_pid;
+static int g_sck;
+static int g_pid;
struct session_item
{
@@ -60,7 +58,7 @@ struct session_item
static unsigned char s_fixedkey[8] = {23, 82, 107, 6, 35, 78, 88, 7};
-struct session_item session_items[100];
+static struct session_item session_items[100];
/*****************************************************************************/
int tcp_force_recv(int sck, char* data, int len)
@@ -185,47 +183,6 @@ int x_server_running(int display)
}
/******************************************************************************/
-/* returns boolean */
-int auth_pam_userpass(const char* user, const 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;
-}
-
-/******************************************************************************/
void cterm(int s)
{
int i;
@@ -503,7 +460,7 @@ start session\n");
in_uint16_be(in_s, height);
in_uint16_be(in_s, bpp);
//g_printf("%d %d %d\n", width, height, bpp);
- ok = auth_pam_userpass(user, pass);
+ ok = auth_userpass(user, pass);
display = 0;
if (ok)
{