summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/shadow/files/add_root_cmd_options.patch
Commit message (Collapse)AuthorAgeFilesLines
* Fix the --root option in shadow-native programsJulian Pidancet2011-10-101-91/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The add_root_cmd_options.patch that we apply to shadow-native allow the various programs from the shadow utility package to chroot() so they can be used to modify etc/passwd and etc/group if they are located in a sysroot. Some of the shadow programs (gpasswd, useradd and usermod) need to parse the command line in two passes. But we can't use getopt_long() twice because getopt_long() reorders the command line arguments, and consequently corrupts the option parsing during the second pass. This patch fixes this issue by replacing the first pass by a very simple manual walk of the command line to handle the --root argument. This change is a patch of another patch, I apologize if it is difficult to read. But IMHO it wouldn't make sense to put the patch for this issue in another separated file. The --root options in groupadd and useradd are needed to make the useradd class work, and this issue was preventing to use useradd and groupadd long options while using the class. (From OE-Core rev: 6e9e19b18597103d8fe09f258cfd9904bb5f1c27) Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* shadow-native: fix creation of home directoriesScott Garman2011-06-301-27/+98
| | | | | | | | | | | | | | | Pseudo was recently changed so that when system() calls are made after a chroot(), the host binaries can no longer be found, breaking the system("mkdir -p") approach when useradd creates home directories. Instead, use mkdir(2) to create home directories with a helper function to ensure parent directories get created. (From OE-Core rev: 7d4099a964ec79b1ac4cf5348cf9f4221c3d4908) Signed-off-by: Scott Garman <scott.a.garman@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* shadow: add a -native recipe with customized utilitiesScott Garman2011-06-061-0/+1296
This adds a -native recipe for the shadow utilities. The custom --root option allows the the following utilities to be run within a chroot when invoked under pseudo: * useradd * groupadd * usermod * groupmod * userdel * groupdel * passwd * gpasswd * pwconv * pwunconv * grpconv * grpunconv They can then be used to manipulate user and group account information in target sysroots. useradd was also modified to create home directories recursively when necessary. (From OE-Core rev: 37b8c18a3c2f3e77a9810a56a8ee786855ae1ba3) Signed-off-by: Scott Garman <scott.a.garman@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>