From 92a0f58e85f79f96f9ad4ee04a8a82d7aac77294 Mon Sep 17 00:00:00 2001 From: Oleksandr Shneyder Date: Fri, 27 Jun 2014 10:52:52 +0200 Subject: Rename Patches 210 and 211. Update series file. --- ...agent+nxcomp_save_session_state.full+lite.patch | 188 +++++++++++++++++++++ .../210_nxagent_nxcomp_save_session_state.patch | 188 --------------------- .../211_nxcomp_set_default_options.full+lite.patch | 27 +++ .../patches/211_nxcomp_set_default_options.patch | 27 --- debian/patches/series | 4 +- 5 files changed, 217 insertions(+), 217 deletions(-) create mode 100644 debian/patches/210_nxagent+nxcomp_save_session_state.full+lite.patch delete mode 100644 debian/patches/210_nxagent_nxcomp_save_session_state.patch create mode 100644 debian/patches/211_nxcomp_set_default_options.full+lite.patch delete mode 100644 debian/patches/211_nxcomp_set_default_options.patch (limited to 'debian/patches') diff --git a/debian/patches/210_nxagent+nxcomp_save_session_state.full+lite.patch b/debian/patches/210_nxagent+nxcomp_save_session_state.full+lite.patch new file mode 100644 index 000000000..fa0284894 --- /dev/null +++ b/debian/patches/210_nxagent+nxcomp_save_session_state.full+lite.patch @@ -0,0 +1,188 @@ +Description: Save session state in file +Author: Oleksandr Shneyder + +--- a/nx-X11/programs/Xserver/hw/nxagent/Args.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c +@@ -60,6 +60,7 @@ + #endif + #include "Handlers.h" + #include "Error.h" ++#include "Reconnect.h" + + /* + * NX includes and definitions. +@@ -1106,6 +1107,11 @@ + + return; + } ++ else if (!strcmp(name, "state")) ++ { ++ setStatePath(value); ++ return; ++ } + else if (!strcmp(name, "fullscreen")) + { + if (nxagentReconnectTrap == True) +@@ -1385,6 +1391,11 @@ + validateString(nxagentOptionFile)); + #endif + ++ /* ++ * Init statePath ++ */ ++ setStatePath(""); ++ + if (nxagentOptionFile == NULL) + { + return; +--- a/nx-X11/programs/Xserver/hw/nxagent/Init.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c +@@ -63,7 +63,7 @@ + + #include "NX.h" + #include "NXlib.h" +- ++#include "Reconnect.h" + /* + * Set here the required log level. + */ +@@ -233,6 +233,7 @@ + fprintf(stderr, "Info: Agent running with pid '%d'.\n", getpid()); + + fprintf(stderr, "Session: Starting session at '%s'.\n", GetTimeAsString()); ++ saveAgentState("STARTING"); + } + + /* +--- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c +@@ -118,6 +118,33 @@ + + static enum RECONNECTION_STEP failedStep; + ++#include ++ ++/* ++ * Path of state File ++ */ ++char stateFile[PATH_MAX]; ++ ++ ++void setStatePath(char* path) ++{ ++ strncpy(stateFile, path, PATH_MAX-1); ++} ++ ++void saveAgentState(char* state) ++{ ++ FILE* fptr; ++ if(strlen(stateFile)) ++ { ++ fptr=fopen(stateFile, "w"); ++ if(!fptr) ++ return; ++ fprintf(fptr,"%s", state); ++ fclose(fptr); ++ } ++} ++ ++ + int nxagentHandleConnectionStates(void) + { + #ifdef TEST +@@ -211,6 +238,7 @@ + fprintf(stderr, "Session: Display failure detected at '%s'.\n", GetTimeAsString()); + + fprintf(stderr, "Session: Suspending session at '%s'.\n", GetTimeAsString()); ++ saveAgentState("SUSPENDING"); + } + + nxagentDisconnectSession(); +@@ -265,6 +293,7 @@ + fprintf(stderr, "Session: Session suspended at '%s'.\n", GetTimeAsString()); + #endif + } ++ saveAgentState("SUSPENDED"); + + nxagentResetDisplayHandlers(); + +@@ -622,6 +651,7 @@ + #else + fprintf(stderr, "Session: Session resumed at '%s'.\n", GetTimeAsString()); + #endif ++ saveAgentState("RUNNING"); + + nxagentRemoveSplashWindow(NULL); + +@@ -785,12 +815,14 @@ + if (nxagentSessionState == SESSION_GOING_DOWN) + { + fprintf(stderr, "Session: Suspending session at '%s'.\n", GetTimeAsString()); ++ saveAgentState("SUSPENDING"); + + nxagentDisconnectSession(); + } + else if (nxagentSessionState == SESSION_GOING_UP) + { + fprintf(stderr, "Session: Resuming session at '%s'.\n", GetTimeAsString()); ++ saveAgentState("RESUMING"); + + if (nxagentReconnectSession()) + { +@@ -803,6 +835,7 @@ + fprintf(stderr, "Session: Display failure detected at '%s'.\n", GetTimeAsString()); + + fprintf(stderr, "Session: Suspending session at '%s'.\n", GetTimeAsString()); ++ saveAgentState("SUSPENDING"); + + nxagentDisconnectSession(); + } +--- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.h ++++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.h +@@ -34,6 +34,8 @@ + Bool nxagentReconnectSession(void); + int nxagentHandleConnectionStates(void); + void nxagentHandleConnectionChanges(void); ++void setStatePath(char*); ++void saveAgentState(char*); + + enum SESSION_STATE + { +--- a/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c +@@ -609,6 +609,7 @@ + #endif + + nxagentSessionState = SESSION_UP; ++ saveAgentState("RUNNING"); + } + + #ifdef BLOCKS +@@ -823,6 +824,7 @@ + */ + + fprintf(stderr, "Session: Terminating session at '%s'.\n", GetTimeAsString()); ++ saveAgentState("TERMINATING"); + + nxagentWaitDisplay(); + +@@ -833,6 +835,7 @@ + { + NXShadowDestroy(); + } ++ saveAgentState("TERMINATED"); + + KillAllClients(); + DEALLOCATE_LOCAL(clientReady); +--- a/nxcomp/Loop.cpp ++++ b/nxcomp/Loop.cpp +@@ -8898,7 +8898,8 @@ + } + else if (strcasecmp(name, "defer") == 0 || + strcasecmp(name, "tile") == 0 || +- strcasecmp(name, "menu") == 0) ++ strcasecmp(name, "menu") == 0 || ++ strcasecmp(name, "state") == 0 ) + { + #ifdef DEBUG + *logofs << "Loop: Ignoring agent option '" << name diff --git a/debian/patches/210_nxagent_nxcomp_save_session_state.patch b/debian/patches/210_nxagent_nxcomp_save_session_state.patch deleted file mode 100644 index fa0284894..000000000 --- a/debian/patches/210_nxagent_nxcomp_save_session_state.patch +++ /dev/null @@ -1,188 +0,0 @@ -Description: Save session state in file -Author: Oleksandr Shneyder - ---- a/nx-X11/programs/Xserver/hw/nxagent/Args.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c -@@ -60,6 +60,7 @@ - #endif - #include "Handlers.h" - #include "Error.h" -+#include "Reconnect.h" - - /* - * NX includes and definitions. -@@ -1106,6 +1107,11 @@ - - return; - } -+ else if (!strcmp(name, "state")) -+ { -+ setStatePath(value); -+ return; -+ } - else if (!strcmp(name, "fullscreen")) - { - if (nxagentReconnectTrap == True) -@@ -1385,6 +1391,11 @@ - validateString(nxagentOptionFile)); - #endif - -+ /* -+ * Init statePath -+ */ -+ setStatePath(""); -+ - if (nxagentOptionFile == NULL) - { - return; ---- a/nx-X11/programs/Xserver/hw/nxagent/Init.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c -@@ -63,7 +63,7 @@ - - #include "NX.h" - #include "NXlib.h" -- -+#include "Reconnect.h" - /* - * Set here the required log level. - */ -@@ -233,6 +233,7 @@ - fprintf(stderr, "Info: Agent running with pid '%d'.\n", getpid()); - - fprintf(stderr, "Session: Starting session at '%s'.\n", GetTimeAsString()); -+ saveAgentState("STARTING"); - } - - /* ---- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c -@@ -118,6 +118,33 @@ - - static enum RECONNECTION_STEP failedStep; - -+#include -+ -+/* -+ * Path of state File -+ */ -+char stateFile[PATH_MAX]; -+ -+ -+void setStatePath(char* path) -+{ -+ strncpy(stateFile, path, PATH_MAX-1); -+} -+ -+void saveAgentState(char* state) -+{ -+ FILE* fptr; -+ if(strlen(stateFile)) -+ { -+ fptr=fopen(stateFile, "w"); -+ if(!fptr) -+ return; -+ fprintf(fptr,"%s", state); -+ fclose(fptr); -+ } -+} -+ -+ - int nxagentHandleConnectionStates(void) - { - #ifdef TEST -@@ -211,6 +238,7 @@ - fprintf(stderr, "Session: Display failure detected at '%s'.\n", GetTimeAsString()); - - fprintf(stderr, "Session: Suspending session at '%s'.\n", GetTimeAsString()); -+ saveAgentState("SUSPENDING"); - } - - nxagentDisconnectSession(); -@@ -265,6 +293,7 @@ - fprintf(stderr, "Session: Session suspended at '%s'.\n", GetTimeAsString()); - #endif - } -+ saveAgentState("SUSPENDED"); - - nxagentResetDisplayHandlers(); - -@@ -622,6 +651,7 @@ - #else - fprintf(stderr, "Session: Session resumed at '%s'.\n", GetTimeAsString()); - #endif -+ saveAgentState("RUNNING"); - - nxagentRemoveSplashWindow(NULL); - -@@ -785,12 +815,14 @@ - if (nxagentSessionState == SESSION_GOING_DOWN) - { - fprintf(stderr, "Session: Suspending session at '%s'.\n", GetTimeAsString()); -+ saveAgentState("SUSPENDING"); - - nxagentDisconnectSession(); - } - else if (nxagentSessionState == SESSION_GOING_UP) - { - fprintf(stderr, "Session: Resuming session at '%s'.\n", GetTimeAsString()); -+ saveAgentState("RESUMING"); - - if (nxagentReconnectSession()) - { -@@ -803,6 +835,7 @@ - fprintf(stderr, "Session: Display failure detected at '%s'.\n", GetTimeAsString()); - - fprintf(stderr, "Session: Suspending session at '%s'.\n", GetTimeAsString()); -+ saveAgentState("SUSPENDING"); - - nxagentDisconnectSession(); - } ---- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.h -+++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.h -@@ -34,6 +34,8 @@ - Bool nxagentReconnectSession(void); - int nxagentHandleConnectionStates(void); - void nxagentHandleConnectionChanges(void); -+void setStatePath(char*); -+void saveAgentState(char*); - - enum SESSION_STATE - { ---- a/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c -@@ -609,6 +609,7 @@ - #endif - - nxagentSessionState = SESSION_UP; -+ saveAgentState("RUNNING"); - } - - #ifdef BLOCKS -@@ -823,6 +824,7 @@ - */ - - fprintf(stderr, "Session: Terminating session at '%s'.\n", GetTimeAsString()); -+ saveAgentState("TERMINATING"); - - nxagentWaitDisplay(); - -@@ -833,6 +835,7 @@ - { - NXShadowDestroy(); - } -+ saveAgentState("TERMINATED"); - - KillAllClients(); - DEALLOCATE_LOCAL(clientReady); ---- a/nxcomp/Loop.cpp -+++ b/nxcomp/Loop.cpp -@@ -8898,7 +8898,8 @@ - } - else if (strcasecmp(name, "defer") == 0 || - strcasecmp(name, "tile") == 0 || -- strcasecmp(name, "menu") == 0) -+ strcasecmp(name, "menu") == 0 || -+ strcasecmp(name, "state") == 0 ) - { - #ifdef DEBUG - *logofs << "Loop: Ignoring agent option '" << name diff --git a/debian/patches/211_nxcomp_set_default_options.full+lite.patch b/debian/patches/211_nxcomp_set_default_options.full+lite.patch new file mode 100644 index 000000000..9178fb5bf --- /dev/null +++ b/debian/patches/211_nxcomp_set_default_options.full+lite.patch @@ -0,0 +1,27 @@ +Description: Set default pack and link options to avoid damage of session. +Author: Oleksandr Shneyder + +--- a/nxcomp/Loop.cpp ++++ b/nxcomp/Loop.cpp +@@ -8350,8 +8350,8 @@ + + cerr << "Error" << ": Can't identify 'link' option in string '" + << value << "'.\n"; +- +- return -1; ++ if (ParseLinkOption("adsl") < 0) ++ return -1; + } + } + else if (strcasecmp(name, "limit") == 0) +@@ -8809,8 +8809,8 @@ + + cerr << "Error" << ": Can't identify pack method for string '" + << value << "'.\n"; +- +- return -1; ++ if (ParsePackOption("nopack")<0) ++ return -1; + } + } + else if (strcasecmp(name, "core") == 0) diff --git a/debian/patches/211_nxcomp_set_default_options.patch b/debian/patches/211_nxcomp_set_default_options.patch deleted file mode 100644 index 9178fb5bf..000000000 --- a/debian/patches/211_nxcomp_set_default_options.patch +++ /dev/null @@ -1,27 +0,0 @@ -Description: Set default pack and link options to avoid damage of session. -Author: Oleksandr Shneyder - ---- a/nxcomp/Loop.cpp -+++ b/nxcomp/Loop.cpp -@@ -8350,8 +8350,8 @@ - - cerr << "Error" << ": Can't identify 'link' option in string '" - << value << "'.\n"; -- -- return -1; -+ if (ParseLinkOption("adsl") < 0) -+ return -1; - } - } - else if (strcasecmp(name, "limit") == 0) -@@ -8809,8 +8809,8 @@ - - cerr << "Error" << ": Can't identify pack method for string '" - << value << "'.\n"; -- -- return -1; -+ if (ParsePackOption("nopack")<0) -+ return -1; - } - } - else if (strcasecmp(name, "core") == 0) diff --git a/debian/patches/series b/debian/patches/series index 733f49ce7..c3957f398 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -50,6 +50,8 @@ 205_nxagent_refresh-adsl.full.patch 206_nxagent_clipboard-as-nxoption.full.patch 209_x2goagent_add-man-page.full.patch +210_nxagent+nxcomp_save_session_state.full+lite.patch +211_nxcomp_set_default_options.full+lite.patch 220_nxproxy_bind-loopback-only.full+lite.patch 300_nxagent_set-wm-class.full.patch 301_nx-X11_use-shared-libs.full.patch @@ -66,5 +68,3 @@ 999_nxagent_unbrand-nxagent-brand-x2goagent.full.patch 016_nx-X11_install-location.debian.patch 102_xserver-xext_set-securitypolicy-path.debian.patch -210_nxagent_nxcomp_save_session_state.patch -211_nxcomp_set_default_options.patch -- cgit v1.2.3