All of lore.kernel.org
 help / color / mirror / Atom feed
From: ChenQi <Qi.Chen@windriver.com>
To: Richard Purdie <richard.purdie@linuxfoundation.org>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 1/1] image_types.bbclass: add --numeric-owner option to tar command
Date: Mon, 21 Oct 2013 10:43:04 +0800	[thread overview]
Message-ID: <526494B8.5040808@windriver.com> (raw)
In-Reply-To: <1382108236.29912.552.camel@ted>

On 10/18/2013 10:57 PM, Richard Purdie wrote:
> On Fri, 2013-10-18 at 15:47 +0800, Qi.Chen@windriver.com wrote:
>> From: Chen Qi <qi.chen@windriver.com>
>>
>> If the same username exists on both target and the build host, but
>> the uids differ, and we start target via NFS, then the uid for the
>> user will be incorrect on target.
>>
>> For example, if postfix's uid on host is 119 and on target is 1024,
>> then if we start target via NFS, the uid for postfix will be 119.
>>
>> The root cause is that when we use runqemu-extract-sdk to generate
>> the NFS rootfs for later use, the tar command will respect the username
>> instead of uid. So if PSEUDO_PASSWD environment is not set correctly,
>> the host /etc/passwd will be used, resulting in wrong uids.
>>
>> The situation for gid is completely analogous to that of uid.
>>
>> It's almost impossible for the runqemu-extract-sdk to guess the correct
>> location of the needed password file merely based on the target tarball
>> name.
>>
>> This patch solves this problem by adding the '--numeric-owner' option
>> to the tar command so that the username/groupname is not recorded in
>> the tarball. In this situation, we'll always get the correct uid/gid
>> after extracting the tarball.
>>
>> [YOCTO #5364]
>>
>> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
>> ---
>>   meta/classes/image_types.bbclass |    2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
> Er, isn't the right fix to fix runqemu-extract-sdk to use numeric IDs
> then rather than butcher all the tarballs we create?
>
> Cheers,
>
> Richard
>
>
>

Thanks for pointing it out.
V2 has been sent out.

Best Regards,
Chen Qi


      reply	other threads:[~2013-10-21  2:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-18  7:47 [PATCH 0/1] image_type.bbclass: add '--numeric-owner' to tar command Qi.Chen
2013-10-18  7:47 ` [PATCH 1/1] image_types.bbclass: add --numeric-owner option " Qi.Chen
2013-10-18 14:57   ` Richard Purdie
2013-10-21  2:43     ` ChenQi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=526494B8.5040808@windriver.com \
    --to=qi.chen@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.