diff -ur xrdp-0.5.0~20100303cvs.orig/rdp/rdp.c xrdp-0.5.0~20100303cvs/rdp/rdp.c --- xrdp-0.5.0~20100303cvs.orig/rdp/rdp.c 2010-03-04 08:16:34.000000000 +0100 +++ xrdp-0.5.0~20100303cvs/rdp/rdp.c 2010-11-05 14:37:45.000000000 +0100 @@ -21,6 +21,13 @@ */ #include "rdp.h" +#include +#include +#include +#include +#include +#include +#include /******************************************************************************/ /* return error */ @@ -43,6 +50,9 @@ int DEFAULT_CC lib_mod_connect(struct mod* mod) { + FILE *fdpass; + char passpath[256]= "/tmp/"; + char command[512] = "/usr/sbin/univention-dvs-sessionbroker-xrdp"; DEBUG(("in lib_mod_connect")); /* clear screen */ mod->server_begin_update(mod); @@ -50,6 +60,21 @@ mod->server_fill_rect(mod, 0, 0, mod->width, mod->height); mod->server_end_update(mod); /* connect */ + // hier reinhacken + strcat(passpath,mod->username); + fdpass = fopen(passpath,"w"); + fprintf(fdpass,"%s\n",mod->password); + fclose(fdpass); + //strcat(command,cmd); + strcat(command," -u "); + strcat(command,mod->username); + strcat(command," -y "); + strcat(command,passpath); + mod->pid = (pid_t*) malloc(sizeof(pid_t)); + mod->fdpipe = popen(command, "r"); + fscanf(mod->fdpipe,"%i\n",mod->pid); + fscanf(mod->fdpipe,"%s",mod->ip); + remove(passpath); if (rdp_rdp_connect(mod->rdp_layer, mod->ip, mod->port) == 0) { mod->sck = mod->rdp_layer->sec_layer->mcs_layer->iso_layer->tcp_layer->sck; @@ -326,6 +351,10 @@ int EXPORT_CC mod_exit(struct mod* mod) { + kill(*(mod->pid),SIGUSR1); + free(mod->pid); + sleep(2); + pclose(mod->fdpipe); DEBUG(("in mod_exit")); g_free(mod); DEBUG(("out mod_exit")); diff -ur xrdp-0.5.0~20100303cvs.orig/rdp/rdp.h xrdp-0.5.0~20100303cvs/rdp/rdp.h --- xrdp-0.5.0~20100303cvs.orig/rdp/rdp.h 2010-03-04 08:16:34.000000000 +0100 +++ xrdp-0.5.0~20100303cvs/rdp/rdp.h 2010-11-05 14:37:45.000000000 +0100 @@ -27,6 +27,8 @@ #include "ssl_calls.h" #include "xrdp_constants.h" #include "defines.h" +#include +#include struct rdp_brush { @@ -333,6 +335,8 @@ char program[256]; char directory[256]; int keylayout; + FILE * fdpipe; + pid_t * pid; int up_and_running; struct stream* in_s; tbus sck_obj;