|
|
@ -1505,7 +1505,7 @@ if (0) db = 1;
|
|
|
|
if (strstr(cmd, "FINDCREATEDISPLAY") == cmd) {
|
|
|
|
if (strstr(cmd, "FINDCREATEDISPLAY") == cmd) {
|
|
|
|
char *opts = strchr(cmd, '-');
|
|
|
|
char *opts = strchr(cmd, '-');
|
|
|
|
char st[] = "";
|
|
|
|
char st[] = "";
|
|
|
|
char geom[32];
|
|
|
|
char geom[32], xsess[32];
|
|
|
|
if (opts) {
|
|
|
|
if (opts) {
|
|
|
|
opts++;
|
|
|
|
opts++;
|
|
|
|
if (strstr(opts, "xdmcp")) {
|
|
|
|
if (strstr(opts, "xdmcp")) {
|
|
|
@ -1515,6 +1515,7 @@ if (0) db = 1;
|
|
|
|
opts = st;
|
|
|
|
opts = st;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
sprintf(geom, "NONE");
|
|
|
|
sprintf(geom, "NONE");
|
|
|
|
|
|
|
|
xsess[0] = '\0';
|
|
|
|
#if 0
|
|
|
|
#if 0
|
|
|
|
if (!keep_unixpw_opts) {
|
|
|
|
if (!keep_unixpw_opts) {
|
|
|
|
fprintf(stderr, "no keep_unixpw_opts\n");
|
|
|
|
fprintf(stderr, "no keep_unixpw_opts\n");
|
|
|
@ -1524,6 +1525,17 @@ if (!keep_unixpw_opts) {
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
if (unixpw && keep_unixpw_opts && keep_unixpw_opts[0] != '\0') {
|
|
|
|
if (unixpw && keep_unixpw_opts && keep_unixpw_opts[0] != '\0') {
|
|
|
|
char *q, *p, *t = strdup(keep_unixpw_opts);
|
|
|
|
char *q, *p, *t = strdup(keep_unixpw_opts);
|
|
|
|
|
|
|
|
if (strstr(t, "gnome")) {
|
|
|
|
|
|
|
|
sprintf(xsess, "gnome");
|
|
|
|
|
|
|
|
} else if (strstr(t, "kde")) {
|
|
|
|
|
|
|
|
sprintf(xsess, "kde");
|
|
|
|
|
|
|
|
} else if (strstr(t, "twm")) {
|
|
|
|
|
|
|
|
sprintf(xsess, "twm");
|
|
|
|
|
|
|
|
} else if (strstr(t, "fvwm")) {
|
|
|
|
|
|
|
|
sprintf(xsess, "fvwm");
|
|
|
|
|
|
|
|
} else if (strstr(t, "failsafe")) {
|
|
|
|
|
|
|
|
sprintf(xsess, "failsafe");
|
|
|
|
|
|
|
|
}
|
|
|
|
q = strstr(t, "ge=");
|
|
|
|
q = strstr(t, "ge=");
|
|
|
|
if (! q) q = strstr(t, "geom=");
|
|
|
|
if (! q) q = strstr(t, "geom=");
|
|
|
|
if (! q) q = strstr(t, "geometry=");
|
|
|
|
if (! q) q = strstr(t, "geometry=");
|
|
|
@ -1555,15 +1567,18 @@ if (!keep_unixpw_opts) {
|
|
|
|
free(t);
|
|
|
|
free(t);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
set_env("FD_GEOM", geom);
|
|
|
|
set_env("FD_GEOM", geom);
|
|
|
|
|
|
|
|
set_env("FD_SESS", xsess);
|
|
|
|
if (unixpw && keep_unixpw_user) {
|
|
|
|
if (unixpw && keep_unixpw_user) {
|
|
|
|
create_cmd = (char *) malloc(strlen(tmp)
|
|
|
|
create_cmd = (char *) malloc(strlen(tmp)
|
|
|
|
+ strlen("env USER='' /bin/sh ")
|
|
|
|
+ strlen("env USER='' ")
|
|
|
|
|
|
|
|
+ strlen("env FD_SESS='' ")
|
|
|
|
+ strlen("env FD_GEOM='' /bin/sh ")
|
|
|
|
+ strlen("env FD_GEOM='' /bin/sh ")
|
|
|
|
+ strlen(keep_unixpw_user) + 1
|
|
|
|
+ strlen(keep_unixpw_user) + 1
|
|
|
|
+ strlen(geom) + 1
|
|
|
|
+ strlen(geom) + 1
|
|
|
|
|
|
|
|
+ strlen(xsess) + 1
|
|
|
|
+ strlen(opts) + 1);
|
|
|
|
+ strlen(opts) + 1);
|
|
|
|
sprintf(create_cmd, "env USER='%s' FD_GEOM='%s' /bin/sh %s %s",
|
|
|
|
sprintf(create_cmd, "env USER='%s' FD_GEOM='%s' FD_SESS='%s' /bin/sh %s %s",
|
|
|
|
keep_unixpw_user, geom, tmp, opts);
|
|
|
|
keep_unixpw_user, geom, xsess, tmp, opts);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
create_cmd = (char *) malloc(strlen(tmp)
|
|
|
|
create_cmd = (char *) malloc(strlen(tmp)
|
|
|
|
+ strlen("/bin/sh ") + 1 + strlen(opts) + 1);
|
|
|
|
+ strlen("/bin/sh ") + 1 + strlen(opts) + 1);
|
|
|
|