View | Details | Raw Unified | Return to bug 6158
Collapse All | Expand All

(-)vsm/modules/thinlinc/vsm/sessionstart.py (-2 / +1 lines)
Lines 186-193 Link Here
186
        vncpasswdfile = locale_encode(self.vncpasswdfile)
186
        vncpasswdfile = locale_encode(self.vncpasswdfile)
187
187
188
        tlsession = os.path.join(self.session_env['TLPREFIX'], "libexec", "tl-session")
188
        tlsession = os.path.join(self.session_env['TLPREFIX'], "libexec", "tl-session")
189
        args = [tlsession,
189
        args = [tlsession, self.session_env["SHELL"], "-c", "\"%s\"" % (xstartupfile),
190
                "/bin/bash", "-c", "exec -l \"$SHELL\" -c \"%s\"" % (xstartupfile),
191
                "--",
190
                "--",
192
                xvnc_binary, ":%d" % disp, "-depth", "24",
191
                xvnc_binary, ":%d" % disp, "-depth", "24",
193
                "-geometry", "%dx%d" % fbsize,
192
                "-geometry", "%dx%d" % fbsize,
(-)vsm/tl-session-common.c (-2 / +10 lines)
Lines 21-27 Link Here
21
extern char **environ;
21
extern char **environ;
22
22
23
pid_t
23
pid_t
24
subprocess(char *const cmd[], preexec_ptr preexec_fn, void *preexec_data,
24
subprocess_file(const char *file, char *const cmd[], preexec_ptr preexec_fn, void *preexec_data,
25
           char **envp)
25
           char **envp)
26
{
26
{
27
    int close_exec_pipe[2];
27
    int close_exec_pipe[2];
Lines 95-101 Link Here
95
            putenv(*envp);
95
            putenv(*envp);
96
    }
96
    }
97
97
98
    execvp(cmd[0], cmd);
98
    execvp(file, cmd);
99
99
100
    /* execvp failed */
100
    /* execvp failed */
101
    perror("subprocess: execvp");
101
    perror("subprocess: execvp");
Lines 112-117 Link Here
112
}
112
}
113
113
114
114
115
pid_t
116
subprocess(char *const cmd[], preexec_ptr preexec_fn, void *preexec_data,
117
           char **envp)
118
{
119
    return subprocess_file(cmd[0], cmd, preexec_fn, preexec_data, envp);
120
}
121
122
115
int
123
int
116
print_groups(const char *progname, gid_t egid)
124
print_groups(const char *progname, gid_t egid)
117
{
125
{
(-)vsm/tl-session-common.h (+2 lines)
Lines 8-13 Link Here
8
typedef int (*preexec_ptr)(void *data);
8
typedef int (*preexec_ptr)(void *data);
9
9
10
pid_t
10
pid_t
11
subprocess_file(const char *file, char *const cmd[], preexec_ptr preexec_fn, void *preexec_data, char **envp);
12
pid_t
11
subprocess(char *const cmd[], preexec_ptr preexec_fn, void *preexec_data, char **envp);
13
subprocess(char *const cmd[], preexec_ptr preexec_fn, void *preexec_data, char **envp);
12
14
13
int
15
int
(-)vsm/tl-xinit.c (-2 / +12 lines)
Lines 977-982 Link Here
977
    int displayarg = -1;
977
    int displayarg = -1;
978
    char **clientargs = cmdargs;
978
    char **clientargs = cmdargs;
979
    char **serverargs = NULL;
979
    char **serverargs = NULL;
980
    char *clientbin;
980
981
981
    /* Parse arguments into client and server options. We are not
982
    /* Parse arguments into client and server options. We are not
982
       using argv[0] but otoh need room for NULL */
983
       using argv[0] but otoh need room for NULL */
Lines 1045-1055 Link Here
1045
1046
1046
    set_default_environment();
1047
    set_default_environment();
1047
1048
1048
    /* Launch first client */
1049
    /* Launch first client. Simulate exec -l:
1049
    pid_t client = subprocess(clientargs, set_client_process, NULL, NULL);
1050
       "If the -l option is supplied, the shell places a dash at the
1051
       beginning of the zeroth argument passed to command.  This is
1052
       what login(1) does."
1053
    */
1054
    clientbin = clientargs[0];
1055
    clientargs[0] = malloc(strlen(clientbin) + 2); /* Space for dash and trailing zero */
1056
    strcpy(clientargs[0], "-");
1057
    strcat(clientargs[0], clientbin);
1058
    pid_t client = subprocess_file(clientbin, clientargs, set_client_process, NULL, NULL);
1050
    if (client < 0) {
1059
    if (client < 0) {
1051
        fprintf(stderr, PROGNAME ": Failed to execute client\n");
1060
        fprintf(stderr, PROGNAME ": Failed to execute client\n");
1052
    }
1061
    }
1062
    free(clientargs[0]);
1053
1063
1054
    // Wait for client or server to exit, possibly kill server. 
1064
    // Wait for client or server to exit, possibly kill server. 
1055
    while (client > 0) {
1065
    while (client > 0) {

Return to bug 6158