mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-23 01:40:12 -05:00
slave: prefix argv[0] with a '-' when spawning a login-shell
This commit is contained in:
parent
6af4b87ec5
commit
b5efe984bb
7 changed files with 44 additions and 13 deletions
6
client.c
6
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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue