diff options
author | ilsimo <ilsimo> | 2007-09-17 15:28:51 +0000 |
---|---|---|
committer | ilsimo <ilsimo> | 2007-09-17 15:28:51 +0000 |
commit | f06f9591bccd8ddd900c6d6ce2b168818f5745db (patch) | |
tree | c40459c95a70b8eda8a1ee65142fa343ada7db96 | |
parent | 8c3d20c3d56e745e017e347b4317ae0e036d7674 (diff) | |
download | xrdp-proprietary-f06f9591bccd8ddd900c6d6ce2b168818f5745db.tar.gz xrdp-proprietary-f06f9591bccd8ddd900c6d6ce2b168818f5745db.zip |
fixing sessvc starting code and removing SESMAN_SESSVC_FILE definition
-rw-r--r-- | sesman/Makefile | 5 | ||||
-rw-r--r-- | sesman/sesman.h | 6 | ||||
-rw-r--r-- | sesman/session.c | 12 | ||||
-rw-r--r-- | sesman/tools/sestest.c | 24 |
4 files changed, 26 insertions, 21 deletions
diff --git a/sesman/Makefile b/sesman/Makefile index 7d4db1dc..396c58ef 100644 --- a/sesman/Makefile +++ b/sesman/Makefile @@ -13,8 +13,7 @@ MANDIR = /usr/local/man DOCDIR = /usr/doc/xrdp DEFINES = -DSESMAN_CFG_FILE=\"$(CFGDIR)/sesman.ini\" \ - -DSESMAN_PID_FILE=\"$(PIDDIR)/sesman.pid\" \ - -DSESMAN_SESSVC_FILE=\"sessvc\" + -DSESMAN_PID_FILE=\"$(PIDDIR)/sesman.pid\" CFLAGS = -Wall -O2 -I../common -I/usr/include/nptl -I./libscp $(DEFINES) LDFLAGS = -L/usr/gnu/lib -L/usr/lib/nptl -L./libscp -Wl,-rpath,. -lpthread -ldl -lscp @@ -41,7 +40,7 @@ kerberos-base: $(SESMANOBJ) verify_user_kerberos.o $(CC) $(LDFLAGS) -o sesman $(SESMANOBJ) verify_user_kerberos.o -lkrb5 sessvc: $(SESSVCOBJ) - $(CC) $(LDFLAGS) -o sessvc $(SESSVCOBJ) + $(CC) $(LDFLAGS) -o sessvc $(SESSVCOBJ) tools: sessvc make -C tools diff --git a/sesman/sesman.h b/sesman/sesman.h index 349e78e3..e637ec5e 100644 --- a/sesman/sesman.h +++ b/sesman/sesman.h @@ -22,7 +22,7 @@ * @file sesman.h * @brief Main include file * @author Jay Sorg - * + * */ #ifndef SESMAN_H @@ -50,8 +50,4 @@ #define SESMAN_PID_FILE "./sesman.pid" #endif -#ifndef SESMAN_SESSVC_FILE - #define SESMAN_SESSVC_FILE "./sessvc" -#endif - #endif diff --git a/sesman/session.c b/sesman/session.c index 868d82cc..697d261f 100644 --- a/sesman/session.c +++ b/sesman/session.c @@ -117,6 +117,8 @@ session_start_sessvc(int xpid, int wmpid, long data) struct list* sessvc_params; char wmpid_str[25]; char xpid_str[25]; + char exe_path[262]; + char cur_dir[256]; int i; /* new style waiting for clients */ @@ -128,12 +130,16 @@ session_start_sessvc(int xpid, int wmpid, long data) sessvc_params->auto_free = 1; /* building parameters */ - list_add_item(sessvc_params, (long)g_strdup(SESMAN_SESSVC_FILE)); + g_get_current_dir(cur_dir, 255); + g_snprintf(exe_path, 261, "%s/%s", cur_dir, "sessvc"); + + list_add_item(sessvc_params, (long)g_strdup(exe_path)); list_add_item(sessvc_params, (long)g_strdup(xpid_str)); list_add_item(sessvc_params, (long)g_strdup(wmpid_str)); list_add_item(sessvc_params, 0); /* mandatory */ - g_execvp(SESMAN_SESSVC_FILE, ((char**)sessvc_params->items)); + /* executing sessvc */ + g_execvp(exe_path, ((char**)sessvc_params->items)); /* should not get here */ log_message(LOG_LEVEL_ALWAYS, "error starting sessvc - pid %d - xpid=%s - wmpid=%s", @@ -285,7 +291,7 @@ for user %s denied", username); /* still a problem starting window manager just start xterm */ g_execlp3("xterm", "xterm", 0); - + /* should not get here */ log_message(LOG_LEVEL_ALWAYS,"error starting xterm for user %s - pid %d", username, g_getpid()); diff --git a/sesman/tools/sestest.c b/sesman/tools/sestest.c index ae23f616..bbbc98d1 100644 --- a/sesman/tools/sestest.c +++ b/sesman/tools/sestest.c @@ -13,7 +13,7 @@ unsigned int menuSelect(unsigned int choices); int main(int argc, char** argv) { struct SCP_SESSION s; - struct SCP_CONNECTION c; + struct SCP_CONNECTION* c; /*struct SCP_DISCONNECTED_SESSION ds;*/ struct SCP_DISCONNECTED_SESSION* dsl; enum SCP_CLIENT_STATES_E e; @@ -21,14 +21,17 @@ int main(int argc, char** argv) int scnt; int idx; int sel; + int sock; - make_stream(c.in_s); + sock=g_tcp_socket(); + c=scp_connection_create(sock); + /*make_stream(c.in_s); init_stream(c.in_s, 8192); make_stream(c.out_s); init_stream(c.out_s, 8192); - c.in_sck = g_tcp_socket(); + c.in_sck = g_tcp_socket();*/ - if (0!=g_tcp_connect(c.in_sck, "localhost", "3350")) + if (0!=g_tcp_connect(sock, "localhost", "3350")) { g_printf("error connecting"); return 1; @@ -78,7 +81,7 @@ int main(int argc, char** argv) break; case SCP_CLIENT_STATE_SESSION_LIST: g_printf("OK : session list needed\n"); - e=scp_v1c_get_session_list(&c, &scnt, &dsl); + e=scp_v1c_get_session_list(c, &scnt, &dsl); printf("Sessions: %d\n", scnt); for (idx=0; idx <scnt; idx++) { @@ -88,7 +91,7 @@ int main(int argc, char** argv) case SCP_CLIENT_STATE_LIST_OK: g_printf("OK : selecting a session:\n"); sel = menuSelect(scnt); - e=scp_v1c_select_session(&c, &s, dsl[sel-1].SID); + e=scp_v1c_select_session(c, &s, dsl[sel-1].SID); g_printf("\n return: %d \n", e); break; case SCP_CLIENT_STATE_RESEND_CREDENTIALS: @@ -97,7 +100,7 @@ int main(int argc, char** argv) scanf("%255s", s.username); g_printf(" password:"); scanf("%255s", s.password); - e=scp_v1c_resend_credentials(&c,&s); + e=scp_v1c_resend_credentials(c,&s); break; case SCP_CLIENT_STATE_CONNECTION_DENIED: g_printf("ERR: connection denied: %s\n", s.errstr); @@ -118,9 +121,10 @@ int main(int argc, char** argv) } } - g_tcp_close(c.in_sck); - free_stream(c.in_s); - free_stream(c.out_s); + g_tcp_close(sock); + scp_connection_destroy(c); + /*free_stream(c.in_s); + free_stream(c.out_s);*/ return 0; } |