bm = SMB_MALLOC_P(struct bitmap);
if (!bm) return NULL;
-
+
bm->n = n;
bm->b = SMB_MALLOC_ARRAY(uint32, (n+31)/32);
if (!bm->b) {
bm = TALLOC_P(mem_ctx, struct bitmap);
if (!bm) return NULL;
-
+
bm->n = n;
bm->b = TALLOC_ARRAY(mem_ctx, uint32, (n+31)/32);
if (!bm->b) {
Unix SMB/CIFS implementation.
Low-level connections.tdb access functions
Copyright (C) Volker Lendecke 2007
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
Samba internal messaging functions
Copyright (C) 2007 by Volker Lendecke
Copyright (C) 2007 by Andrew Tridgell
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
uint64 rand_srvid;
struct packet_context *pkt;
struct fd_event *fde;
-
+
void (*release_ip_handler)(const char *ip_addr, void *private_data);
void *release_ip_priv;
};
(long long unsigned)msg->srvid));
goto next_pkt;
}
-
+
if ((conn->release_ip_handler != NULL)
&& (msg->srvid == CTDB_SRVID_RELEASE_IP)) {
/* must be dispatched immediately */
TALLOC_FREE(hdr);
msg_state->msg_ctx = conn->msg_ctx;
-
+
/*
* We're waiting for a call reply, but an async message has
* crossed. Defer dispatching to the toplevel event loop.
TALLOC_FREE(hdr);
goto next_pkt;
}
-
+
goto next_pkt;
}
TALLOC_FREE(buf);
return NT_STATUS_OK;
-
}
/* only messages to our pid or the broadcast are valid here */
NTSTATUS status;
ZERO_STRUCT(req);
-
+
req.hdr.length = offsetof(struct ctdb_req_call, data) + key.dsize;
req.hdr.ctdb_magic = CTDB_MAGIC;
req.hdr.ctdb_version = CTDB_VERSION;
NTSTATUS status;
ZERO_STRUCT(req);
-
+
req.hdr.length = offsetof(struct ctdb_req_call, data) + key.dsize;
req.hdr.ctdb_magic = CTDB_MAGIC;
req.hdr.ctdb_version = CTDB_VERSION;
Copyright (C) Andrew Tridgell 1992-1998
Copyright (C) Rafal Szczesniak 2002
Copyright (C) Michael Adam 2007
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
int timeout)
{
TDB_DATA key = string_term_tdb_data(keyval);
-
+
return tdb_chainlock_with_timeout(tdb, key, timeout);
}
int tdb_read_lock_bystring_with_timeout(TDB_CONTEXT *tdb, const char *keyval, unsigned int timeout)
{
TDB_DATA key = string_term_tdb_data(keyval);
-
+
return tdb_chainlock_with_timeout_internal(tdb, key, timeout, F_RDLCK);
}
TDB_DATA data, int flags)
{
TDB_DATA key = string_term_tdb_data(keystr);
-
+
return tdb_trans_store(tdb, key, data, flags);
}
DEBUG(18,("tdb_pack_va(%s, %d) -> %d\n",
fmt0, bufsize0, (int)PTR_DIFF(buf, buf0)));
-
+
return PTR_DIFF(buf, buf0);
}
Winbind Utility functions
Copyright (C) Gerald (Jerry) Carter 2007
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
wbcFreeMemory(domain_name);
wbcFreeMemory(account_name);
-
+
if ((domain && !*domain) || (name && !*name)) {
DEBUG(0,("winbind_lookup_sid: talloc() failed!\n"));
return false;
{
wbcErr result;
struct wbcDomainInfo *info = NULL;
-
+
result = wbcDomainInfo(domain, &info);
if (WBC_ERROR_IS_OK(result)) {
struct wbcDomainSid dom_sid;
wbcErr ret;
int i;
-
+
memcpy(&dom_sid, domain_sid, sizeof(struct wbcDomainSid));
-
+
ret = wbcLookupRids(&dom_sid, num_rids, rids,
&dom_name, &namelist, &name_types);
if (ret != WBC_ERR_SUCCESS) {
return false;
}
-
+
*domain_name = talloc_strdup(mem_ctx, dom_name);
*names = TALLOC_ARRAY(mem_ctx, const char*, num_rids);
*types = TALLOC_ARRAY(mem_ctx, enum lsa_SidType, num_rids);
wbcFreeMemory(CONST_DISCARD(char*, dom_name));
wbcFreeMemory(namelist);
wbcFreeMemory(name_types);
-
+
return true;
}
bool winbind_allocate_uid(uid_t *uid)
{
wbcErr ret;
-
+
ret = wbcAllocateUid(uid);
-
+
return (ret == WBC_ERR_SUCCESS);
}
bool winbind_allocate_gid(gid_t *gid)
{
wbcErr ret;
-
+
ret = wbcAllocateGid(gid);
-
+
return (ret == WBC_ERR_SUCCESS);
}
/* yes, this is O(n^2) but n is very small */
for (i=0;list[i];i++) {
struct tagged_ip t_ip;
-
+
parse_ip(&t_ip, list[i]);
/* see if we already have it */
return t_ip.ip;
}
}
-
+
/* they're all dead - try the first one until they revive */
for (i=0; list[i]; i++) {
parse_ip(&t_ip, list[i]);