Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Norbert Lange <nolange79@gmail.com>
To: buildroot@buildroot.org
Cc: Norbert Lange <nolange79@gmail.com>,
	Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Subject: [Buildroot] [PATCH 2/2] mkusers: change default from normal to system user
Date: Fri, 14 Jan 2022 11:12:46 +0100	[thread overview]
Message-ID: <20220114101247.342256-2-nolange79@gmail.com> (raw)
In-Reply-To: <20220114101247.342256-1-nolange79@gmail.com>

for all packages, this is the fitting default,
but the fallout will be user provided tables.

Also update the docs with the chagned behaviour.

Signed-off-by: Norbert Lange <nolange79@gmail.com>
---
 docs/manual/makeusers-syntax.txt | 11 +++++++----
 support/scripts/mkusers          |  6 +++---
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/docs/manual/makeusers-syntax.txt b/docs/manual/makeusers-syntax.txt
index 467e596230..3d1013f447 100644
--- a/docs/manual/makeusers-syntax.txt
+++ b/docs/manual/makeusers-syntax.txt
@@ -20,13 +20,16 @@ Where:
   It can not be +root+, and must be unique. If set to +-+, then just a
   group will be created.
 - +uid+ is the desired UID for the user. It must be unique, and not
-  +0+. If set to +-1+, then a unique UID will be computed by Buildroot
-  in the range [1000...1999]
+  +0+. If set to +-1+ or +-2+, then a unique UID will be computed by
+  Buildroot, with +-1+ denoting a system UID from [100...999] and +-2+
+  denoting a user UID from [1000...1999]. 
 - +group+ is the desired name for the user's main group. It can not
   be +root+. If the group does not exist, it will be created.
 - +gid+ is the desired GID for the user's main group. It must be unique,
-  and not +0+. If set to +-1+, and the group does not already exist, then
-  a unique GID will be computed by Buildroot in the range [1000..1999]
+  and not +0+. If set to +-1+ or +-2+, and the group does not already
+  exist, then a unique GID will be computed by Buildroot, with +-1+
+  denoting a system GID from [100...999] and +-2+ denoting a user GID
+  from [1000...1999]. 
 - +password+ is the crypt(3)-encoded password. If prefixed with +!+,
   then login is disabled. If prefixed with +=+, then it is interpreted
   as clear-text, and will be crypt-encoded (using MD5). If prefixed with
diff --git a/support/scripts/mkusers b/support/scripts/mkusers
index 9d8295e8a3..f7a3180e30 100755
--- a/support/scripts/mkusers
+++ b/support/scripts/mkusers
@@ -14,8 +14,8 @@ LAST_SYSTEM_UID=999
 FIRST_SYSTEM_GID=100
 LAST_SYSTEM_GID=999
 # argument to automatically crease system/user id
-AUTO_SYSTEM_ID=-2
-AUTO_USER_ID=-1
+AUTO_SYSTEM_ID=-1
+AUTO_USER_ID=-2
 
 # No more is configurable below this point
 #----------------------------------------------------------------------------
@@ -433,7 +433,7 @@ main() {
         read username uid group gid passwd home shell groups comment <<<"${line}"
         if [ "${groups}" != "-" ]; then
             for g in ${groups//,/ }; do
-                add_one_group "${g}" ${AUTO_USER_ID}
+                add_one_group "${g}" ${AUTO_SYSTEM_ID}
             done
         fi
     done
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2022-01-14 10:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-14 10:12 [Buildroot] [PATCH 1/2] support/scripts/mkusers: allow option for system uid/gid Norbert Lange
2022-01-14 10:12 ` Norbert Lange [this message]
2022-01-16 12:27   ` [Buildroot] [PATCH 2/2] mkusers: change default from normal to system user Arnout Vandecappelle
2022-02-05 22:14   ` Arnout Vandecappelle
2022-01-16 12:25 ` [Buildroot] [PATCH 1/2] support/scripts/mkusers: allow option for system uid/gid Arnout Vandecappelle
2022-01-17  9:34   ` Norbert Lange
2022-02-05 22:13 ` Arnout Vandecappelle

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=20220114101247.342256-2-nolange79@gmail.com \
    --to=nolange79@gmail.com \
    --cc=buildroot@buildroot.org \
    --cc=thomas.de_schampheleire@nokia.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox