Thu Oct 28 13:07:01 PDT 1999
(Raster) dont allow snapshotting of command (retsrat on login) for remote apps if we can detect they are remote. SVN revision: 1022
This commit is contained in:
parent
79570c5b00
commit
aecd924784
|
@ -3820,3 +3820,11 @@ I can't think of why this would be segfaulting or how this code could have
|
|||
gotten called if there were no border, but I think this must be the segfault
|
||||
I received in email. *shrug*
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Thu Oct 28 13:07:01 PDT 1999
|
||||
(Raster)
|
||||
|
||||
dont allow snapshotting of command (retsrat on login) for remote apps
|
||||
if we can detect they are remote.
|
||||
|
|
1
src/E.h
1
src/E.h
|
@ -2969,6 +2969,7 @@ extern Group *current_group;
|
|||
extern char *dstr;
|
||||
extern char *badtheme;
|
||||
extern char *badreason;
|
||||
extern char *e_machine_name;
|
||||
|
||||
/* This turns on E's internal stack tracking system for coarse debugging */
|
||||
/* and being able to trace E for profiling/optimisation purposes (which */
|
||||
|
|
|
@ -67,3 +67,4 @@ Group *current_group;
|
|||
char *dstr = NULL;
|
||||
char *badtheme = NULL;
|
||||
char *badreason = NULL;
|
||||
char *e_machine_name = NULL;
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
*/
|
||||
#include "E.h"
|
||||
#include "timestamp.h"
|
||||
#include <sys/utsname.h>
|
||||
|
||||
static void
|
||||
runDocBrowser(void)
|
||||
|
@ -48,6 +49,7 @@ main(int argc, char **argv)
|
|||
Button **lst;
|
||||
Background *bg;
|
||||
ECursor *ec = NULL;
|
||||
struct utsname ubuf;
|
||||
|
||||
/* This function runs all the setup for startup, and then
|
||||
* proceeds into the primary event loop at the end.
|
||||
|
@ -87,6 +89,10 @@ main(int argc, char **argv)
|
|||
AssignExitFunction(doExit, NULL);
|
||||
srand(time(NULL));
|
||||
|
||||
if (!uname(&ubuf))
|
||||
e_machine_name = duplicate(ubuf.nodename);
|
||||
if (!e_machine_name)
|
||||
e_machine_name = duplicate("localhost");
|
||||
command = duplicate(argv[0]);
|
||||
themepath[0] = 0;
|
||||
{
|
||||
|
|
|
@ -810,6 +810,7 @@ MakeExtInitWin(void)
|
|||
signal(SIGTSTP, SIG_DFL);
|
||||
#endif
|
||||
signal(SIGBUS, SIG_IGN);
|
||||
|
||||
d2 = XOpenDisplay(DisplayString(disp));
|
||||
close(ConnectionNumber(disp));
|
||||
XGrabServer(d2);
|
||||
|
|
47
src/snaps.c
47
src/snaps.c
|
@ -454,13 +454,28 @@ SnapshotEwinDialog(EWin * ewin)
|
|||
|
||||
if (ewin->client.command)
|
||||
{
|
||||
di = DialogAddItem(table, DITEM_CHECKBUTTON);
|
||||
DialogItemSetColSpan(di, 2);
|
||||
DialogItemSetPadding(di, 2, 2, 2, 2);
|
||||
DialogItemSetFill(di, 1, 0);
|
||||
DialogItemCheckButtonSetText(di, "Restart application on login");
|
||||
DialogItemCheckButtonSetState(di, tmp_snap_cmd);
|
||||
DialogItemCheckButtonSetPtr(di, &tmp_snap_cmd);
|
||||
char ok = 1;
|
||||
|
||||
if (ewin->client.machine)
|
||||
{
|
||||
if (strcmp(ewin->client.machine, e_machine_name))
|
||||
ok = 0;
|
||||
}
|
||||
if (ok)
|
||||
{
|
||||
di = DialogAddItem(table, DITEM_CHECKBUTTON);
|
||||
DialogItemSetColSpan(di, 2);
|
||||
DialogItemSetPadding(di, 2, 2, 2, 2);
|
||||
DialogItemSetFill(di, 1, 0);
|
||||
DialogItemCheckButtonSetText(di, "Restart application on login");
|
||||
DialogItemCheckButtonSetState(di, tmp_snap_cmd);
|
||||
DialogItemCheckButtonSetPtr(di, &tmp_snap_cmd);
|
||||
}
|
||||
else
|
||||
{
|
||||
di = DialogAddItem(table, DITEM_NONE);
|
||||
DialogItemSetColSpan(di, 2);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -615,14 +630,24 @@ void
|
|||
SnapshotEwinCmd(EWin * ewin)
|
||||
{
|
||||
Snapshot *sn;
|
||||
char ok = 1;
|
||||
|
||||
sn = GetSnapshot(ewin);
|
||||
if (!sn)
|
||||
return;
|
||||
sn->use_cmd = 1;
|
||||
if (sn->cmd)
|
||||
Efree(sn->cmd);
|
||||
sn->cmd = duplicate(ewin->client.command);
|
||||
|
||||
if (ewin->client.machine)
|
||||
{
|
||||
if (strcmp(ewin->client.machine, e_machine_name))
|
||||
ok = 0;
|
||||
}
|
||||
if (ok)
|
||||
{
|
||||
sn->use_cmd = 1;
|
||||
if (sn->cmd)
|
||||
Efree(sn->cmd);
|
||||
sn->cmd = duplicate(ewin->client.command);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in New Issue