Browse Source

New upstream version 0.9.0~20161027+gitc524b06

tags/debian/0.9.0_20161027+gitc524b06-1
Dominik George 4 years ago
parent
commit
6906e43b16
52 changed files with 1050 additions and 341 deletions
  1. +1
    -1
      Makefile.am
  2. +16
    -1
      coding_style.md
  3. +1
    -1
      common/list.c
  4. +1
    -1
      common/list.h
  5. +1
    -1
      common/log.c
  6. +1
    -11
      common/log.h
  7. +6
    -6
      common/os_calls.c
  8. +2
    -2
      common/os_calls.h
  9. +27
    -10
      file-loc.txt
  10. +1
    -0
      instfiles/Makefile.am
  11. +124
    -0
      instfiles/keymap-names.txt
  12. +659
    -0
      instfiles/km-040a.ini
  13. +20
    -27
      libxrdp/Makefile.am
  14. +6
    -7
      libxrdp/xrdp_rdp.c
  15. +6
    -9
      neutrinordp/Makefile.am
  16. +0
    -41
      prog_std.txt
  17. +6
    -9
      rdp/Makefile.am
  18. +1
    -1
      readme.txt
  19. +2
    -2
      sesman/access.c
  20. +2
    -2
      sesman/access.h
  21. +4
    -4
      sesman/auth.h
  22. +16
    -22
      sesman/chansrv/Makefile.am
  23. +1
    -1
      sesman/chansrv/clipboard_file.c
  24. +4
    -4
      sesman/chansrv/fifo.c
  25. +20
    -4
      sesman/config.c
  26. +3
    -0
      sesman/config.h
  27. +3
    -3
      sesman/env.c
  28. +3
    -3
      sesman/env.h
  29. +1
    -1
      sesman/libscp/libscp_connection.c
  30. +1
    -1
      sesman/libscp/libscp_session.c
  31. +0
    -2
      sesman/libscp/libscp_v1s.c
  32. +10
    -3
      sesman/scp.c
  33. +1
    -5
      sesman/scp_v0.c
  34. +0
    -4
      sesman/scp_v1.c
  35. +0
    -3
      sesman/scp_v1_mng.c
  36. +6
    -8
      sesman/session.c
  37. +3
    -2
      sesman/session.h
  38. +3
    -0
      sesman/sig.c
  39. +4
    -4
      sesman/tools/sesadmin.c
  40. +3
    -3
      sesman/verify_user.c
  41. +3
    -3
      sesman/verify_user_bsd.c
  42. +1
    -1
      sesman/verify_user_kerberos.c
  43. +1
    -1
      sesman/verify_user_pam.c
  44. +1
    -1
      sesman/verify_user_pam_userpass.c
  45. +3
    -0
      xorg/X11R7.6/.gitignore
  46. +37
    -55
      xorg/X11R7.6/buildx.sh
  47. +8
    -8
      xorg/X11R7.6/x11_file_list.txt
  48. +20
    -27
      xrdp/Makefile.am
  49. +3
    -2
      xrdp/xrdp.ini
  50. +4
    -4
      xrdp/xrdp_bitmap.c
  51. +0
    -15
      xrdpapi/Makefile.am
  52. +0
    -15
      xrdpvr/Makefile.am

+ 1
- 1
Makefile.am View File

@@ -2,7 +2,7 @@ ACLOCAL_AMFLAGS = -I m4
AM_DISTCHECK_CONFIGURE_FLAGS = --without-systemdsystemunitdir

EXTRA_DIST = bootstrap COPYING coding_style.md design.txt faq-compile.txt \
faq-general.txt file-loc.txt install.txt m4 prog_std.txt readme.txt
faq-general.txt file-loc.txt install.txt m4 readme.txt

if XRDP_NEUTRINORDP
NEUTRINORDPDIR = neutrinordp


+ 16
- 1
coding_style.md View File

@@ -15,6 +15,13 @@ Here is how we run the astyle command:
This coding style is a work in progress and is still evolving.


Language Standard
-----------------

Try to make all code compile with both C and C++ compiler. C++ is more
strict, which makes the code safer.


Indentation
-----------

@@ -32,7 +39,7 @@ Indentation
Line wrapping
-------------

* Keep lines shorter than 80 chars
* Keep lines not longer than 80 chars
* Align wrapped argument to the first argument

@@ -46,9 +53,11 @@ Variable names

* Use lowercase with underscores as needed
* Don't use camelCase
* Preprocessor constants should be uppercase


#define BUF_SIZE 1024
int fd;
int bytes_in_stream;

@@ -193,3 +202,9 @@ Braces
default:
printf("bad cmd\n");
}

Comments
--------

Use /* */ for comments
Don't use //

+ 1
- 1
common/list.c View File

@@ -82,7 +82,7 @@ list_add_item(struct list *self, tbus item)

/*****************************************************************************/
tbus APP_CC
list_get_item(struct list *self, int index)
list_get_item(const struct list *self, int index)
{
if (index < 0 || index >= self->count)
{


+ 1
- 1
common/list.h View File

@@ -40,7 +40,7 @@ list_delete(struct list* self);
void APP_CC
list_add_item(struct list* self, tintptr item);
tintptr APP_CC
list_get_item(struct list* self, int index);
list_get_item(const struct list *self, int index);
void APP_CC
list_clear(struct list* self);
int APP_CC


+ 1
- 1
common/log.c View File

@@ -222,7 +222,7 @@ internal_log_end(struct log_config *l_cfg)
* @return
*/
enum logLevels DEFAULT_CC
internal_log_text2level(char *buf)
internal_log_text2level(const char *buf)
{
if (0 == g_strcasecmp(buf, "0") ||
0 == g_strcasecmp(buf, "core"))


+ 1
- 11
common/log.h View File

@@ -113,7 +113,7 @@ internal_log_lvl2str(const enum logLevels lvl, char *str);
*
*/
enum logLevels DEFAULT_CC
internal_log_text2level(char *s);
internal_log_text2level(const char *s);

/**
* A function that init our struct that holds all state and
@@ -173,16 +173,6 @@ log_end(void);
enum logReturns DEFAULT_CC
log_message(const enum logLevels lvl, const char *msg, ...) printflike(2, 3);

/**
*
* @brief Reads configuration
* @param s translates the strings "1", "true" and "yes" in 1 (true) and
* other strings in 0
* @return 0 on success, 1 on failure
*
*/
int APP_CC text2bool(char *s);

/**
* This function returns the configured file name for the logfile
* @param replybuf the buffer where the reply is stored


+ 6
- 6
common/os_calls.c View File

@@ -264,7 +264,7 @@ g_write(const char *format, ...)
/*****************************************************************************/
/* produce a hex dump */
void APP_CC
g_hexdump(char *p, int len)
g_hexdump(const char *p, int len)
{
unsigned char *line;
int i;
@@ -439,7 +439,7 @@ g_tcp_socket(void)
if (setsockopt(rv, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&option_value,
option_len) < 0)
{
log_message(LOG_LEVEL_ERROR, "g_tcp_socket: setsockopt() failed\n");
log_message(LOG_LEVEL_ERROR, "g_tcp_socket: setsockopt() failed");
}
}
}
@@ -455,7 +455,7 @@ g_tcp_socket(void)
if (setsockopt(rv, SOL_SOCKET, SO_REUSEADDR, (char *)&option_value,
option_len) < 0)
{
log_message(LOG_LEVEL_ERROR, "g_tcp_socket: setsockopt() failed\n");
log_message(LOG_LEVEL_ERROR, "g_tcp_socket: setsockopt() failed");
}
}
}
@@ -472,7 +472,7 @@ g_tcp_socket(void)
if (setsockopt(rv, SOL_SOCKET, SO_SNDBUF, (char *)&option_value,
option_len) < 0)
{
log_message(LOG_LEVEL_ERROR, "g_tcp_socket: setsockopt() failed\n");
log_message(LOG_LEVEL_ERROR, "g_tcp_socket: setsockopt() failed");
}
}
}
@@ -846,7 +846,7 @@ g_sck_set_non_blocking(int sck)
i = i | O_NONBLOCK;
if (fcntl(sck, F_SETFL, i) < 0)
{
log_message(LOG_LEVEL_ERROR, "g_sck_set_non_blocking: fcntl() failed\n");
log_message(LOG_LEVEL_ERROR, "g_sck_set_non_blocking: fcntl() failed");
}
#endif
return 0;
@@ -1342,7 +1342,7 @@ g_set_nonblock(int fd)
/*****************************************************************************/
/* returns 0 on error */
tintptr APP_CC
g_create_wait_obj(char *name)
g_create_wait_obj(const char *name)
{
#ifdef _WIN32
tintptr obj;


+ 2
- 2
common/os_calls.h View File

@@ -55,7 +55,7 @@ int DEFAULT_CC g_snprintf(char* dest, int len, const char* format, ...) \
printflike(3, 4);
void DEFAULT_CC g_writeln(const char* format, ...) printflike(1, 2);
void DEFAULT_CC g_write(const char* format, ...) printflike(1, 2);
void APP_CC g_hexdump(char* p, int len);
void APP_CC g_hexdump(const char *p, int len);
void APP_CC g_memset(void* ptr, int val, int size);
void APP_CC g_memcpy(void* d_ptr, const void* s_ptr, int size);
int APP_CC g_getchar(void);
@@ -88,7 +88,7 @@ int APP_CC g_sck_can_recv(int sck, int millis);
int APP_CC g_sck_select(int sck1, int sck2);
void APP_CC g_write_ip_address(int rcv_sck, char* ip_address, int bytes);
void APP_CC g_sleep(int msecs);
tintptr APP_CC g_create_wait_obj(char* name);
tintptr APP_CC g_create_wait_obj(const char *name);
tintptr APP_CC g_create_wait_obj_from_socket(tintptr socket, int write);
void APP_CC g_delete_wait_obj_from_socket(tintptr wait_obj);
int APP_CC g_set_wait_obj(tintptr obj);


+ 27
- 10
file-loc.txt View File

@@ -1,63 +1,80 @@

default build will install the following

/usr/local/lib/xrdp/
/usr/local/lib/xrdp
libcommon.so
libmc.so
librdp.so
libscp.so
libvnc.so
libxrdp.so
libxrdpapi.so
libxup.so

/usr/local/bin/
/usr/local/bin
xrdp-dis
xrdp-genkeymap
xrdp-keygen
xrdp-sesadmin
xrdp-sesrun
xrdp-sestest

/usr/local/sbin/
/usr/local/sbin
xrdp
xrdp-sesman
xrdp-sessvc
xrdp-chansrv

/etc/xrdp/
/etc/xrdp
km-xxxx.ini
sesman.ini
rsakeys.ini
startwm.sh
xrdp.ini
xrdp_keyboard.ini
xrdp.sh

/etc/pam.d/
/etc/xrdp/pulse
default.pa

/etc/pam.d
xrdp-sesman

/usr/local/share/man/man1
xrdp-dis.1

/usr/local/share/man/man5
sesman.ini.5
xrdp.ini.5

/usr/local/share/man/man8
xrdp.8
xrdp-chansrv.8
xrdp-genkeymap.8
xrdp-keygen.8
xrdp-sesadmin.8
xrdp-sesman.8
xrdp-sesrun.8
xrdp-sessvc.8
xrdp.8

/usr/local/share/xrdp
ad24b.bmp
ad256.bmp
cursor0.cur
cursor1.cur
sans-10.fv1
xrdp24b.bmp
xrdp256.bmp
xrdp_logo.bmp

when running, the following are created and written to

/var/run/
/var/run
xrdp.pid
sesman.pid

/var/log/
/var/log
xrdp.log
xrdp-sesman.log

/tmp
/tmp/.xrdp
xrdp*

+ 1
- 0
instfiles/Makefile.am View File

@@ -11,6 +11,7 @@ startscriptdir=$(sysconfdir)/xrdp
dist_startscript_DATA = \
km-0407.ini \
km-0409.ini \
km-040a.ini \
km-040c.ini \
km-0410.ini \
km-0411.ini \


+ 124
- 0
instfiles/keymap-names.txt View File

@@ -0,0 +1,124 @@

0x0436 af Afrikaans
0x041C sq Albanian
0x0001 ar Arabic
0x0401 ar-sa Arabic (Saudi Arabia)
0x0801 ar-iq Arabic (Iraq)
0x0C01 ar-eg Arabic (Egypt)
0x1001 ar-ly Arabic (Libya)
0x1401 ar-dz Arabic (Algeria)
0x1801 ar-ma Arabic (Morocco)
0x1C01 ar-tn Arabic (Tunisia)
0x2001 ar-om Arabic (Oman)
0x2401 ar-ye Arabic (Yemen)
0x2801 ar-sy Arabic (Syria)
0x2C01 ar-jo Arabic (Jordan)
0x3001 ar-lb Arabic (Lebanon)
0x3401 ar-kw Arabic (Kuwait)
0x3801 ar-ae Arabic (U.A.E.)
0x3C01 ar-bh Arabic (Bahrain)
0x4001 ar-qa Arabic (Qatar)
0x042D eu Basque
0x0402 bg Bulgarian
0x0423 be Belarusian
0x0403 ca Catalan
0x0004 zh Chinese
0x0404 zh-tw Chinese (Taiwan)
0x0804 zh-cn Chinese (China)
0x0C04 zh-hk Chinese (Hong Kong SAR)
0x1004 zh-sg Chinese (Singapore)
0x041A hr Croatian
0x0405 cs Czech
0x0406 da Danish
0x0413 nl Dutch (Netherlands)
0x0813 nl-be Dutch (Belgium)
0x0009 en English
0x0409 en-us English (United States)
0x0809 en-gb English (United Kingdom)
0x0C09 en-au English (Australia)
0x1009 en-ca English (Canada)
0x1409 en-nz English (New Zealand)
0x1809 en-ie English (Ireland)
0x1C09 en-za English (South Africa)
0x2009 en-jm English (Jamaica)
0x2809 en-bz English (Belize)
0x2C09 en-tt English (Trinidad)
0x0425 et Estonian
0x0438 fo Faeroese
0x0429 fa Farsi
0x040B fi Finnish
0x040C fr French (France)
0x080C fr-be French (Belgium)
0x0C0C fr-ca French (Canada)
0x100C fr-ch French (Switzerland)
0x140C fr-lu French (Luxembourg)
0x043C gd Gaelic
0x0407 de German (Germany)
0x0807 de-ch German (Switzerland)
0x0C07 de-at German (Austria)
0x1007 de-lu German (Luxembourg)
0x1407 de-li German (Liechtenstein)
0x0408 el Greek
0x040D he Hebrew
0x0439 hi Hindi
0x040E hu Hungarian
0x040F is Icelandic
0x0421 in Indonesian
0x0410 it Italian (Italy)
0x0810 it-ch Italian (Switzerland)
0x0411 ja Japanese
0x0412 ko Korean
0x0426 lv Latvian
0x0427 lt Lithuanian
0x042F mk FYRO Macedonian
0x043E ms Malay (Malaysia)
0x043A mt Maltese
0x0414 no Norwegian (Bokmal)
0x0814 no Norwegian (Nynorsk)
0x0415 pl Polish
0x0416 pt-br Portuguese (Brazil)
0x0816 pt Portuguese (Portugal)
0x0417 rm Rhaeto-Romanic
0x0418 ro Romanian
0x0818 ro-mo Romanian (Moldova)
0x0419 ru Russian
0x0819 ru-mo Russian (Moldova)
0x0C1A sr Serbian (Cyrillic)
0x081A sr Serbian (Latin)
0x041B sk Slovak
0x0424 sl Slovenian
0x042E sb Sorbian
0x040A es Spanish (Traditional Sort)
0x080A es-mx Spanish (Mexico)
0x0C0A es Spanish (International Sort)
0x100A es-gt Spanish (Guatemala)
0x140A es-cr Spanish (Costa Rica)
0x180A es-pa Spanish (Panama)
0x1C0A es-do Spanish (Dominican Republic)
0x200A es-ve Spanish (Venezuela)
0x240A es-co Spanish (Colombia)
0x280A es-pe Spanish (Peru)
0x2C0A es-ar Spanish (Argentina)
0x300A es-ec Spanish (Ecuador)
0x340A es-cl Spanish (Chile)
0x380A es-uy Spanish (Uruguay)
0x3C0A es-py Spanish (Paraguay)
0x400A es-bo Spanish (Bolivia)
0x440A es-sv Spanish (El Salvador)
0x480A es-hn Spanish (Honduras)
0x4C0A es-ni Spanish (Nicaragua)
0x500A es-pr Spanish (Puerto Rico)
0x0430 sx Sutu
0x041D sv Swedish
0x081D sv-fi Swedish (Finland)
0x041E th Thai
0x0431 ts Tsonga
0x0432 tn Tswana
0x041F tr Turkish
0x0422 uk Ukrainian
0x0420 ur Urdu
0x042A vi Vietnamese
0x0434 xh Xhosa
0x043D ji Yiddish
0x0435 zu Zulu


+ 659
- 0
instfiles/km-040a.ini View File

@@ -0,0 +1,659 @@
[noshift]
Key8=0:0
Key9=65307:27
Key10=49:49
Key11=50:50
Key12=51:51
Key13=52:52
Key14=53:53
Key15=54:54
Key16=55:55
Key17=56:56
Key18=57:57
Key19=48:48
Key20=39:39
Key21=161:161
Key22=65288:8
Key23=65289:9
Key24=113:113
Key25=119:119
Key26=101:101
Key27=114:114
Key28=116:116
Key29=121:121
Key30=117:117
Key31=105:105
Key32=111:111
Key33=112:112
Key34=65104:96
Key35=43:43
Key36=65293:13
Key37=65507:0
Key38=97:97
Key39=115:115
Key40=100:100
Key41=102:102
Key42=103:103
Key43=104:104
Key44=106:106
Key45=107:107
Key46=108:108
Key47=241:241
Key48=65105:180
Key49=186:186
Key50=65505:0
Key51=231:231
Key52=122:122
Key53=120:120
Key54=99:99
Key55=118:118
Key56=98:98
Key57=110:110
Key58=109:109
Key59=44:44
Key60=46:46
Key61=45:45
Key62=65506:0
Key63=65450:42
Key64=65364:0
Key65=32:32
Key66=65509:0
Key67=65470:0
Key68=65471:0
Key69=65472:0
Key70=65473:0
Key71=65474:0
Key72=65475:0
Key73=65476:0
Key74=65477:0
Key75=65478:0
Key76=65479:0
Key77=65407:0
Key78=65300:0
Key79=65429:0
Key80=65431:0
Key81=65434:0
Key82=65453:45
Key83=65430:0
Key84=65437:0
Key85=65432:0
Key86=65451:43
Key87=65436:0
Key88=65433:0
Key89=65435:0
Key90=65438:0
Key91=65439:0
Key92=0:0
Key93=0:0
Key94=60:60
Key95=65480:0
Key96=65481:0
Key97=65360:0
Key98=65362:0
Key99=65365:0
Key100=65361:0
Key101=0:0
Key102=65363:0
Key103=65367:0
Key104=65364:0
Key105=65366:0
Key106=65379:0
Key107=65535:127
Key108=65421:13
Key109=65508:0
Key110=65299:0
Key111=65377:0
Key112=65455:47
Key113=65514:0
Key114=0:0
Key115=65515:0
Key116=65516:0
Key117=65383:0
Key118=0:0
Key119=0:0
Key120=0:0
Key121=0:0
Key122=0:0
Key123=0:0
Key124=65027:0
Key125=0:0
Key126=65469:61
Key127=0:0
Key128=0:0
Key129=0:0
Key130=0:0
Key131=0:0
Key132=0:0
Key133=0:0
Key134=0:0
Key135=0:0
Key136=0:0
Key137=0:0

[shift]
Key8=0:0
Key9=65307:27
Key10=33:33
Key11=34:34
Key12=183:183
Key13=36:36
Key14=37:37
Key15=38:38
Key16=47:47
Key17=40:40
Key18=41:41
Key19=61:61
Key20=63:63
Key21=191:191
Key22=65288:8
Key23=65056:0
Key24=81:81
Key25=87:87
Key26=69:69
Key27=82:82
Key28=84:84
Key29=89:89
Key30=85:85
Key31=73:73
Key32=79:79
Key33=80:80
Key34=65106:94
Key35=42:42
Key36=65293:13
Key37=65507:0
Key38=65:65
Key39=83:83
Key40=68:68
Key41=70:70
Key42=71:71
Key43=72:72
Key44=74:74
Key45=75:75
Key46=76:76
Key47=209:209
Key48=65111:168
Key49=170:170
Key50=65505:0
Key51=199:199
Key52=90:90
Key53=88:88
Key54=67:67
Key55=86:86
Key56=66:66
Key57=78:78
Key58=77:77
Key59=59:59
Key60=58:58
Key61=95:95
Key62=65506:0
Key63=65450:42
Key64=65364:0
Key65=32:32
Key66=65509:0
Key67=65470:0
Key68=65471:0
Key69=65472:0
Key70=65473:0
Key71=65474:0
Key72=65475:0
Key73=65476:0
Key74=65477:0
Key75=65478:0
Key76=65479:0
Key77=65273:0
Key78=65300:0
Key79=65463:55
Key80=65464:56
Key81=65465:57
Key82=65453:45
Key83=65460:52
Key84=65461:53
Key85=65462:54
Key86=65451:43
Key87=65457:49
Key88=65458:50
Key89=65459:51
Key90=65456:48
Key91=65454:46
Key92=0:0
Key93=0:0
Key94=62:62
Key95=65480:0
Key96=65481:0
Key97=65360:0
Key98=65362:0
Key99=65365:0
Key100=65361:0
Key101=0:0
Key102=65363:0
Key103=65367:0
Key104=65364:0
Key105=65366:0
Key106=65379:0
Key107=65535:127
Key108=65421:13
Key109=65508:0
Key110=65299:0
Key111=65377:0
Key112=65455:47
Key113=65512:0
Key114=0:0
Key115=65515:0
Key116=65516:0
Key117=65383:0
Key118=0:0
Key119=0:0
Key120=0:0
Key121=0:0
Key122=0:0
Key123=0:0
Key124=65027:0
Key125=65513:0
Key126=65469:61
Key127=65515:0
Key128=65517:0
Key129=0:0
Key130=0:0
Key131=0:0
Key132=0:0
Key133=0:0
Key134=0:0
Key135=0:0
Key136=0:0
Key137=0:0

[altgr]
Key8=0:0
Key9=65307:27
Key10=124:124
Key11=64:64
Key12=35:35
Key13=126:126
Key14=189:189
Key15=172:172
Key16=123:123
Key17=91:91
Key18=93:93
Key19=125:125
Key20=92:92
Key21=126:126
Key22=65288:8
Key23=65289:9
Key24=64:64
Key25=435:322
Key26=8364:8364
Key27=182:182
Key28=956:359
Key29=2299:8592
Key30=2302:8595
Key31=2301:8594
Key32=248:248
Key33=254:254
Key34=91:91
Key35=93:93
Key36=65293:13
Key37=65507:0
Key38=230:230
Key39=223:223
Key40=240:240
Key41=496:273
Key42=959:331
Key43=689:295
Key44=106:106
Key45=930:312
Key46=435:322
Key47=126:126
Key48=123:123
Key49=92:92
Key50=65505:0
Key51=125:125
Key52=171:171
Key53=187:187
Key54=162:162
Key55=2770:8220
Key56=2771:8221
Key57=110:110
Key58=181:181
Key59=2211:0
Key60=183:183
Key61=65120:0
Key62=65506:0
Key63=65450:42
Key64=65364:0
Key65=32:32
Key66=65509:0
Key67=65470:0
Key68=65471:0
Key69=65472:0
Key70=65473:0
Key71=65474:0
Key72=65475:0
Key73=65476:0
Key74=65477:0
Key75=65478:0
Key76=65479:0
Key77=65407:0
Key78=65300:0
Key79=65429:0
Key80=65431:0
Key81=65434:0
Key82=65453:45
Key83=65430:0
Key84=65437:0
Key85=65432:0
Key86=65451:43
Key87=65436:0
Key88=65433:0
Key89=65435:0
Key90=65438:0
Key91=65439:0
Key92=0:0
Key93=0:0
Key94=124:124
Key95=65480:0
Key96=65481:0
Key97=65360:0
Key98=65362:0
Key99=65365:0
Key100=65361:0
Key101=0:0
Key102=65363:0
Key103=65367:0
Key104=65364:0
Key105=65366:0
Key106=65379:0
Key107=65535:127
Key108=65421:13
Key109=65508:0
Key110=65299:0
Key111=0:0
Key112=65455:47
Key113=65514:0
Key114=0:0
Key115=65515:0
Key116=65516:0
Key117=65383:0
Key118=0:0
Key119=0:0
Key120=0:0
Key121=0:0
Key122=0:0
Key123=0:0
Key124=65027:0
Key125=0:0
Key126=65469:61
Key127=0:0
Key128=0:0
Key129=0:0
Key130=0:0
Key131=0:0
Key132=0:0
Key133=0:0
Key134=0:0
Key135=0:0
Key136=0:0
Key137=0:0

[capslock]
Key8=0:0
Key9=65307:27
Key10=49:49
Key11=50:50
Key12=51:51
Key13=52:52
Key14=53:53
Key15=54:54
Key16=55:55
Key17=56:56
Key18=57:57
Key19=48:48
Key20=39:39
Key21=161:161
Key22=65288:8
Key23=65289:9
Key24=81:81
Key25=87:87
Key26=69:69
Key27=82:82
Key28=84:84
Key29=89:89
Key30=85:85
Key31=73:73
Key32=79:79
Key33=80:80
Key34=65104:96
Key35=43:43
Key36=65293:13
Key37=65507:0
Key38=65:65
Key39=83:83
Key40=68:68
Key41=70:70
Key42=71:71
Key43=72:72
Key44=74:74
Key45=75:75
Key46=76:76
Key47=209:209
Key48=65105:180
Key49=186:186
Key50=65505:0
Key51=199:199
Key52=90:90
Key53=88:88
Key54=67:67
Key55=86:86
Key56=66:66
Key57=78:78
Key58=77:77
Key59=44:44
Key60=46:46
Key61=45:45
Key62=65506:0
Key63=65450:42
Key64=65364:0
Key65=32:32
Key66=65509:0
Key67=65470:0
Key68=65471:0
Key69=65472:0
Key70=65473:0
Key71=65474:0
Key72=65475:0
Key73=65476:0
Key74=65477:0
Key75=65478:0
Key76=65479:0
Key77=65407:0
Key78=65300:0
Key79=65429:0
Key80=65431:0
Key81=65434:0
Key82=65453:45
Key83=65430:0
Key84=65437:0
Key85=65432:0
Key86=65451:43
Key87=65436:0
Key88=65433:0
Key89=65435:0
Key90=65438:0
Key91=65439:0
Key92=0:0
Key93=0:0
Key94=60:60
Key95=65480:0
Key96=65481:0
Key97=65360:0
Key98=65362:0
Key99=65365:0
Key100=65361:0
Key101=0:0
Key102=65363:0
Key103=65367:0
Key104=65364:0
Key105=65366:0
Key106=65379:0
Key107=65535:127
Key108=65421:13
Key109=65508:0
Key110=65299:0
Key111=65377:0
Key112=65455:47
Key113=65514:0
Key114=0:0
Key115=65515:0
Key116=65516:0
Key117=65383:0
Key118=0:0
Key119=0:0
Key120=0:0
Key121=0:0
Key122=0:0
Key123=0:0
Key124=65027:0
Key125=0:0
Key126=65469:61
Key127=0:0
Key128=0:0
Key129=0:0
Key130=0:0
Key131=0:0
Key132=0:0
Key133=0:0
Key134=0:0
Key135=0:0
Key136=0:0
Key137=0:0

[shiftcapslock]
Key8=0:0
Key9=65307:27
Key10=33:33
Key11=34:34
Key12=183:183
Key13=36:36
Key14=37:37
Key15=38:38
Key16=47:47
Key17=40:40
Key18=41:41
Key19=61:61
Key20=63:63
Key21=191:191
Key22=65288:8
Key23=65056:0
Key24=113:113
Key25=119:119
Key26=101:101
Key27=114:114
Key28=116:116
Key29=121:121
Key30=117:117
Key31=105:105
Key32=111:111
Key33=112:112
Key34=65106:94
Key35=42:42
Key36=65293:13
Key37=65507:0
Key38=97:97
Key39=115:115
Key40=100:100
Key41=102:102
Key42=103:103
Key43=104:104
Key44=106:106
Key45=107:107
Key46=108:108
Key47=241:241
Key48=65111:168
Key49=170:170
Key50=65505:0
Key51=231:231
Key52=122:122
Key53=120:120
Key54=99:99
Key55=118:118
Key56=98:98
Key57=110:110
Key58=109:109
Key59=59:59
Key60=58:58
Key61=95:95
Key62=65506:0
Key63=65450:42
Key64=65364:0
Key65=32:32
Key66=65509:0
Key67=65470:0
Key68=65471:0
Key69=65472:0
Key70=65473:0
Key71=65474:0
Key72=65475:0
Key73=65476:0
Key74=65477:0
Key75=65478:0
Key76=65479:0
Key77=65273:0
Key78=65300:0
Key79=65463:55
Key80=65464:56
Key81=65465:57
Key82=65453:45
Key83=65460:52
Key84=65461:53
Key85=65462:54
Key86=65451:43
Key87=65457:49
Key88=65458:50
Key89=65459:51
Key90=65456:48
Key91=65454:46
Key92=0:0
Key93=0:0
Key94=62:62
Key95=65480:0
Key96=65481:0
Key97=65360:0
Key98=65362:0
Key99=65365:0
Key100=65361:0
Key101=0:0
Key102=65363:0
Key103=65367:0
Key104=65364:0
Key105=65366:0
Key106=65379:0
Key107=65535:127
Key108=65421:13
Key109=65508:0
Key110=65299:0
Key111=65377:0
Key112=65455:47
Key113=65512:0
Key114=0:0
Key115=65515:0
Key116=65516:0
Key117=65383:0
Key118=0:0
Key119=0:0
Key120=0:0
Key121=0:0
Key122=0:0
Key123=0:0
Key124=65027:0
Key125=65513:0
Key126=65469:61
Key127=65515:0
Key128=65517:0
Key129=0:0
Key130=0:0
Key131=0:0
Key132=0:0
Key133=0:0
Key134=0:0
Key135=0:0
Key136=0:0
Key137=0:0

+ 20
- 27
libxrdp/Makefile.am View File

@@ -1,40 +1,36 @@
EXTRA_DEFINES =
EXTRA_INCLUDES =
EXTRA_LIBS =
EXTRA_FLAGS =
AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
-DXRDP_PID_PATH=\"${localstatedir}/run\" \
-I$(top_srcdir)/common

AM_LDFLAGS =

LIBXRDP_EXTRA_LIBS =

if XRDP_DEBUG
EXTRA_DEFINES += -DXRDP_DEBUG
AM_CPPFLAGS += -DXRDP_DEBUG
else
EXTRA_DEFINES += -DXRDP_NODEBUG
AM_CPPFLAGS += -DXRDP_NODEBUG
endif

if XRDP_NEUTRINORDP
EXTRA_DEFINES += -DXRDP_NEUTRINORDP
EXTRA_LIBS += $(FREERDP_LIBS)
AM_CPPFLAGS += -DXRDP_NEUTRINORDP
LIBXRDP_EXTRA_LIBS += $(FREERDP_LIBS)
endif

if XRDP_TJPEG
EXTRA_DEFINES += -DXRDP_JPEG -DXRDP_TJPEG
EXTRA_INCLUDES += @TurboJpegIncDir@
EXTRA_FLAGS += @TurboJpegLibDir@
EXTRA_LIBS += -lturbojpeg
AM_CPPFLAGS += -DXRDP_JPEG -DXRDP_TJPEG @TurboJpegIncDir@
AM_LDFLAGS += @TurboJpegLibDir@
LIBXRDP_EXTRA_LIBS += -lturbojpeg
else
if XRDP_JPEG
EXTRA_DEFINES += -DXRDP_JPEG
EXTRA_LIBS += -ljpeg
AM_CPPFLAGS += -DXRDP_JPEG
LIBXRDP_EXTRA_LIBS += -ljpeg
endif
endif

AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
-DXRDP_PID_PATH=\"${localstatedir}/run\" \
$(EXTRA_DEFINES) \
-I$(top_srcdir)/common \
$(EXTRA_INCLUDES)

module_LTLIBRARIES = \
libxrdp.la

@@ -57,9 +53,6 @@ libxrdp_la_SOURCES = \
xrdp_rdp.c \
xrdp_sec.c

libxrdp_la_LDFLAGS = \
$(EXTRA_FLAGS)

libxrdp_la_LIBADD = \
$(top_builddir)/common/libcommon.la \
$(EXTRA_LIBS)
$(LIBXRDP_EXTRA_LIBS)

+ 6
- 7
libxrdp/xrdp_rdp.c View File

@@ -197,8 +197,8 @@ xrdp_rdp_read_config(struct xrdp_client_info *client_info)
/* default certificate path */
g_snprintf(client_info->certificate, 1023, "%s/cert.pem", XRDP_CFG_PATH);
log_message(LOG_LEVEL_INFO,
"Missing definition of X.509 certificate, use "
"default instead: %s", client_info->certificate);
"Using default X.509 certificate: %s",
client_info->certificate);

}
else if (value[0] != '/')
@@ -206,7 +206,7 @@ xrdp_rdp_read_config(struct xrdp_client_info *client_info)
/* default certificate path */
g_snprintf(client_info->certificate, 1023, "%s/cert.pem", XRDP_CFG_PATH);
log_message(LOG_LEVEL_WARNING,
"No absolute path to X.509 certificate, use "
"X.509 certificate should use absolute path, using "
"default instead: %s", client_info->certificate);
}
else
@@ -222,16 +222,15 @@ xrdp_rdp_read_config(struct xrdp_client_info *client_info)
{
/* default key_file path */
g_snprintf(client_info->key_file, 1023, "%s/key.pem", XRDP_CFG_PATH);
log_message(LOG_LEVEL_INFO,
"Missing definition of X.509 key file, use "
"default instead: %s", client_info->key_file);
log_message(LOG_LEVEL_INFO, "Using default X.509 key file: %s",
client_info->key_file);
}
else if (value[0] != '/')
{
/* default key_file path */
g_snprintf(client_info->key_file, 1023, "%s/key.pem", XRDP_CFG_PATH);
log_message(LOG_LEVEL_WARNING,
"No absolute path to X.509 key file, use"
"X.509 key file should use absolute path, using "
"default instead: %s", client_info->key_file);
}
else


