[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: printf cannot write more than one line to /proc/pid/uid_map
From: |
Greg Wooledge |
Subject: |
Re: printf cannot write more than one line to /proc/pid/uid_map |
Date: |
Tue, 25 Mar 2014 09:57:27 -0400 |
User-agent: |
Mutt/1.4.2.3i |
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
Message not available