ALT Linux Bugzilla
– Attachment 12362 Details for
Bug 45029
Неверный код возврата при запуске ssh-agent
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
Возвращение кода возврата как в апстриме
0001-Fix-return-code-as-in-upstream.patch (text/plain), 1.98 KB, created by
Andrey Cherepanov
on 2023-01-24 17:58:49 MSK
(
hide
)
Description:
Возвращение кода возврата как в апстриме
Filename:
MIME Type:
Creator:
Andrey Cherepanov
Created:
2023-01-24 17:58:49 MSK
Size:
1.98 KB
patch
obsolete
>From cccd59253314227ac74a3c926f7cc1cba8337dbe Mon Sep 17 00:00:00 2001 >From: Andrey Cherepanov <cas@altlinux.org> >Date: Tue, 24 Jan 2023 17:48:25 +0300 >Subject: [PATCH] Fix return code as in upstream > >--- > ssh-agent.c | 23 +++++++++++++++-------- > 1 file changed, 15 insertions(+), 8 deletions(-) > >diff --git a/ssh-agent.c b/ssh-agent.c >index 75eae926..bee7b74d 100644 >--- a/ssh-agent.c >+++ b/ssh-agent.c >@@ -1510,16 +1510,20 @@ main(int ac, char **av) > > pidstr = getenv(SSH_AGENTPID_ENV_NAME); > if (pidstr == NULL) { >- fatal("%s not set, cannot kill agent", >- SSH_AGENTPID_ENV_NAME); >+ fprintf(stderr, "%s not set, cannot kill agent\n", >+ SSH_AGENTPID_ENV_NAME); >+ exit(1); > } > pid = (int)strtonum(pidstr, 2, INT_MAX, &errstr); > if (errstr) { >- fatal( "%s=\"%s\", which is not a good PID: %s", >- SSH_AGENTPID_ENV_NAME, pidstr, errstr); >+ fprintf(stderr, >+ "%s=\"%s\", which is not a good PID: %s\n", >+ SSH_AGENTPID_ENV_NAME, pidstr, errstr); >+ exit(1); > } > if (kill(pid, SIGTERM) == -1) { >- fatal("kill: %m"); >+ perror("kill"); >+ exit(1); > } > format = c_flag ? "unsetenv %s;\n" : "unset %s;\n"; > printf(format, SSH_AUTHSOCKET_ENV_NAME); >@@ -1553,7 +1557,8 @@ main(int ac, char **av) > /* Create private directory for agent socket */ > mktemp_proto(socket_dir, sizeof(socket_dir)); > if (mkdtemp(socket_dir) == NULL) { >- fatal("mkdtemp: private socket dir: %m"); >+ perror("mkdtemp: private socket dir"); >+ exit(1); > } > snprintf(socket_name, sizeof socket_name, > "%s/agent.%ld", socket_dir, (long)parent_pid); >@@ -1626,10 +1631,12 @@ main(int ac, char **av) > } > if (setenv(SSH_AUTHSOCKET_ENV_NAME, socket_name, 1) == -1 || > setenv(SSH_AGENTPID_ENV_NAME, pidstrbuf, 1) == -1) { >- fatal("setenv: %m"); >+ perror("setenv"); >+ exit(1); > } > execvp(av[0], av); >- fatal("execvp: %s: %m", av[0]); >+ perror(av[0]); >+ exit(1); > } > /* child */ > log_init(__progname, SYSLOG_LEVEL_INFO, SYSLOG_FACILITY_AUTH, 0); >-- >2.25.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 45029
: 12362