+ 6
- 9
neutrinordp/Makefile.am View File

@@ -1,20 +1,17 @@
EXTRA_DEFINES =
if XRDP_DEBUG
EXTRA_DEFINES += -DXRDP_DEBUG
else
EXTRA_DEFINES += -DXRDP_NODEBUG
endif

AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
-DXRDP_PID_PATH=\"${localstatedir}/run\" \
$(EXTRA_DEFINES) \
-I$(top_srcdir)/common \
$(FREERDP_CFLAGS)

if XRDP_DEBUG
AM_CPPFLAGS += -DXRDP_DEBUG
else
AM_CPPFLAGS += -DXRDP_NODEBUG
endif

module_LTLIBRARIES = \
libxrdpneutrinordp.la



+ 0
- 41
prog_std.txt View File

@@ -1,41 +0,0 @@

This is an attempt to explain my odd programming standard used for this project.
Not to defend any of these but it's my default standard and it makes it easy
for me to read code.

Some files break these rules, they will be updated eventually.

try to make any file compile with c++ compilers

always put one var on a line by itself
char* pvar;
char text[256];
not
char *pvar, text[256];

function calls look like this
foo(a, b, c);
not
foo ( a, b, c );

while, if, and case statements look like
while (i != 0)
not
while(i != 0)

