summaryrefslogtreecommitdiff
path: root/source3/nsswitch/winbindd_util.c
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2001-11-26 04:27:51 +0000
committerTim Potter <tpot@samba.org>2001-11-26 04:27:51 +0000
commit64dd6c3412f961239ad4c6989aab67250d312c9d (patch)
treeca574f52b73672257cac3a26121cfc7ff05d77a8 /source3/nsswitch/winbindd_util.c
parent178f6a64b26d828db6b516392d7072e9c29f6233 (diff)
downloadsamba-64dd6c3412f961239ad4c6989aab67250d312c9d.tar.gz
samba-64dd6c3412f961239ad4c6989aab67250d312c9d.tar.bz2
samba-64dd6c3412f961239ad4c6989aab67250d312c9d.zip
Another merge from appliance-head: in [ug]id_to_sid don't call the
winbind function if the id is obviously going to be local. Cleanup of winbind [ug]id parameter handling. (This used to be commit 4ab9ca31a02b3388aa89a00e0390ea9e4c76283a)
Diffstat (limited to 'source3/nsswitch/winbindd_util.c')
-rw-r--r--source3/nsswitch/winbindd_util.c54
1 files changed, 7 insertions, 47 deletions
diff --git a/source3/nsswitch/winbindd_util.c b/source3/nsswitch/winbindd_util.c
index c603bac054..033e5c38aa 100644
--- a/source3/nsswitch/winbindd_util.c
+++ b/source3/nsswitch/winbindd_util.c
@@ -764,60 +764,20 @@ void free_getent_state(struct getent_state *state)
}
}
-/* Parse list of arguments to winbind uid or winbind gid parameters */
-
-static BOOL parse_id_list(char *paramstr, BOOL is_user)
-{
- uid_t id_low, id_high = 0;
-
- /* Give a nicer error message if no parameters specified */
-
- if (strequal(paramstr, "")) {
- DEBUG(0, ("winbind %s parameter missing\n", is_user ? "uid" : "gid"));
- return False;
- }
-
- /* Parse entry */
-
- if (sscanf(paramstr, "%u-%u", &id_low, &id_high) != 2) {
- DEBUG(0, ("winbind %s parameter invalid\n",
- is_user ? "uid" : "gid"));
- return False;
- }
-
- /* Store id info */
-
- if (is_user) {
- server_state.uid_low = id_low;
- server_state.uid_high = id_high;
- } else {
- server_state.gid_low = id_low;
- server_state.gid_high = id_high;
- }
-
- return True;
-}
-
/* Initialise trusted domain info */
BOOL winbindd_param_init(void)
{
/* Parse winbind uid and winbind_gid parameters */
- if (!(parse_id_list(lp_winbind_uid(), True) &&
- parse_id_list(lp_winbind_gid(), False)))
- return False;
-
- /* Check for reversed uid and gid ranges */
-
- if (server_state.uid_low > server_state.uid_high) {
- DEBUG(0, ("uid range invalid\n"));
- return False;
+ if (!lp_winbind_uid(&server_state.uid_low, &server_state.uid_high)) {
+ DEBUG(0, ("winbind uid range missing or invalid\n"));
+ return False;
}
-
- if (server_state.gid_low > server_state.gid_high) {
- DEBUG(0, ("gid range invalid\n"));
- return False;
+
+ if (!lp_winbind_gid(&server_state.gid_low, &server_state.gid_high)) {
+ DEBUG(0, ("winbind gid range missing or invalid\n"));
+ return False;
}
return True;