Skip to content
  • Erik E Brady's avatar
    credential: ignore SIGPIPE when writing to credential helpers · a0d51e8d
    Erik E Brady authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    The credential subsystem can trigger SIGPIPE when writing to an
    external helper if that helper closes its stdin before reading the
    whole input. Normally this is rare, since helpers would need to read
    that input to make a decision about how to respond, but:
    
    1. It's reasonable to configure a helper which only handles "get"
       while ignoring "store".  Such a handler might not read stdin
       for "store", thereby rapidly closing stdin upon helper exit.
    
    2. A broken or misbehaving helper might exit immediately. That's an
       error, but it's not reasonable for it to take down the parent Git
       process with SIGPIPE.
    
    Even with such a helper, seeing this problem should be rare. Getting
    SIGPIPE requires the helper racily exiting before we've written the
    fairly small credential output.
    
    Signed-off-by: default avatarErik E Brady <brady@cisco.com>
    Reviewed-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    a0d51e8d