for comments, always use /* */, not //

defines should always be uppercase

don't use tabs, use spaces

no line should exceed 80 chars

always use {} in if and while, even if it's only one line
while (p != 0)
{
p = p->next;
}
not
while (p != 0)
p = p->next;

+ 6
- 9
rdp/Makefile.am View File

@@ -1,19 +1,16 @@
EXTRA_DEFINES =
if XRDP_DEBUG
EXTRA_DEFINES += -DXRDP_DEBUG
else
EXTRA_DEFINES += -DXRDP_NODEBUG
endif

AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
-DXRDP_PID_PATH=\"${localstatedir}/run\" \
$(EXTRA_DEFINES) \
-I$(top_srcdir)/common

if XRDP_DEBUG
AM_CPPFLAGS += -DXRDP_DEBUG
else
AM_CPPFLAGS += -DXRDP_NODEBUG
endif

module_LTLIBRARIES = \
librdp.la



+ 1
- 1
readme.txt View File

@@ -21,7 +21,7 @@ xup is a module used to connect to an rdp specific X11 server
Xserver is the files needed to build an rdp specific X11 server
COPYING is the license file
design.txt is an attempt to explain the project design
prog_std.txt is an attempt to explain the programming standard used
coding_style.md describes the coding style for the project

since version 0.5.0 we switch to autotools to build xrdp



