[lxc-devel] [PATCH] lxc-download: POSIX doesn't specify -f for chown
Stéphane Graber
stgraber at ubuntu.com
Wed Jan 15 15:02:03 UTC 2014
On Wed, Jan 15, 2014 at 08:48:52AM -0600, Serge Hallyn wrote:
> Quoting Stéphane Graber (stgraber at ubuntu.com):
> > Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
>
> and you were already sending output to /dev/null anyway :)
>
> Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>
>
> Though I would also point out that the man page shows options
> coming before the [OWNER][:[GROUP]], which implies there might
> be implementations where putting $LXC_MAPPED_UID before the -R
> might break. Not sure.
Good point, I'll change that when applying.
>
> > ---
> > templates/lxc-download.in | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/templates/lxc-download.in b/templates/lxc-download.in
> > index c318041..04f5846 100644
> > --- a/templates/lxc-download.in
> > +++ b/templates/lxc-download.in
> > @@ -396,7 +396,7 @@ if [ "$DOWNLOAD_USE_CACHE" = "false" ]; then
> > echo $DOWNLOAD_BUILD > $LXC_CACHE_PATH/build_id
> >
> > if [ -n "$LXC_MAPPED_UID" ] && [ "$LXC_MAPPED_UID" != "-1" ]; then
> > - chown $LXC_MAPPED_UID -Rf $LXC_CACHE_BASE >/dev/null 2>&1 || true
> > + chown $LXC_MAPPED_UID -R $LXC_CACHE_BASE >/dev/null 2>&1 || true
> > fi
> > echo "The image cache is now ready"
> > fi
> > @@ -489,7 +489,7 @@ for file in $TEMPLATE_FILES; do
> > done
> >
> > if [ -n "$LXC_MAPPED_UID" ] && [ "$LXC_MAPPED_UID" != "-1" ]; then
> > - chown $LXC_MAPPED_UID -f $LXC_PATH/config $LXC_PATH/fstab || true
> > + chown $LXC_MAPPED_UID $LXC_PATH/config $LXC_PATH/fstab >/dev/null 2>&1 || true
> > fi
> >
> > if [ -e "$(relevant_file create-message)" ]; then
> > --
> > 1.8.5.2
> >
> > _______________________________________________
> > lxc-devel mailing list
> > lxc-devel at lists.linuxcontainers.org
> > http://lists.linuxcontainers.org/listinfo/lxc-devel
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel
--
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20140115/ac860f10/attachment.pgp>
More information about the lxc-devel
mailing list