diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2013-08-05 01:10:57 -0700 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2013-08-05 01:10:57 -0700 |
commit | e427113fa856cd8e7a30fd1c4b904f4396180ca7 (patch) | |
tree | c99f8aae7d89372b1982ac90234b2ea1377ccfac /sesman/chansrv/devredir.c | |
parent | 474d17d556d1f056b4055643a6a897483100dd7e (diff) | |
download | xrdp-proprietary-e427113fa856cd8e7a30fd1c4b904f4396180ca7.tar.gz xrdp-proprietary-e427113fa856cd8e7a30fd1c4b904f4396180ca7.zip |
chansrv: work on smartcard redir
Diffstat (limited to 'sesman/chansrv/devredir.c')
-rw-r--r-- | sesman/chansrv/devredir.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sesman/chansrv/devredir.c b/sesman/chansrv/devredir.c index f254fa89..57d877df 100644 --- a/sesman/chansrv/devredir.c +++ b/sesman/chansrv/devredir.c @@ -120,13 +120,15 @@ dev_redir_init(void) /* get a random number that will act as a unique clientID */ if ((fd = open("/dev/urandom", O_RDONLY))) { - read(fd, u.buf, 4); + if (read(fd, u.buf, 4) != 4) + { + } close(fd); } else { /* /dev/urandom did not work - use address of struct s */ - tui64 u64 = (tui64) &s; + tui64 u64 = (tui64) (tintptr) &s; u.clientID = (tui32) u64; } @@ -152,6 +154,7 @@ dev_redir_init(void) int APP_CC dev_redir_deinit(void) { + scard_deinit(); return 0; } @@ -282,6 +285,10 @@ done: int APP_CC dev_redir_get_wait_objs(tbus *objs, int *count, int *timeout) { + if (g_is_smartcard_redir_supported) + { + return scard_get_wait_objs(objs, count, timeout); + } return 0; } @@ -289,6 +296,10 @@ dev_redir_get_wait_objs(tbus *objs, int *count, int *timeout) int APP_CC dev_redir_check_wait_objs(void) { + if (g_is_smartcard_redir_supported) + { + return scard_check_wait_objs(); + } return 0; } @@ -619,6 +630,7 @@ void dev_redir_proc_client_core_cap_resp(struct stream *s) case CAP_SMARTCARD_TYPE: log_debug("got CAP_SMARTCARD_TYPE"); g_is_smartcard_redir_supported = 1; + scard_init(); xstream_seek(s, cap_len); break; } |