Commit Graph

5 Commits

Author SHA1 Message Date
Dennis Camera 2d751443a4 [__user] Fall back to /etc files if getent(1) is not available
On systems without getent(1) the script would fail because "command -v getent"
exits with 1 which terminates the script due to it being called by sh -e.
2019-10-01 08:12:57 +02:00
Philippe Grégoire 31e5c97c55
use command(1) to get executable's path 2017-08-21 10:51:55 -04:00
Philippe Grégoire 997fdd8ac4
fix typo in group entry extraction 2017-08-20 15:13:01 -04:00
Philippe Grégoire a915baa73b
__user: explore with /etc files
getent(1) is a utility available where Name Service Switch (NSS)
is available. Many modern operating systems support it, but that
may not be the case of all (e.g. embedded systems).

This commit modifies the __user type explorers to check the
traditional files instead of relying solely on the availability
of getent(1).

- Makes the group explorer use /etc/group
- Makes the passwd explorer use /etc/passwd
- Makes the shadow explorer use /etc/shadow

Implementation note

"getent shadow" does not support querying an entry using a uid
since it does not store that information. Since the shadow explorer
uses __object_id, the passwd explorer does not check if __object_id
matches an entry by uid. This behavior ensures consistent, transparent
behavior of the type. The group explorer, on the other hand, handles
group names and uids; like always.
2017-08-20 12:10:54 -04:00
Nico Schottelius 63573a9797 make package_data work
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-10-29 22:50:27 +01:00