diff -ur xrdp-0.3.1.orig/sesman/Makefile xrdp-0.3.1/sesman/Makefile --- xrdp-0.3.1.orig/sesman/Makefile 2006-08-01 19:35:48.000000000 -0400 +++ xrdp-0.3.1/sesman/Makefile 2006-08-01 20:48:52.000000000 -0400 @@ -13,7 +13,8 @@ DOCDIR = /usr/doc/xrdp DEFINES = -DSESMAN_CFG_FILE=\"$(CFGDIR)/sesman.ini\" \ - -DSESMAN_PID_FILE=\"$(PIDDIR)/sesman.pid\" + -DSESMAN_PID_FILE=\"$(PIDDIR)/sesman.pid\" \ + -DSESMAN_DESTDIR=\"$(DESTDIR)\" CFLAGS = $(MYCFLAGS) -I../common $(DEFINES) LDFLAGS = -L /usr/gnu/lib $(DEFINES) diff -ur xrdp-0.3.1.orig/sesman/sesman.c xrdp-0.3.1/sesman/sesman.c --- xrdp-0.3.1.orig/sesman/sesman.c 2006-08-01 19:35:48.000000000 -0400 +++ xrdp-0.3.1/sesman/sesman.c 2006-08-01 20:48:15.000000000 -0400 @@ -137,6 +137,8 @@ int pid; char pid_s[8]; + chdir(SESMAN_DESTDIR); + if (1 == argc) { /* no options on command line. normal startup */ diff -ur xrdp-0.3.1.orig/xrdp/Makefile xrdp-0.3.1/xrdp/Makefile --- xrdp-0.3.1.orig/xrdp/Makefile 2006-08-01 19:35:48.000000000 -0400 +++ xrdp-0.3.1/xrdp/Makefile 2006-08-01 19:56:15.000000000 -0400 @@ -12,7 +12,8 @@ DOCDIR = /usr/doc/xrdp DEFINES = -DXRDP_CFG_FILE=\"$(CFGDIR)/xrdp.ini\" \ - -DXRDP_PID_FILE=\"$(PIDDIR)/xrdp.pid\" + -DXRDP_PID_FILE=\"$(PIDDIR)/xrdp.pid\" \ + -DXRDP_DESTDIR=\"$(DESTDIR)\" CFLAGS = $(MYCFLAGS) -I../common -I../libxrdp $(DEFINES) #CFLAGS += -DXRDP_DEBUG diff -ur xrdp-0.3.1.orig/xrdp/xrdp.c xrdp-0.3.1/xrdp/xrdp.c --- xrdp-0.3.1.orig/xrdp/xrdp.c 2006-08-01 19:35:48.000000000 -0400 +++ xrdp-0.3.1/xrdp/xrdp.c 2006-08-01 19:55:45.000000000 -0400 @@ -291,6 +291,8 @@ char text[32]; #endif + chdir(XRDP_DESTDIR); + /* check compiled endian with actual endian */ test = 1; host_be = !((int)(*(unsigned char*)(&test)));