+ 2
- 2
sesman/access.c View File

@@ -30,7 +30,7 @@ extern struct config_sesman *g_cfg; /* in sesman.c */

/******************************************************************************/
int DEFAULT_CC
access_login_allowed(char *user)
access_login_allowed(const char *user)
{
int gid;
int ok;
@@ -79,7 +79,7 @@ access_login_allowed(char *user)

/******************************************************************************/
int DEFAULT_CC
access_login_mng_allowed(char *user)
access_login_mng_allowed(const char *user)
{
int gid;
int ok;


+ 2
- 2
sesman/access.h View File

@@ -35,7 +35,7 @@
*
*/
int DEFAULT_CC
access_login_allowed(char* user);
access_login_allowed(const char *user);

/**
*
@@ -45,6 +45,6 @@ access_login_allowed(char* user);
*
*/
int DEFAULT_CC
access_login_mng_allowed(char* user);
access_login_mng_allowed(const char *user);

#endif

+ 4
- 4
sesman/auth.h View File

@@ -32,11 +32,11 @@
* @brief Validates user's password
* @param user user's login name
* @param pass user's password
* @return 0 on success, 1 on failure
* @return non-zero handle on success, 0 on failure
*
*/
long DEFAULT_CC
auth_userpass(char* user, char* pass, int *errorcode);
auth_userpass(const char *user, const char *pass, int *errorcode);

/**
*
@@ -94,7 +94,7 @@ auth_set_env(long in_val);
*
*/
int DEFAULT_CC
auth_check_pwd_chg(char* user);
auth_check_pwd_chg(const char *user);

/**
*
@@ -104,6 +104,6 @@ auth_check_pwd_chg(char* user);
*
*/
int DEFAULT_CC
auth_change_pwd(char* user, char* newpwd);
auth_change_pwd(const char *user, const char *newpwd);

#endif

+ 16
- 22
sesman/chansrv/Makefile.am View File

@@ -1,32 +1,27 @@
EXTRA_DEFINES =
EXTRA_INCLUDES =
EXTRA_LIBS =
EXTRA_FLAGS =
AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
-DXRDP_PID_PATH=\"${localstatedir}/run\" \
-I$(top_srcdir)/common

CHANSRV_EXTRA_LIBS =

if XRDP_FUSE
EXTRA_DEFINES += -DXRDP_FUSE
EXTRA_LIBS += -lfuse
AM_CPPFLAGS += -DXRDP_FUSE
CHANSRV_EXTRA_LIBS += -lfuse
endif

if XRDP_OPUS
EXTRA_DEFINES += -DXRDP_OPUS
EXTRA_LIBS += -lopus
AM_CPPFLAGS += -DXRDP_OPUS
CHANSRV_EXTRA_LIBS += -lopus
endif

if XRDP_MP3LAME
EXTRA_DEFINES += -DXRDP_MP3LAME
EXTRA_LIBS += -lmp3lame
AM_CPPFLAGS += -DXRDP_MP3LAME
CHANSRV_EXTRA_LIBS += -lmp3lame
endif

AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
-DXRDP_PID_PATH=\"${localstatedir}/run\" \
$(EXTRA_DEFINES) \
-I$(top_srcdir)/common \
$(EXTRA_INCLUDES)

AM_CFLAGS = $(X_CFLAGS)

sbin_PROGRAMS = \
@@ -65,10 +60,9 @@ xrdp_chansrv_SOURCES = \
xcommon.h

xrdp_chansrv_LDFLAGS = \
$(X_LIBS) \
$(EXTRA_FLAGS)
$(X_LIBS)

xrdp_chansrv_LDADD = \
$(top_builddir)/common/libcommon.la \
$(X_PRE_LIBS) -lXfixes -lXrandr -lX11 $(X_EXTRA_LIBS) \
$(EXTRA_LIBS)
$(CHANSRV_EXTRA_LIBS)

+ 1
- 1
sesman/chansrv/clipboard_file.c View File

@@ -453,7 +453,7 @@ clipboard_send_file_data(int streamId, int lindex,
if (g_file_seek(fd, nPositionLow) < 0)
{
log_message(LOG_LEVEL_ERROR, "clipboard_send_file_data: seek error "
"in file: %s\n", full_fn);
"in file: %s", full_fn);
g_file_close(fd);
return 1;
}


+ 4
- 4
sesman/chansrv/fifo.c View File

@@ -235,21 +235,21 @@ fifo_remove(FIFO* fp)
void*
fifo_peek(FIFO* fp)
{
log_debug_high("entered\n");
log_debug_high("entered");

if (!fp)
{
log_debug_high("FIFO is null\n");
log_debug_high("FIFO is null");
return 0;
}

if (fp->rd_ptr == fp->wr_ptr)
{
log_debug_high("FIFO is empty\n");
log_debug_high("FIFO is empty");
return 0;
}

log_debug_low("peeking data at index %d\n", fp->rd_ptr);
log_debug_low("peeking data at index %d", fp->rd_ptr);

return (void *) fp->user_data[fp->rd_ptr];
}

+ 20
- 4
sesman/config.c View File

@@ -374,6 +374,7 @@ config_read_rdp_params(int file, struct config_sesman *cs, struct list *param_n,
list_clear(param_n);

cs->rdp_params = list_create();
cs->rdp_params->auto_free = 1;

file_read_section(file, SESMAN_CFG_RDP_PARAMS, param_n, param_v);

@@ -382,7 +383,7 @@ config_read_rdp_params(int file, struct config_sesman *cs, struct list *param_n,
list_add_item(cs->rdp_params, (long)g_strdup((char *)list_get_item(param_v, i)));
}

/* printing security config */
/* printing X11rdp parameters */
g_printf("X11rdp parameters:\r\n");

for (i = 0; i < cs->rdp_params->count; i++)
@@ -404,6 +405,7 @@ config_read_xorg_params(int file, struct config_sesman *cs,
list_clear(param_n);

cs->xorg_params = list_create();
cs->xorg_params->auto_free = 1;

file_read_section(file, SESMAN_CFG_XORG_PARAMS, param_n, param_v);

@@ -413,7 +415,7 @@ config_read_xorg_params(int file, struct config_sesman *cs,
(long) g_strdup((char *) list_get_item(param_v, i)));
}

/* printing security config */
/* printing XOrg parameters */
g_printf("XOrg parameters:\r\n");

for (i = 0; i < cs->xorg_params->count; i++)
@@ -436,6 +438,7 @@ config_read_vnc_params(int file, struct config_sesman *cs, struct list *param_n,
list_clear(param_n);

cs->vnc_params = list_create();
cs->vnc_params->auto_free = 1;

file_read_section(file, SESMAN_CFG_VNC_PARAMS, param_n, param_v);

@@ -444,7 +447,7 @@ config_read_vnc_params(int file, struct config_sesman *cs, struct list *param_n,
list_add_item(cs->vnc_params, (long)g_strdup((char *)list_get_item(param_v, i)));
}

/* printing security config */
/* printing Xvnc parameters */
g_printf("Xvnc parameters:\r\n");

for (i = 0; i < cs->vnc_params->count; i++)
@@ -466,7 +469,9 @@ config_read_session_variables(int file, struct config_sesman *cs,
list_clear(param_n);

cs->session_variables1 = list_create();
cs->session_variables1->auto_free = 1;
cs->session_variables2 = list_create();
cs->session_variables2->auto_free = 1;

file_read_section(file, SESMAN_CFG_SESSION_VARIABLES, param_n, param_v);

@@ -478,7 +483,7 @@ config_read_session_variables(int file, struct config_sesman *cs,
(tintptr) g_strdup((char *) list_get_item(param_v, i)));
}

/* printing security config */
/* printing session variables */
g_writeln("%s parameters:", SESMAN_CFG_SESSION_VARIABLES);

for (i = 0; i < cs->session_variables1->count; i++)
@@ -490,3 +495,14 @@ config_read_session_variables(int file, struct config_sesman *cs,

return 0;
}

void
config_free(struct config_sesman *cs)
{
list_delete(cs->rdp_params);
list_delete(cs->vnc_params);
list_delete(cs->xorg_params);
list_delete(cs->session_variables1);
list_delete(cs->session_variables2);
g_free(cs);
}

+ 3
- 0
sesman/config.h View File

@@ -356,4 +356,7 @@ int DEFAULT_CC
config_read_session_variables(int file, struct config_sesman *cs,
struct list *param_n, struct list *param_v);

void
config_free(struct config_sesman *cs);

#endif

+ 3
- 3
sesman/env.c View File

@@ -34,7 +34,7 @@ extern struct config_sesman *g_cfg; /* in sesman.c */

/******************************************************************************/
int DEFAULT_CC
env_check_password_file(char *filename, char *passwd)
env_check_password_file(const char *filename, const char *passwd)
{
char encryptedPasswd[16];
char key[24];
@@ -83,8 +83,8 @@ env_check_password_file(char *filename, char *passwd)
/******************************************************************************/
/* its the responsibility of the caller to free passwd_file */
int DEFAULT_CC
env_set_user(char *username, char **passwd_file, int display,
struct list *env_names, struct list* env_values)
env_set_user(const char *username, char **passwd_file, int display,
const struct list *env_names, const struct list *env_values)
{
int error;
int pw_uid;


+ 3
- 3
sesman/env.h View File

@@ -38,7 +38,7 @@
*
*/
int DEFAULT_CC
env_check_password_file(char* filename, char* password);
env_check_password_file(const char *filename, const char *password);

/**
*
@@ -50,7 +50,7 @@ env_check_password_file(char* filename, char* password);
*
*/
int DEFAULT_CC
env_set_user(char* username, char** passwd_file, int display,
struct list *env_names, struct list* env_values);
env_set_user(const char *username, char **passwd_file, int display,
const struct list *env_names, const struct list *env_values);

#endif

+ 1
- 1
sesman/libscp/libscp_connection.c View File

@@ -37,7 +37,7 @@ scp_connection_create(int sck)

if (0 == conn)
{
log_message(LOG_LEVEL_WARNING, "[connection:%d] connection create: malloc error", __LINE__);
log_message(LOG_LEVEL_ERROR, "[connection:%d] connection create: malloc error", __LINE__);
return 0;
}



+ 1
- 1
sesman/libscp/libscp_session.c View File

@@ -42,7 +42,7 @@ scp_session_create()

if (0 == s)
{
log_message(LOG_LEVEL_WARNING, "[session:%d] session create: malloc error", __LINE__);
log_message(LOG_LEVEL_ERROR, "[session:%d] session create: malloc error", __LINE__);
return 0;
}



+ 0
- 2
sesman/libscp/libscp_v1s.c View File

@@ -330,7 +330,6 @@ scp_v1s_request_password(struct SCP_CONNECTION *c, struct SCP_SESSION *s,

if (0 != scp_session_set_username(s, buf))
{
scp_session_destroy(s);
log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: internal error", __LINE__);
return SCP_SERVER_STATE_INTERNAL_ERR;
}
@@ -342,7 +341,6 @@ scp_v1s_request_password(struct SCP_CONNECTION *c, struct SCP_SESSION *s,

if (0 != scp_session_set_password(s, buf))
{
scp_session_destroy(s);
log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: internal error", __LINE__);
return SCP_SERVER_STATE_INTERNAL_ERR;
}


+ 10
- 3
sesman/scp.c View File

@@ -36,7 +36,7 @@ void *DEFAULT_CC
scp_process_start(void *sck)
{
struct SCP_CONNECTION scon;
struct SCP_SESSION *sdata;
struct SCP_SESSION *sdata = NULL;

scon.in_sck = (int)(tintptr)sck;
LOG_DBG("started scp thread on socket %d", scon.in_sck);
@@ -54,12 +54,12 @@ scp_process_start(void *sck)
if (sdata->version == 0)
{
/* starts processing an scp v0 connection */
LOG_DBG("accept ok, go on with scp v0\n", 0);
LOG_DBG("accept ok, go on with scp v0", 0);
scp_v0_process(&scon, sdata);
}
else
{
LOG_DBG("accept ok, go on with scp v1\n", 0);
LOG_DBG("accept ok, go on with scp v1", 0);
/*LOG_DBG("user: %s\npass: %s",sdata->username, sdata->password);*/
scp_v1_process(&scon, sdata);
}
@@ -89,9 +89,16 @@ scp_process_start(void *sck)
break;
default:
log_message(LOG_LEVEL_ALWAYS, "unknown return from scp_vXs_accept()");
break;
}

free_stream(scon.in_s);
free_stream(scon.out_s);

if (sdata)
{
scp_session_destroy(sdata);
}

return 0;
}

+ 1
- 5
sesman/scp_v0.c View File

@@ -68,8 +68,6 @@ scp_v0_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s)
s->username);
scp_v0s_replyauthentication(c, errorcode);
}

auth_end(data);
}
else if (data)
{
@@ -94,8 +92,6 @@ scp_v0_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s)
}

session_reconnect(display, s->username);
auth_end(data);
/* don't set data to null here */
}
else
{
@@ -148,7 +144,6 @@ scp_v0_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s)

if (display == 0)
{
auth_end(data);
scp_v0s_deny_connection(c);
}
else
@@ -160,4 +155,5 @@ scp_v0_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s)
{
scp_v0s_deny_connection(c);
}
auth_end(data);
}

