s3-talloc Change TALLOC_ZERO_P() to talloc_zero()
[nivanova/samba-autobuild/.git] / source3 / winbindd / winbindd_util.c
index b43d7b826f5c172d344e7e643bbf13a904540301..7dff138fc137b0a1381da743e024d8ebc5e0dad1 100644 (file)
@@ -261,7 +261,7 @@ static void add_trusted_domains( struct winbindd_domain *domain )
        struct trustdom_state *state;
        struct tevent_req *req;
 
-       state = TALLOC_ZERO_P(NULL, struct trustdom_state);
+       state = talloc_zero(NULL, struct trustdom_state);
        if (state == NULL) {
                DEBUG(0, ("talloc failed\n"));
                return;
@@ -894,31 +894,6 @@ bool parse_domain_user_talloc(TALLOC_CTX *mem_ctx, const char *domuser,
        return ((*domain != NULL) && (*user != NULL));
 }
 
-/* add a domain user name to a buffer */
-void parse_add_domuser(void *buf, char *domuser, int *len)
-{
-       fstring domain;
-       char *p, *user;
-
-       user = domuser;
-       p = strchr(domuser, *lp_winbind_separator());
-
-       if (p) {
-
-               fstrcpy(domain, domuser);
-               domain[PTR_DIFF(p, domuser)] = 0;
-               p++;
-
-               if (assume_domain(domain)) {
-
-                       user = p;
-                       *len -= (PTR_DIFF(p, domuser));
-               }
-       }
-
-       safe_strcpy((char *)buf, user, *len);
-}
-
 /* Ensure an incoming username from NSS is fully qualified. Replace the
    incoming fstring with DOMAIN <separator> user. Returns the same
    values as parse_domain_user() but also replaces the incoming username.
@@ -1371,6 +1346,11 @@ bool is_domain_offline(const struct winbindd_domain *domain)
        return !domain->online;
 }
 
+bool is_domain_online(const struct winbindd_domain *domain)
+{
+       return !is_domain_offline(domain);
+}
+
 bool parse_sidlist(TALLOC_CTX *mem_ctx, const char *sidstr,
                   struct dom_sid **sids, uint32_t *num_sids)
 {