summaryrefslogtreecommitdiffstats
path: root/sesman
diff options
context:
space:
mode:
authorLaxmikant Rashinkar <LK.Rashinkar@gmail.com>2013-03-18 19:44:53 -0700
committerLaxmikant Rashinkar <LK.Rashinkar@gmail.com>2013-03-18 19:44:53 -0700
commit5d7ffc14314ff511b9c2777921339e6284a4e756 (patch)
tree5da53440e3762c528293be7d2ccc3788e0738b78 /sesman
parent5acc54cd1d1f84a6907102e3d133eb687b0eadad (diff)
parent26f4502ebfa857e0dd3382c53b0fdbea13c635b2 (diff)
downloadxrdp-proprietary-5d7ffc14314ff511b9c2777921339e6284a4e756.tar.gz
xrdp-proprietary-5d7ffc14314ff511b9c2777921339e6284a4e756.zip
Merge branch 'master' of github.com:FreeRDP/xrdp
Diffstat (limited to 'sesman')
-rw-r--r--sesman/chansrv/chansrv_fuse.c11
-rw-r--r--sesman/chansrv/devredir.h1
-rw-r--r--sesman/verify_user.c44
3 files changed, 17 insertions, 39 deletions
diff --git a/sesman/chansrv/chansrv_fuse.c b/sesman/chansrv/chansrv_fuse.c
index 9b16c9a3..27ce7573 100644
--- a/sesman/chansrv/chansrv_fuse.c
+++ b/sesman/chansrv/chansrv_fuse.c
@@ -52,7 +52,12 @@ char g_fuse_root_path[256] = "";
** **
******************************************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
#include "arch.h"
+#include "chansrv_fuse.h"
/* dummy calls when XRDP_FUSE is not defined */
int xfuse_init() {}
@@ -63,6 +68,12 @@ int xfuse_clear_clip_dir(void) {}
int xfuse_file_contents_range(int stream_id, char *data, int data_bytes) {}
int xfuse_file_contents_size(int stream_id, int file_size) {}
int xfuse_add_clip_dir_item(char *filename, int flags, int size, int lindex) {}
+int xfuse_create_share(tui32 device_id, char *dirname) {}
+void xfuse_devredir_cb_open_file(void *vp, tui32 DeviceId, tui32 FileId) {}
+void xfuse_devredir_cb_write_file(void *vp, char *buf, size_t length) {}
+void xfuse_devredir_cb_read_file(void *vp, char *buf, size_t length) {}
+void xfuse_devredir_cb_enum_dir(void *vp, struct xrdp_inode *xinode) {}
+void xfuse_devredir_cb_enum_dir_done(void *vp, tui32 IoStatus) {}
#else
diff --git a/sesman/chansrv/devredir.h b/sesman/chansrv/devredir.h
index 74615973..a4699dcd 100644
--- a/sesman/chansrv/devredir.h
+++ b/sesman/chansrv/devredir.h
@@ -27,6 +27,7 @@
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
+#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
diff --git a/sesman/verify_user.c b/sesman/verify_user.c
index 5bd89c73..85e614d3 100644
--- a/sesman/verify_user.c
+++ b/sesman/verify_user.c
@@ -50,12 +50,9 @@ auth_account_disabled(struct spwd *stp);
long DEFAULT_CC
auth_userpass(char *user, char *pass, int *errorcode)
{
- char salt[13] = "$1$";
- char hash[35] = "";
- char *encr = 0;
+ const char *encr;
struct passwd *spw;
struct spwd *stp;
- int saltcnt = 0;
spw = getpwnam(user);
@@ -76,50 +73,19 @@ auth_userpass(char *user, char *pass, int *errorcode)
if (1 == auth_account_disabled(stp))
{
- log_message(&(g_cfg->log), LOG_LEVEL_INFO, "account %s is disabled", user);
+ log_message(LOG_LEVEL_INFO, "account %s is disabled", user);
return 0;
}
- g_strncpy(hash, stp->sp_pwdp, 34);
+ encr = stp->sp_pwdp;
}
else
{
/* old system with only passwd */
- g_strncpy(hash, spw->pw_passwd, 34);
- }
-
- hash[34] = '\0';
-
- if (g_strncmp(hash, "$1$", 3) == 0)
- {
- /* gnu style crypt(); */
- saltcnt = 3;
-
- while ((hash[saltcnt] != '$') && (saltcnt < 11))
- {
- salt[saltcnt] = hash[saltcnt];
- saltcnt++;
- }
-
- salt[saltcnt] = '$';
- salt[saltcnt + 1] = '\0';
- }
- else
- {
- /* classic two char salt */
- salt[0] = hash[0];
- salt[1] = hash[1];
- salt[2] = '\0';
- }
-
- encr = crypt(pass, salt);
-
- if (g_strncmp(encr, hash, 34) != 0)
- {
- return 0;
+ encr = spw->pw_passwd;
}
- return 1;
+ return (strcmp(encr, crypt(pass, encr)) == 0);
}
/******************************************************************************/