+ 0
- 4
sesman/scp_v1.c View File

@@ -77,7 +77,6 @@ scp_v1_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s)
default:
/* we check the other errors */
parseCommonStates(e, "scp_v1s_list_sessions()");
scp_session_destroy(s);
return;
//break;
}
@@ -88,7 +87,6 @@ scp_v1_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s)
scp_v1s_deny_connection(c, "Login failed");
log_message( LOG_LEVEL_INFO,
"Login failed for user %s. Connection terminated", s->username);
scp_session_destroy(s);
return;
}

@@ -98,7 +96,6 @@ scp_v1_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s)
scp_v1s_deny_connection(c, "Access to Terminal Server not allowed.");
log_message(LOG_LEVEL_INFO,
"User %s not allowed on TS. Connection terminated", s->username);
scp_session_destroy(s);
return;
}

@@ -204,7 +201,6 @@ scp_v1_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s)
}

/* cleanup */
scp_session_destroy(s);
auth_end(data);
g_free(slist);
}


+ 0
- 3
sesman/scp_v1_mng.c View File

@@ -50,7 +50,6 @@ scp_v1_mng_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s)
scp_v1s_mng_deny_connection(c, "Login failed");
log_message(LOG_LEVEL_INFO,
"[MNG] Login failed for user %s. Connection terminated", s->username);
scp_session_destroy(s);
auth_end(data);
return;
}
@@ -61,7 +60,6 @@ scp_v1_mng_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s)
scp_v1s_mng_deny_connection(c, "Access to Terminal Server not allowed.");
log_message(LOG_LEVEL_INFO,
"[MNG] User %s not allowed on TS. Connection terminated", s->username);
scp_session_destroy(s);
auth_end(data);
return;
}
@@ -105,7 +103,6 @@ scp_v1_mng_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s)
}

