aboutsummaryrefslogtreecommitdiff
path: root/client.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-02-20 17:36:09 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-02-20 17:36:09 +0000
commitb5efe984bbfec151b70d3450f4f18243313de497 (patch)
tree7eb36e6dc8d96120ffdf2081b365c1c161cda17c /client.c
parentconfig: add 'login-shell' option (diff)
slave: prefix argv[0] with a '-' when spawning a login-shell
Diffstat (limited to 'client.c')
-rw-r--r--client.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/client.c b/client.c
index de7c6c6f..e00adc40 100644
--- a/client.c
+++ b/client.c
@@ -161,6 +161,7 @@ main(int argc, char *const *argv)
/* Calculate total length */
total_len += sizeof(cwd_len) + cwd_len;
total_len += sizeof(term_len) + term_len;
+ total_len += sizeof(uint8_t); /* login_shell */
total_len += sizeof(argc);
for (int i = 0; i < argc; i++) {
@@ -190,6 +191,11 @@ main(int argc, char *const *argv)
goto err;
}
+ if (send(fd, &(uint8_t){login_shell}, sizeof(uint8_t), 0) != sizeof(uint8_t)) {
+ LOG_ERRNO("failed to send login-shell");
+ goto err;
+ }
+
LOG_DBG("argc = %d", argc);
if (send(fd, &argc, sizeof(argc), 0) != sizeof(argc)) {
LOG_ERRNO("failed to send argc/argv to server");