fix(auth): Replace shell with glab process

Description

  • fix(auth): Replace shell with glab process

Tell the (intermediate) shell to replace itself with the glab process instead of doing a fork() first and then wait()ing for the child process to exit. This is not only more efficient, but also prevents issues in environments without a proper init process to reap zombie children, and mitigates issues with the intermediate shell process not propagating all signals to its child processes.

Found while reviewing #8541 (closed) !3922 (merged) from @phikai

How has this been tested?

$ make
…
$ bin/glab auth configure-docker
…
$ cat ~/.local/bin/docker-credential-glab
#!/bin/sh -eu
exec glab auth docker-helper "$@"
$ ~/.local/bin/docker-credential-glab
          
   ERROR  
          
  Arg is missing - valid args: [store get erase].                                                                     
Edited by Philipp Hahn

Merge request reports

Loading
Loading