<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>4074</bug_id>
          
          <creation_ts>2013-03-21 15:01:23 +0000</creation_ts>
          <short_desc>During filesystem construction add a method to add/modify users and groups settings</short_desc>
          <delta_ts>2013-07-31 08:36:21 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>deployment</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>1.5 M3</target_milestone>
          
          <blocked>1577</blocked>
    
    <blocked>4106</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Mark Hatle">mark.hatle</reporter>
          <assigned_to name="Chen Qi">Qi.Chen</assigned_to>
          <cc>liezhi.yang</cc>
    
    <cc>Qi.Chen</cc>
    
    <cc>sgw</cc>
    
    <cc>venkatarg</cc>
    
    <cc>yi.zhao</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>30983</commentid>
    <comment_count>0</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2013-03-21 15:01:23 +0000</bug_when>
    <thetext>During the filesystem construction, there should be a method to add users/groups, modify existing users/groups (including shadow/expiration settings), and configure passwords.

One suggestion would be to construct a table that can be processed to make the changes requested by the user.  This behavior is difficult then a package with a pre/post-install script as this is more of a system admin functionality.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>34152</commentid>
    <comment_count>1</comment_count>
    <who name="Chen Qi">Qi.Chen</who>
    <bug_when>2013-06-26 10:20:17 +0000</bug_when>
    <thetext>Hi Mark,

These days, I&apos;ve been thinking about this problem from time to time.

I thought about several ways to accomplish this task, but at last I came to the conclusion that the consistent way to achieve image level user/group setting still falls into the useradd.bbclass solution.

Let&apos;s consider two possible scenarios.

1) I want to add a user/group which doesn&apos;t logically belong to a specific package.
In this case, I think a dedicated package should be created in the corresponding layer, which inherits useradd class. 
Say, we have a layer, meta-product, and we want to add two users &apos;developer&apos; and &apos;tester&apos; to the image. A recipe dedicated for creating these two users will do the job for us, and in my opinion, in a consistent and manageable way, considering the possibility of the package upgrade.


2) I want to modify the user/group setting in some packages.
In this case, I think using a bbappend file and overriding the some variable like USERADD_PARAM would be sufficient.

Any thoughts on this?

Best Regards,
Chen Qi</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>34630</commentid>
    <comment_count>2</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2013-07-17 07:14:16 +0000</bug_when>
    <thetext>*** Bug 4729 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>34638</commentid>
    <comment_count>3</comment_count>
    <who name="venkata ramana g">venkatarg</who>
    <bug_when>2013-07-17 11:58:24 +0000</bug_when>
    <thetext>&gt;&gt;1) I want to add a user/group which doesn&apos;t logically belong to a specific package.

This method can be safely implemented by adding &quot;adduser&quot; config command using binary configuration feature.

Please refer to 
https://wiki.yoctoproject.org/wiki/Binary_configuration_support

&gt;&gt;2) I want to modify the user/group setting in some packages.

Yes, Poky supports using existing useradd.bbclass.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>34834</commentid>
    <comment_count>4</comment_count>
    <who name="Chen Qi">Qi.Chen</who>
    <bug_when>2013-07-25 06:08:50 +0000</bug_when>
    <thetext>merged into poky/master: 6d42c2718373a13b67986627b4c7a91719194c4b

http://git.openembedded.org/?p=openembedded-core.git&amp;a=commit;h=4b6deb521183b728d9a1c651d4805fe635e6cb50</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35199</commentid>
    <comment_count>5</comment_count>
    <who name="Yi Zhao">yi.zhao</who>
    <bug_when>2013-07-31 08:35:42 +0000</bug_when>
    <thetext>Test Cases

Steps:
1. Download the poky source and set the environment

2. Add the following lines in conf/local.conf

INHERIT += &quot;extrausers&quot;

EXTRA_USERS_PARAMS = &quot;\
useradd -p &apos;&apos; tester1; \
useradd -p &apos;vz4kBbiMF9z6E&apos; tester2; \
groupadd developers; \
userdel games; \
groupdel -g video; \
groupmod -g 1020 developers; \
usermod -s /bin/sh tester1; \
usermod -g users -G developers,sys tester2; \
&quot;

The above settings do the following things:
a. Add a user tester1 with empty password
b. Add a user tester2 with password 123456
c. Add a group developers
d. Delete user games
e. Delete group video
f. Set the gid of developers to 1020
g. For tester1, set the login shell to /bin/sh
h. For tester2, set the initial group to users. Set the supplementary groups to developers and sys.

3. Build the image

Expected Results:
1. No errors when building the image.  
2. The image can boot up. The /etc/group, /etc/passwd, and /etc/shadow should no errors.
3. Login with tester1 and tester2 without problems. Run &quot;id&quot; command to check the user status.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35200</commentid>
    <comment_count>6</comment_count>
    <who name="Yi Zhao">yi.zhao</who>
    <bug_when>2013-07-31 08:36:21 +0000</bug_when>
    <thetext>Verified with master/9de0ad47462c13ac4a2d73e12e92be6c1b4e0415</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>