extcmd incorrectly assumes PIPE_BUF is real pipe capacity

Bug #1402675 reported by Zygmunt Krynicki
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PlainBox (Toolkit)
Fix Released
Critical
Zygmunt Krynicki

Bug Description

The code inside the glibc-based extcmd implementation is based on the assumption that a pipe may hold at most PIPE_BUF bytes. This is not correct as the actual pipe may be much larger (e.g. 1MB vs 4KB). We need to us /proc/sys/fs/max-pipe-size or use fcntl(2) with F_GETPIPE_SZ to really know how much we need to read.

This causes various bad side effects (manifestations) but is always observable as a "truncated" log file.

Related branches

Zygmunt Krynicki (zyga)
Changed in plainbox:
status: In Progress → Fix Committed
Changed in plainbox:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.