/* cleanup */
scp_session_destroy(s);
auth_end(data);
}



+ 6
- 8
sesman/session.c View File

@@ -77,7 +77,8 @@ dumpItemsToString(struct list *self, char *outstr, int len)

/******************************************************************************/
struct session_item *DEFAULT_CC
session_get_bydata(char *name, int width, int height, int bpp, int type, char *client_ip)
session_get_bydata(const char *name, int width, int height, int bpp, int type,
const char *client_ip)
{
struct session_chain *tmp;
enum SESMAN_CFG_SESS_POLICY policy = g_cfg->sess.policy;
@@ -671,14 +672,13 @@ session_start_fork(int width, int height, int bpp, char *username,

/* get path of Xorg from config */
xserver = g_strdup((const char *)list_get_item(g_cfg->xorg_params, 0));
list_remove_item(g_cfg->xorg_params, 0);

/* these are the must have parameters */
list_add_item(xserver_params, (tintptr) g_strdup(xserver));
list_add_item(xserver_params, (tintptr) g_strdup(screen));

/* additional parameters from sesman.ini file */
list_append_list_strdup(g_cfg->xorg_params, xserver_params, 0);
list_append_list_strdup(g_cfg->xorg_params, xserver_params, 1);

/* make sure it ends with a zero */
list_add_item(xserver_params, 0);
@@ -705,7 +705,6 @@ session_start_fork(int width, int height, int bpp, char *username,

/* get path of Xvnc from config */
xserver = g_strdup((const char *)list_get_item(g_cfg->vnc_params, 0));
list_remove_item(g_cfg->vnc_params, 0);

/* these are the must have parameters */
list_add_item(xserver_params, (tintptr)g_strdup(xserver));
@@ -722,7 +721,7 @@ session_start_fork(int width, int height, int bpp, char *username,
/* additional parameters from sesman.ini file */
//config_read_xserver_params(SESMAN_SESSION_TYPE_XVNC,
// xserver_params);
list_append_list_strdup(g_cfg->vnc_params, xserver_params, 0);
list_append_list_strdup(g_cfg->vnc_params, xserver_params, 1);

/* make sure it ends with a zero */
list_add_item(xserver_params, 0);
@@ -737,7 +736,6 @@ session_start_fork(int width, int height, int bpp, char *username,

/* get path of X11rdp from config */
xserver = g_strdup((const char *)list_get_item(g_cfg->rdp_params, 0));
list_remove_item(g_cfg->rdp_params, 0);

/* these are the must have parameters */
list_add_item(xserver_params, (tintptr)g_strdup(xserver));
@@ -750,7 +748,7 @@ session_start_fork(int width, int height, int bpp, char *username,
/* additional parameters from sesman.ini file */
//config_read_xserver_params(SESMAN_SESSION_TYPE_XRDP,
// xserver_params);
list_append_list_strdup(g_cfg->rdp_params, xserver_params, 0);
list_append_list_strdup(g_cfg->rdp_params, xserver_params, 1);

/* make sure it ends with a zero */
list_add_item(xserver_params, 0);
@@ -1016,7 +1014,7 @@ session_get_bypid(int pid)

/******************************************************************************/
struct SCP_DISCONNECTED_SESSION *
session_get_byuser(char *user, int *cnt, unsigned char flags)
session_get_byuser(const char *user, int *cnt, unsigned char flags)
{
struct session_chain *tmp;
struct SCP_DISCONNECTED_SESSION *sess;


+ 3
- 2
sesman/session.h View File

@@ -91,7 +91,8 @@ struct session_chain
*
*/
struct session_item* DEFAULT_CC
session_get_bydata(char* name, int width, int height, int bpp, int type, char *client_ip);
session_get_bydata(const char *name, int width, int height, int bpp, int type,
const char *client_ip);
#ifndef session_find_item
#define session_find_item(a, b, c, d, e, f) session_get_bydata(a, b, c, d, e, f);
#endif
@@ -147,6 +148,6 @@ session_get_bypid(int pid);
*
*/
struct SCP_DISCONNECTED_SESSION*
session_get_byuser(char* user, int* cnt, unsigned char flags);
session_get_byuser(const char *user, int *cnt, unsigned char flags);

#endif

+ 3
- 0
sesman/sig.c View File

@@ -91,6 +91,9 @@ sig_sesman_reload_cfg(int sig)
/* stop logging subsystem */
log_end();

/* free old config data */
config_free(g_cfg);

/* replace old config with newly read one */
g_cfg = cfg;



+ 4
- 4
sesman/tools/sesadmin.c View File

@@ -129,18 +129,18 @@ int main(int argc, char **argv)
sock = g_tcp_socket();
if (sock < 0)
{
LOG_DBG("Socket open error, g_tcp_socket() failed\n");
LOG_DBG("Socket open error, g_tcp_socket() failed");
return 1;
}

s = scp_session_create();
c = scp_connection_create(sock);

LOG_DBG("Connecting to %s:%s with user %s (%s)\n", serv, port, user, pass);
LOG_DBG("Connecting to %s:%s with user %s (%s)", serv, port, user, pass);

if (0 != g_tcp_connect(sock, serv, port))
{
LOG_DBG("g_tcp_connect() error\n");
LOG_DBG("g_tcp_connect() error");
return 1;
}

@@ -153,7 +153,7 @@ int main(int argc, char **argv)

if (SCP_CLIENT_STATE_OK != e)
{
LOG_DBG("libscp error connecting: %s %d\n", s->errstr, (int)e);
LOG_DBG("libscp error connecting: %s %d", s->errstr, (int)e);
}

if (0 == g_strncmp(cmnd, "list", 5))


+ 3
- 3
sesman/verify_user.c View File

@@ -48,7 +48,7 @@ auth_account_disabled(struct spwd *stp);
/******************************************************************************/
/* returns boolean */
long DEFAULT_CC
auth_userpass(char *user, char *pass, int *errorcode)
auth_userpass(const char *user, const char *pass, int *errorcode)
{
const char *encr;
const char *epass;
@@ -125,7 +125,7 @@ auth_set_env(long in_val)

/******************************************************************************/
int DEFAULT_CC
auth_check_pwd_chg(char *user)
auth_check_pwd_chg(const char *user)
{
struct passwd *spw;
struct spwd *stp;
@@ -182,7 +182,7 @@ auth_check_pwd_chg(char *user)
}

int DEFAULT_CC
auth_change_pwd(char *user, char *newpwd)
auth_change_pwd(const char *user, const char *newpwd)
{
struct passwd *spw;
struct spwd *stp;


+ 3
- 3
sesman/verify_user_bsd.c View File

@@ -44,7 +44,7 @@ extern struct config_sesman* g_cfg; /* in sesman.c */
/******************************************************************************/
/* returns boolean */
long DEFAULT_CC
auth_userpass(char *user, char *pass, int *errorcode)
auth_userpass(const char *user, const char *pass, int *errorcode)
{
int ret = auth_userokay(user, NULL, "auth-xrdp", pass);
return ret;
@@ -74,13 +74,13 @@ auth_set_env(long in_val)

/******************************************************************************/
int DEFAULT_CC
auth_check_pwd_chg(char* user)
auth_check_pwd_chg(const char *user)
{