From d73cbd31a295ac757e59f129f162d9cd69440224 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Mon, 21 Jul 2008 14:41:33 +0000 Subject: - first pass to unify/cleanup uid handling (-236b) This needs further love, alot of love.. Tito? --- libpwdgrp/uidgid_get.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'libpwdgrp') diff --git a/libpwdgrp/uidgid_get.c b/libpwdgrp/uidgid_get.c index 88f4e2545..dc7cc6614 100644 --- a/libpwdgrp/uidgid_get.c +++ b/libpwdgrp/uidgid_get.c @@ -76,6 +76,11 @@ int FAST_FUNC get_uidgid(struct bb_uidgid_t *u, const char *ug, int numeric_ok) } return 1; } +void FAST_FUNC xget_uidgid(struct bb_uidgid_t *u, const char *ug) +{ + if (!get_uidgid(u, ug, 1)) + bb_error_msg_and_die("unknown user/group %s", ug); +} /* chown-like: * "user" sets uid only, @@ -106,8 +111,7 @@ void FAST_FUNC parse_chown_usergroup_or_die(struct bb_uidgid_t *u, char *user_gr } else { if (!group[1]) /* "user:" */ *group = '\0'; - if (!get_uidgid(u, user_group, 1)) - bb_error_msg_and_die("unknown user/group %s", user_group); + xget_uidgid(u, user_group); } } -- cgit v1.2.3