Open-source Languages & Tools for z/OS

 View Only

 sudo error: SIGPIPE

Jump to Best Answer
Cristiano Guadagnino's profile image
Cristiano Guadagnino posted 06-17-2021 03:31

Hi all,
I am having a problem with sudo 1.8.6p3. I know, I know this is not the latest release, but we're still not ready to deploy miniconda, so please bear with me.
The problem is that upon executing some commands I get a SIGPIPE.
Example: yesterday I was experimenting with some sudoers rules and I launched this one (real user has been amended):
sudo -H -n -u XXXXX -- git ls-remote --tags origin "refs/tags/PROD*"
which ends immediately with this error: CEE5213S The signal SIGPIPE was received.
The same command executed without sudo (from the correct user) works perfectly.
I have tried googling around but I do not find anything.
Is this a known behavior fixed in the latest release?

Thank you in advance
Cris

Sergey Rezepin's profile image
ROCKETEER Sergey Rezepin Best Answer

Hi Cris,

Thank you for reporting the issue.
It looks, the pipe closes before it gets an output from git, but it works well for some other commands.

sudo git ls-remote
CEE5213S The signal SIGPIPE was received.

sudo git log -1
commit 0085cc0612dd7cff3c21eca2c6dc2d3481b8b6bd (HEAD -> master, origin/master, origin/HEAD)

Unfortunately, it's reproduced for sudo 1.8.6p3 and the latest ported version (1.8.21p2).
An internal issue was opened for this case.

Thanks,
Sergey

Cristiano Guadagnino's profile image
Cristiano Guadagnino

Since nobody is answering, I'll add that not all git commands fail in this way.
Some git commands work flawlessly, while others fail with the SIGPIPE error.

Cris

Cristiano Guadagnino's profile image
Cristiano Guadagnino

How come not even one Rocketeer is replying?
It's been six days without a reply, not even a wild guess as to what is causing the problem.
Do you need more details? Is it because I'm using an old release of sudo?
Please, we have a project stuck because of this problem.
Even a reply like "you need to update sudo to get support" would be helpful, but silence is not! :-)

Cris

Sergey Rezepin's profile image
ROCKETEER Sergey Rezepin

Hi Cris,

I'm sorry for delay. Please note that we have to prioritize our work for customers on support contract, so the research might take some time. 

Could you say which version of bash and git you are using?
What is rule you are using for the current user to have the access rights of XXXXX user in .sudoers?
Could you also provide the output of the following command: sudo -H -n -u XXXXX -- env

Thanks,
Sergey

Cristiano Guadagnino's profile image
Cristiano Guadagnino
Thank you @Sergey Rezepin for your reply!

Here are the version numbers you requested:
- GNU bash, version 4.3.46(51)-release (i370-ibm-openedition)
- git version 2.14.4_zos_b09

And here is the output from the sudo command you posted:​yyyyy@BVLSYSA [~]$ sudo -H -n -u XXXXX -- env
TERM=xterm
PATH=/PRDS/JAVA64800/SAJV80N/bin:/bkde/rocket/bin:/bkde/rocket/libexec/git-core:/PRDS/CMOD/V8R4M0/bin:/PRDS/java2600/J6.0/bin:/usr/lpp/Printsrv/bin:/bin:.:usr/lpp/db2repl_08_02/bin:/usr/lpp/IBM/PrintXform/V1R2/bin:/usr/lpp/IBM/PrintXform/V1R2/AFPxPS/bin:/usr/lpp/IBM/PrintXform/V1R2/AFPxPDF/bin:/usr/lpp/IBM/PrintXform/V1R2/AFPxPCL/bin:/bkd/u/cguada:/bkd/u/cguada/users:/bkd/bin:/bkd/u/cguada/bin:/bkd/u/cguada/scripts:/bkde/coz/bin:.:./bin
LANG=C
TZ=GMT-1DST,M3.5.0/2:00,M10.5.0/3:00
PS1=\u@\h [\w\]]\$
SHELL=/bkde/rocket/bin/bash
MAIL=/var/mail/XXXXX
LOGNAME=XXXXX
USER=XXXXX
USERNAME=XXXXX
HOME=/u/xxxxx
SUDO_COMMAND=/bin/env
SUDO_USER=yyyyy
SUDO_UID=amended
SUDO_GID=amended
_CEE_RUNOPTS=POS(ON) FILET(AUTOCVT,AUTOTAG)

I hope this helps.

Thank you!
Cris
Cristiano Guadagnino's profile image
Cristiano Guadagnino

Thank you for confirming this is a bug in sudo.
Since no workaround has been mentioned, I guess we can only wait until a solution becomes available.

Best regards
Cris

Benjamin Maloy's profile image
ROCKETEER Benjamin Maloy
Hey Cris,

I have been working on this issue and have a couple of suggestions. The problem is that sudo does not work well with the symlinks that git uses under the hood for some instructions. Try one of the following fixes:
  • if your repo has been cloned via an https connection, try connecting via ssh
    • via an ssh connection, symlinks are not used when requesting remotes
  • alternatively, run "su XXXX", followed by the desired command: "git ls-remote --tags origin "refs/tags/PROD*""
    • su does not have the same problems running the internal git symlinks as sudo
Looking forward to hearing if one of these suggestions works for you!