On Tue, Mar 25, 2014 at 08:24:13PM +0900, Kusanagi Kouichi wrote:
> Description:
>       Bash's builtin printf cannot write more than one line to
>       /proc/pid/uid_map because printf writes one line at a time
>       and uid_map can be written only once.

Sounds like Bash is using the standard I/O library routines, in line
buffering mode (i.e.  setvbuf(..., _IOLBF, ...);  ).  It's not clear
to me whether this can be considered a bug, as line-buffered output
is common, and situations where it fails are rare.

> Repeat-By:
>       # printf '0 0 1\n1 1 1' > /proc/31861/uid_map
>       printf: write error: Operation not permitted

As a workaround, you might consider something like:

printf '0 0 1\n1 1 1' | dd bs=1024 > /proc/31861/uid_map

Reply via email to