bug-bash
[Top][All Lists]
Advanced

[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: Kusanagi Kouichi
Subject: Re: printf cannot write more than one line to /proc/pid/uid_map
Date: Wed, 26 Mar 2014 00:14:39 +0900
User-agent: Mutt/1.5.23 (2014-03-12)

On 2014-03-25 08:58:08 -0500, Dennis Williamson wrote:
> On Mar 25, 2014 8:40 AM, "Kusanagi Kouichi" <slash@ac.auone-net.jp> wrote:
> >
> > Configuration Information [Automatically generated, do not change]:
> > Machine: x86_64
> > OS: linux-gnu
> > Compiler: gcc
> > Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
> -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu'
> -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL
> -DHAVE_CONFIG_H   -I.  -I../. -I.././include -I.././lib
>  -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4
> -Wformat -Werror=format-security -Wall
> > uname output: Linux crescent 3.14.0-rc7 #1 SMP Mon Mar 17 07:17:51 UTC
> 2014 x86_64 GNU/Linux
> > Machine Type: x86_64-pc-linux-gnu
> >
> > Bash Version: 4.3
> > Patch Level: 0
> > Release Status: release
> >
> > 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.
> >
> > Repeat-By:
> >         shell 1
> >         $ unshare -U
> >         $ echo $$
> >         31861
> >
> >         shell 2
> >         # printf '0 0 1\n1 1 1' > /proc/31861/uid_map
> >         printf: write error: Operation not permitted
> >
> 
> What happens if you use /usr/bin/printf instead of the Bash builtin?

/usr/bin/printf and dash's printf work as expected.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]