BEFORE_INSTALL += debug profile
override LINK_SUBPROJECTS = NO
-export CCOMPILER = /usr/bin/gcc-3.5
+# export CCOMPILER = /usr/bin/gcc-X.X
#include <arpa/inet.h>
#include <string.h>
#include <stdlib.h>
-#include <errno.h>
#include <stdio.h>
#include <ctype.h>
#include <rpc/types.h>
gai_family_type_check(int32_t f)
{
int32_t i;
-
+
for (i = 0; i < supported_family_count; i++)
{
if (f == supported_family[i]) return 0;
gai_socket_type_check(int32_t s)
{
int32_t i;
-
+
for (i = 0; i < supported_socket_count; i++)
{
if (s == supported_socket[i]) return 0;
gai_protocol_type_check(int32_t p)
{
int32_t i;
-
+
for (i = 0; i < supported_protocol_count; i++)
{
if (p == supported_protocol[i]) return 0;
gai_socket_protocol_type_check(int32_t s, int32_t p)
{
int32_t i, j, ss, sp;
-
+
for (i = 0, j = 0; i < supported_socket_protocol_pair_count; i++, j+=2)
{
ss = supported_socket_protocol_pair[j];
if (!xdr_int(&outxdr, (int32_t *)&na))
{
xdr_destroy(&outxdr);
- errno = EIO;
return EAI_SYSTEM;
}
if (encode_kv(&outxdr, "name", nodename) != 0)
{
xdr_destroy(&outxdr);
- errno = EIO;
return EAI_SYSTEM;
}
}
if (encode_kv(&outxdr, "service", servname) != 0)
{
xdr_destroy(&outxdr);
- errno = EIO;
return EAI_SYSTEM;
}
}
if (encode_kv(&outxdr, "protocol", str) != 0)
{
xdr_destroy(&outxdr);
- errno = EIO;
return EAI_SYSTEM;
}
}
-
+
if (socktype != SOCK_UNSPEC)
{
snprintf(str, 64, "%u", socktype);
if (encode_kv(&outxdr, "socktype", str) != 0)
{
xdr_destroy(&outxdr);
- errno = EIO;
return EAI_SYSTEM;
}
}
-
+
if (family != PF_UNSPEC)
{
snprintf(str, 64, "%u", family);
if (encode_kv(&outxdr, "family", str) != 0)
{
xdr_destroy(&outxdr);
- errno = EIO;
return EAI_SYSTEM;
}
}
-
+
if (canonname != 0)
{
if (encode_kv(&outxdr, "canonname", "1") != 0)
{
xdr_destroy(&outxdr);
- errno = EIO;
return EAI_SYSTEM;
}
}
-
+
if (passive != 0)
{
if (encode_kv(&outxdr, "passive", "1") != 0)
{
xdr_destroy(&outxdr);
- errno = EIO;
return EAI_SYSTEM;
}
}
-
+
if (parallel != 0)
{
if (encode_kv(&outxdr, "parallel", "1") != 0)
{
xdr_destroy(&outxdr);
- errno = EIO;
return EAI_SYSTEM;
}
}
-
+
if (numerichost != 0)
{
if (encode_kv(&outxdr, "numerichost", "1") != 0)
{
xdr_destroy(&outxdr);
- errno = EIO;
return EAI_SYSTEM;
}
}
*len = xdr_getpos(&outxdr);
xdr_destroy(&outxdr);
-
+
return 0;
}
if (gai_proc < 0)
{
status = _lookup_link(server_port, "getaddrinfo", &gai_proc);
- if (status != KERN_SUCCESS)
- {
- errno = ECONNREFUSED;
- return EAI_SYSTEM;
- }
+ if (status != KERN_SUCCESS) return EAI_SYSTEM;
}
qlen = LU_QBUF_SIZE;
-
- /* gai_make_query sets errno if it fails */
i = gai_make_query(nodename, servname, hints, qbuf, &qlen);
if (i != 0) return EAI_SYSTEM;
if (!xdr_int(&inxdr, (int32_t *)&n))
{
xdr_destroy(&inxdr);
- errno = EIO;
return EAI_SYSTEM;
}
servnull = 0;
if ((servname == NULL) || (servname[0] == '\0')) servnull = 1;
-
+
if ((nodenull == 1) && (servnull == 1)) return EAI_NONAME;
status = gai_checkhints(hints);
if (status != 0) return status;
server_port = MACH_PORT_NULL;
if (_lu_running()) server_port = _lookupd_port(0);
- if (server_port == MACH_PORT_NULL)
- {
- errno = ECONNREFUSED;
- return EAI_SYSTEM;
- }
+ if (server_port == MACH_PORT_NULL) return EAI_SYSTEM;
if (gai_proc < 0)
{
status = _lookup_link(server_port, "getaddrinfo", &gai_proc);
- if (status != KERN_SUCCESS)
- {
- errno = ECONNREFUSED;
- return EAI_SYSTEM;
- }
+ if (status != KERN_SUCCESS) return EAI_SYSTEM;
}
qlen = LU_QBUF_SIZE;
-
- /* gai_make_query sets errno if it fails */
i = gai_make_query(nodename, servname, hints, qbuf, &qlen);
if (i != 0) return EAI_SYSTEM;
qlen /= BYTES_PER_XDR_UNIT;
- status = lu_async_start(p, gai_proc, qbuf, qlen, (void *)callback, context);
- if (status != 0)
- {
- errno = ECONNREFUSED;
- return EAI_SYSTEM;
- }
-
- return 0;
+ return lu_async_start(p, gai_proc, qbuf, qlen, (void *)callback, context);
}
int32_t
if (!xdr_int(&xdr, (int32_t *)&n))
{
xdr_destroy(&xdr);
- errno = EIO;
return EAI_SYSTEM;
}
int32_t i, j, nkeys, nvals, status;
char *key, **vals;
- if ((host == NULL) || (serv == NULL))
- {
- errno = EINVAL;
- return EAI_SYSTEM;
- }
+ if ((host == NULL) || (serv == NULL)) return EAI_SYSTEM;
- if (!xdr_int(inxdr, &nkeys))
- {
- errno = EIO;
- return EAI_SYSTEM;
- }
+ if (!xdr_int(inxdr, &nkeys)) return EAI_SYSTEM;
*host = NULL;
*serv = NULL;
key = NULL;
vals = NULL;
nvals = 0;
-
+
status = _lu_xdr_attribute(inxdr, &key, &vals, (uint32_t *)&nvals);
- if (status < 0)
- {
- errno = EIO;
- return EAI_SYSTEM;
- }
+ if (status < 0) return EAI_SYSTEM;
if (nvals == 0)
{
ifnum = s6->sin6_addr.__u6_addr.__u6_addr16[1];
if (ifnum == 0) ifnum = s6->sin6_scope_id;
else if ((s6->sin6_scope_id != 0) && (ifnum != s6->sin6_scope_id)) return EAI_FAIL;
-
+
s6->sin6_addr.__u6_addr.__u6_addr16[1] = 0;
s6->sin6_scope_id = ifnum;
if ((ifnum != 0) && (flags & NI_NUMERICHOST)) flags |= NI_WITHSCOPEID;
if (!xdr_int(&outxdr, (int32_t *)&na))
{
xdr_destroy(&outxdr);
- errno = EIO;
return EAI_SYSTEM;
}
if (encode_kv(&outxdr, key, str) != 0)
{
xdr_destroy(&outxdr);
- errno = EIO;
return EAI_SYSTEM;
}
}
if (encode_kv(&outxdr, "port", str) != 0)
{
xdr_destroy(&outxdr);
- errno = EIO;
return EAI_SYSTEM;
}
}
if (encode_kv(&outxdr, "protocol", "udp") != 0)
{
xdr_destroy(&outxdr);
- errno = EIO;
return EAI_SYSTEM;
}
}
if (encode_kv(&outxdr, "fqdn", "0") != 0)
{
xdr_destroy(&outxdr);
- errno = EIO;
return EAI_SYSTEM;
}
}
if (encode_kv(&outxdr, "numerichost", "1") != 0)
{
xdr_destroy(&outxdr);
- errno = EIO;
return EAI_SYSTEM;
}
}
if (encode_kv(&outxdr, "numericserv", "1") != 0)
{
xdr_destroy(&outxdr);
- errno = EIO;
return EAI_SYSTEM;
}
}
if (encode_kv(&outxdr, "name_required", "1") != 0)
{
xdr_destroy(&outxdr);
- errno = EIO;
return EAI_SYSTEM;
}
}
*len = xdr_getpos(&outxdr);
xdr_destroy(&outxdr);
-
+
return 0;
}
return i;
}
}
-
+
wanth = 0;
if ((host != NULL) && (hostlen != 0)) wanth = 1;
*/
server_port = MACH_PORT_NULL;
if (_lu_running()) server_port = _lookupd_port(0);
- if (server_port == MACH_PORT_NULL)
- {
- errno = ECONNREFUSED;
- return EAI_SYSTEM;
- }
+ if (server_port == MACH_PORT_NULL) return EAI_SYSTEM;
if (gni_proc < 0)
{
status = _lookup_link(server_port, "getnameinfo", &gni_proc);
- if (status != KERN_SUCCESS)
- {
- errno = ECONNREFUSED;
- return EAI_SYSTEM;
- }
+ if (status != KERN_SUCCESS) return EAI_SYSTEM;
}
qlen = LU_QBUF_SIZE;
if (!xdr_int(&inxdr, (int32_t *)&n))
{
xdr_destroy(&inxdr);
- errno = EIO;
return EAI_SYSTEM;
}
server_port = MACH_PORT_NULL;
if (_lu_running()) server_port = _lookupd_port(0);
- if (server_port == MACH_PORT_NULL)
- {
- errno = ECONNREFUSED;
- return EAI_SYSTEM;
- }
+ if (server_port == MACH_PORT_NULL) return EAI_SYSTEM;
if (gni_proc < 0)
{
status = _lookup_link(server_port, "getnameinfo", &gni_proc);
- if (status != KERN_SUCCESS)
- {
- errno = ECONNREFUSED;
- return EAI_SYSTEM;
- }
+ if (status != KERN_SUCCESS) return EAI_SYSTEM;
}
qlen = LU_QBUF_SIZE;
qlen /= BYTES_PER_XDR_UNIT;
- status = lu_async_start(p, gni_proc, qbuf, qlen, (void *)callback, context);
- if (status != 0)
- {
- errno = ECONNREFUSED;
- return EAI_SYSTEM;
- }
-
- return 0;
+ return lu_async_start(p, gni_proc, qbuf, qlen, (void *)callback, context);
}
int32_t
if (!xdr_int(&xdr, (int32_t *)&n))
{
xdr_destroy(&xdr);
- errno = EIO;
return EAI_SYSTEM;
}
tdata = (struct lu_thread_info *)calloc(1, sizeof(struct lu_thread_info));
_lu_data_set_key(_lu_data_key_alias, tdata);
}
-
+\r
if (tdata->lu_vm == NULL)
{
if (proc < 0)
tdata = (struct lu_thread_info *)calloc(1, sizeof(struct lu_thread_info));
_lu_data_set_key(_lu_data_key_bootparams, tdata);
}
-
+\r
if (tdata->lu_vm == NULL)
{
if (proc < 0)
struct lu_thread_info *tdata;
tdata = _lu_data_create_key(_lu_data_key_fstab, free_lu_thread_info_fstab);
- _lu_data_free_vm_xdr(tdata);
+ _lu_data_free_vm_xdr(tdata);\r
}
static int
tdata = (struct lu_thread_info *)calloc(1, sizeof(struct lu_thread_info));
_lu_data_set_key(_lu_data_key_fstab, tdata);
}
-
+\r
if (tdata->lu_vm == NULL)
{
if (proc < 0)
/*
- * Copyright (c) 1999-2007 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 1999-2002 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#define MEMBERD_NAME "com.apple.memberd"
static mach_port_t mbr_port = MACH_PORT_NULL;
typedef uint32_t GIDArray[16];
-extern kern_return_t _mbr_GetGroups(mach_port_t server, uint32_t uid, uint32_t *numGroups, GIDArray gids, security_token_t *token);
+extern kern_return_t _mbr_GetGroups(mach_port_t server, uint32_t uid, uint32_t *numGroups, GIDArray gids);
#define GR_GET_NAME 1
#define GR_GET_GID 2
if (x == NULL) return;
tdata = (struct lu_thread_info *)x;
-
+
if (tdata->lu_entry != NULL)
{
free_group((struct group *)tdata->lu_entry);
ap += hsize;
}
}
-
+
memset(bp, 0, sizeof(unsigned long));
bp = ap;
static int proc = -1;
int count;
char *lookup_buf;
-
+
if (proc < 0)
{
if (_lookup_link(_lu_port, "getgrgid", &proc) != KERN_SUCCESS)
int pwstatus;
GIDArray gids;
int status, maxgroups;
- security_token_t token;
status = 0;
if (pwstatus != 0) return status;
if (res == NULL) return status;
- token.val[0] = -1;
- token.val[1] = -1;
-
count = 0;
- kstatus = _mbr_GetGroups(mbr_port, p.pw_uid, &count, gids, &token);
+ kstatus = _mbr_GetGroups(mbr_port, p.pw_uid, &count, gids);
if (kstatus != KERN_SUCCESS) return status;
- if (token.val[0] != 0) return KERN_FAILURE;
for (i = 0; (i < count) && (status == 0); i++)
{
if (name == NULL) return status;
if (groups == NULL) return status;
if (grpcnt == NULL) return status;
-
+
maxgroups = *grpcnt;
*grpcnt = 0;
{
return mbr_getgrouplist(name, basegid, groups, grpcnt, dupbase);
}
-
+
if (_lu_running())
{
return lu_getgrouplist(name, basegid, groups, grpcnt, dupbase);
}
-
+
return _old_getgrouplist(name, basegid, groups, grpcnt);
}
tdata = (struct lu_thread_info *)calloc(1, sizeof(struct lu_thread_info));
_lu_data_set_key(_lu_data_key_group, tdata);
}
-
+
if (tdata->lu_vm == NULL)
{
if (proc < 0)
}
tdata->lu_vm_cursor--;
-
+
return g;
}
if (family == AF_INET)
{
memmove(&(addr4.s_addr), addr, IPV4_ADDR_LEN);
- addr4.s_addr = htonl(addr4.s_addr);
address = (char *)&(addr4.s_addr);
proc = proc4;
}
v4addr = malloc(len);
memmove(v4addr, addr, len);
- v4addr->s_addr = htonl(v4addr->s_addr);
address = (void *)v4addr;
proc = proc4;
struct lu_thread_info *tdata;
tdata = _lu_data_create_key(_lu_data_key_network, free_lu_thread_info_network);
- _lu_data_free_vm_xdr(tdata);
+ _lu_data_free_vm_xdr(tdata);\r
}
static void
tdata = (struct lu_thread_info *)calloc(1, sizeof(struct lu_thread_info));
_lu_data_set_key(_lu_data_key_network, tdata);
}
-
+\r
if (tdata->lu_vm == NULL)
{
if (proc < 0)
tdata = (struct lu_thread_info *)calloc(1, sizeof(struct lu_thread_info));
_lu_data_set_key(_lu_data_key_printer, tdata);
}
-
+\r
if (tdata->lu_vm == NULL)
{
if (proc < 0)
tdata = (struct lu_thread_info *)calloc(1, sizeof(struct lu_thread_info));
_lu_data_set_key(_lu_data_key_protocol, tdata);
}
-
+\r
if (tdata->lu_vm == NULL)
{
if (proc < 0)
tdata = (struct lu_thread_info *)calloc(1, sizeof(struct lu_thread_info));
_lu_data_set_key(_lu_data_key_rpc, tdata);
}
-
+\r
if (tdata->lu_vm == NULL)
{
if (proc < 0)
r->proc = proc;
r->request_buffer = malloc(len * BYTES_PER_XDR_UNIT);
+ if (r->request_buffer == NULL)
+ {
+ free(r);
+ return NULL;
+ }
+
memcpy(r->request_buffer, buf, len * BYTES_PER_XDR_UNIT);
r->request_buffer_len = len;
if (!xdr_int(inxdr, &nkeys)) return NULL;
l = (ni_proplist *)malloc(sizeof(ni_proplist));
+ if (l == NULL) return NULL;
+
NI_INIT(l);
l->ni_proplist_len = nkeys;
if (nkeys > 0)
{
l->ni_proplist_val = (ni_property *)calloc(nkeys, sizeof(ni_property));
+ if (l->ni_proplist_val == NULL)
+ {
+ free(l);
+ return NULL;
+ }
}
for (i = 0; i < nkeys; i++)
if (nvals > 0)
{
l->ni_proplist_val[i].nip_val.ni_namelist_val = (ni_name *)calloc(nvals, sizeof(ni_name));
+ if (l->ni_proplist_val[i].nip_val.ni_namelist_val == NULL)
+ {
+ ni_proplist_free(l);
+ return NULL;
+ }
}
for (j = 0; j < nvals; j++)
}
*out = (ni_proplist **)malloc(n * sizeof(ni_proplist *));
+ if (out == NULL)
+ {
+ xdr_destroy(&inxdr);
+ return 0;
+ }
for (i = 0; i < n; i++)
{
if (fmt[0] != 'k') return NULL;
l = (ni_proplist *)malloc(sizeof(ni_proplist));
+ if (l == NULL) return NULL;
+
NI_INIT(l);
na = 0;
if (cat != NULL)
{
l->ni_proplist_val = (ni_property *)malloc(sizeof(ni_property));
+ if (l->ni_proplist_val == NULL)
+ {
+ free(l);
+ return NULL;
+ }
+
p = &(l->ni_proplist_val[0]);
arg = "_lookup_category";
p->nip_name = strdup(arg);
+ if (p->nip_name == NULL)
+ {
+ ni_proplist_free(l);
+ return NULL;
+ }
+
p->nip_val.ni_namelist_len = 1;
p->nip_val.ni_namelist_val = (ni_name *)malloc(sizeof(ni_name));
+ if (p->nip_val.ni_namelist_val == NULL)
+ {
+ ni_proplist_free(l);
+ return NULL;
+ }
+
p->nip_val.ni_namelist_val[0] = strdup(cat);
-
+ if (p->nip_val.ni_namelist_val[0] == NULL)
+ {
+ ni_proplist_free(l);
+ return NULL;
+ }
+
l->ni_proplist_len++;
x++;
}
arg = va_arg(ap, char *);
if (*f == 'k')
{
- l->ni_proplist_val = (ni_property *)realloc(l->ni_proplist_val, (l->ni_proplist_len + 1) * sizeof(ni_property));
-
+ l->ni_proplist_val = (ni_property *)reallocf(l->ni_proplist_val, (l->ni_proplist_len + 1) * sizeof(ni_property));
+ if (l->ni_proplist_val == NULL)
+ {
+ ni_proplist_free(l);
+ return NULL;
+ }
+
p = &(l->ni_proplist_val[l->ni_proplist_len]);
p->nip_name = strdup(arg);
+ if (p->nip_name == NULL)
+ {
+ ni_proplist_free(l);
+ return NULL;
+ }
+
p->nip_val.ni_namelist_len = 0;
p->nip_val.ni_namelist_val = NULL;
}
else
{
- p->nip_val.ni_namelist_val = (ni_name *)realloc(p->nip_val.ni_namelist_val, (p->nip_val.ni_namelist_len + 1) * sizeof(ni_name));
+ p->nip_val.ni_namelist_val = (ni_name *)reallocf(p->nip_val.ni_namelist_val, (p->nip_val.ni_namelist_len + 1) * sizeof(ni_name));
+ }
+
+ if (p->nip_val.ni_namelist_val == NULL)
+ {
+ ni_proplist_free(l);
+ return NULL;
}
+
p->nip_val.ni_namelist_val[p->nip_val.ni_namelist_len] = strdup(arg);
+ if (p->nip_val.ni_namelist_val[p->nip_val.ni_namelist_len] == NULL)
+ {
+ ni_proplist_free(l);
+ return NULL;
+ }
+
p->nip_val.ni_namelist_len++;
}
}
if (addme == 1)
{
- a->nip_val.ni_namelist_val = (ni_name *)realloc(a->nip_val.ni_namelist_val, (a->nip_val.ni_namelist_len + 1) * sizeof(ni_name));
+ a->nip_val.ni_namelist_val = (ni_name *)reallocf(a->nip_val.ni_namelist_val, (a->nip_val.ni_namelist_len + 1) * sizeof(ni_name));
+ if (a->nip_val.ni_namelist_val == NULL) return;
+
a->nip_val.ni_namelist_val[a->nip_val.ni_namelist_len] = strdup(b->nip_val.ni_namelist_val[j]);
+ if (a->nip_val.ni_namelist_val[a->nip_val.ni_namelist_len] == NULL)
+ {
+ free(a->nip_val.ni_namelist_val);
+ a->nip_val.ni_namelist_val = NULL;
+ return;
+ }
+
a->nip_val.ni_namelist_len++;
}
}
}
if (addme == 1)
{
- a->ni_proplist_val = (ni_property *)realloc(a->ni_proplist_val, (a->ni_proplist_len + 1) * sizeof(ni_property));
+ a->ni_proplist_val = (ni_property *)reallocf(a->ni_proplist_val, (a->ni_proplist_len + 1) * sizeof(ni_property));
+ if (a->ni_proplist_val == NULL) return;
+
a->ni_proplist_val[a->ni_proplist_len].nip_name = strdup(b->ni_proplist_val[wb].nip_name);
+ if (a->ni_proplist_val[a->ni_proplist_len].nip_name == NULL)
+ {
+ free(a->ni_proplist_val);
+ a->ni_proplist_val = NULL;
+ return NULL;
+ }
+
a->ni_proplist_val[a->ni_proplist_len].nip_val.ni_namelist_len = 0;
a->ni_proplist_val[a->ni_proplist_len].nip_val.ni_namelist_val = NULL;
a->ni_proplist_len++;
if (libinfo_data != NULL) return libinfo_data;
libinfo_data = (struct _lu_data_s *)calloc(1, sizeof(struct _lu_data_s));
+ if (libinfo_data == NULL) return NULL;
pthread_setspecific(_info_key, libinfo_data);
return libinfo_data;
unsigned int i, n;
libinfo_data = _lu_data_get();
+ if (libinfo_data == NULL) return NULL;
for (i = 0; i < libinfo_data->icount; i++)
{
}
else
{
- libinfo_data->ikey = (unsigned int *)realloc(libinfo_data->ikey, n * sizeof(unsigned int));
- libinfo_data->idata = (void **)realloc(libinfo_data->idata, n * sizeof(void *));
- libinfo_data->idata_destructor = (void (**)(void *))realloc(libinfo_data->idata_destructor, n * sizeof(void (*)(void *)));
+ libinfo_data->ikey = (unsigned int *)reallocf(libinfo_data->ikey, n * sizeof(unsigned int));
+ libinfo_data->idata = (void **)reallocf(libinfo_data->idata, n * sizeof(void *));
+ libinfo_data->idata_destructor = (void (**)(void *))reallocf(libinfo_data->idata_destructor, n * sizeof(void (*)(void *)));
+ }
+
+ if ((libinfo_data->ikey == NULL) || (libinfo_data->idata == NULL) || (libinfo_data->idata_destructor == NULL))
+ {
+ if (libinfo_data->ikey != NULL) free(libinfo_data->ikey);
+ if (libinfo_data->idata != NULL) free(libinfo_data->idata);
+ if (libinfo_data->idata_destructor != NULL) free(libinfo_data->idata_destructor);
+ return NULL;
}
libinfo_data->ikey[i] = key;
unsigned int i;
libinfo_data = _lu_data_get();
+ if (libinfo_data == NULL) return;
i = _lu_data_index(key, libinfo_data);
if (i == (unsigned int)-1) return;
unsigned int i;
libinfo_data = _lu_data_get();
+ if (libinfo_data == NULL) return NULL;
i = _lu_data_index(key, libinfo_data);
if (i == (unsigned int)-1) return NULL;
*count = len;
x = (char **)calloc(len + 1, sizeof(char *));
+ if (x == NULL) return -1;
+
*val = x;
for (i = 0; i < len; i++)
Change History (most recent first):
$Log: dnssd_clientstub.c,v $
-Revision 1.20.68.3 2006/05/02 16:16:08 majka
+Revision 1.20.70.3 2006/05/02 16:17:04 majka
Make NumTries unsigned.
-Revision 1.20.68.2 2006/05/01 21:41:19 majka
-Additional change (make NumTries static) for 4374646.
-SUTiLondon Libinfo-222.3.3
+Revision 1.20.70.2 2006/05/01 21:43:09 majka
+Additional change (make NumTries static) for 4527193
+SUChardLondon Libinfo-222.4.6
-Revision 1.20.68.1 2006/05/01 16:22:28 majka
-Libinfo-222_3_2 is equivalent to SUTiLondon8J109 Libinfo-222.2
+Revision 1.20.70.1 2006/05/01 16:10:54 majka
+Libinfo-222_4_5 is equivalent to Chardonnay Libinfo-222.0.5
-Revision 1.20.64.1 2006/04/27 21:19:51 majka
-Bug #: 4374646
+Revision 1.20.60.1 2006/04/27 21:33:30 majka
+Integrated 4527193
Revision 1.20 2005/02/03 00:39:05 majka
Integrated 3942900
Revision 1.19.4.1 2005/02/02 00:47:40 ksekar
<rdar://problem/3942900> dnd-sd shows the wrong port numbers
+Revision 1.19 2004/12/23 23:10:59 majka
+*** empty log message ***
+
Revision 1.18.8.1 2004/12/23 17:32:56 ksekar
<rdar://problem/3931319> Rendevzous calls leak sockets if mDNSResponder is not running
uint32_t ptr64[2];
} client_context_t;
-typedef struct __attribute__((__packed__)) ipc_msg_hdr_struct
+typedef struct ipc_msg_hdr_struct
{
uint32_t version;
uint32_t datalen;
/*
- * Copyright (c) 2004-2007 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2004-2005 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
serverprefix Server;
#include <mach/std_types.defs>
-#include <mach/mach_types.defs>
import "memberd_defines.h";
-type kauth_identity_extlookup = struct [50] of integer_t;
-type guid_t = struct [4] of uint32_t;
+type kauth_identity_extlookup = struct [200] of uint8_t;
+type guid_t = struct [16] of uint8_t;
type StatBlock = struct [16] of uint32_t;
type string = c_string[*:256];
-routine _mbr_DoMembershipCall
-(
- server: mach_port_t;
- inout request: kauth_identity_extlookup;
- UserSecToken token : security_token_t
-);
+routine _mbr_DoMembershipCall(
+ server: mach_port_t;
+ inout request: kauth_identity_extlookup);
-routine _mbr_GetStats
-(
- server: mach_port_t;
- out stats: StatBlock;
- UserSecToken token : security_token_t
-);
+routine _mbr_GetStats(
+ server: mach_port_t;
+ out stats: StatBlock);
-routine _mbr_ClearStats
-(
- server: mach_port_t;
- UserSecToken token : security_token_t
-);
+routine _mbr_ClearStats( server: mach_port_t );
-routine _mbr_MapName
-(
- server: mach_port_t;
- in isUser: uint8_t;
- in name: string;
- out guid: guid_t;
- UserSecToken token : security_token_t
-);
+routine _mbr_MapName(
+ server: mach_port_t;
+ in isUser: uint8_t;
+ in name: string;
+ out guid: guid_t );
-routine _mbr_GetGroups
-(
- server: mach_port_t;
- in uid: uint32_t;
- out numGroups: uint32_t;
- out gids: GIDArray;
- UserSecToken token : security_token_t
-);
-
-routine _mbr_ClearCache
-(
- server: mach_port_t;
- UserSecToken token : security_token_t
-);
+routine _mbr_GetGroups(
+ server: mach_port_t;
+ in uid: uint32_t;
+ out numGroups: uint32_t;
+ out gids: GIDArray );
+
+routine _mbr_ClearCache( server: mach_port_t );
-routine _mbr_DumpState
-(
- server: mach_port_t;
- in logOnly: uint8_t;
- UserSecToken token : security_token_t
-);
+routine _mbr_DumpState(
+ server: mach_port_t;
+ in logOnly: uint8_t );
/*
- * Copyright (c) 2004-2007 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#include <servers/bootstrap.h>
#include <mach/mach.h>
#include <stdlib.h>
-#include <libkern/OSByteOrder.h>
+#import <libkern/OSByteOrder.h>
static mach_port_t GetServerPort()
{
kern_return_t result;
- static mach_port_t bsPort = 0;
- static mach_port_t fServerPort = 0;
-
+ static mach_port_t bsPort = 0;
+ static mach_port_t fServerPort = 0;
+
if (bsPort == 0)
{
- result = task_get_bootstrap_port(mach_task_self(), &bsPort);
- result = bootstrap_look_up(bsPort, "com.apple.memberd", &fServerPort);
+ result = task_get_bootstrap_port( mach_task_self(), &bsPort );
+ result = bootstrap_look_up( bsPort, "com.apple.memberd", &fServerPort );
+
+// if the port lookup failed, the rpc will fail and we will return EIO
+// if (result != MACH_MSG_SUCCESS)
+// {
+// printf("Got error %d on lookup (is memberd running?)\n", result);
+// }
}
return fServerPort;
int mbr_uid_to_uuid(uid_t id, uuid_t uu)
{
struct kauth_identity_extlookup request;
- security_token_t token;
int result = 0;
- token.val[0] = -1;
- token.val[1] = -1;
-
+ request.el_seqno = 1; // used as byte order field
request.el_flags = KAUTH_EXTLOOKUP_VALID_UID | KAUTH_EXTLOOKUP_WANT_UGUID;
request.el_uid = id;
- result = _mbr_DoMembershipCall(GetServerPort(), &request, &token);
- if (result != KERN_SUCCESS) return EIO;
- if (token.val[0] != 0) return EAUTH;
-
+ result = _mbr_DoMembershipCall(GetServerPort(), &request);
+ if (result != KERN_SUCCESS)
+ return EIO;
+
if ((request.el_flags & KAUTH_EXTLOOKUP_VALID_UGUID) != 0)
memcpy(uu, &request.el_uguid, sizeof(guid_t));
else
int mbr_gid_to_uuid(gid_t id, uuid_t uu)
{
struct kauth_identity_extlookup request;
- security_token_t token;
kern_return_t result;
int error = 0;
- token.val[0] = -1;
- token.val[1] = -1;
-
+ request.el_seqno = 1; // used as byte order field
request.el_flags = KAUTH_EXTLOOKUP_VALID_GID | KAUTH_EXTLOOKUP_WANT_GGUID;
request.el_gid = id;
- result = _mbr_DoMembershipCall(GetServerPort(), &request, &token);
- if (result != KERN_SUCCESS) return EIO;
- if (token.val[0] != 0) return EAUTH;
-
+ result = _mbr_DoMembershipCall(GetServerPort(), &request);
+ if (result != KERN_SUCCESS)
+ return EIO;
+
if ((request.el_flags & KAUTH_EXTLOOKUP_VALID_GGUID) != 0)
memcpy(uu, &request.el_gguid, sizeof(guid_t));
else
error = ENOENT;
-
+
return error;
}
-int mbr_uuid_to_id(const uuid_t uu, uid_t *id, int *id_type)
+int mbr_uuid_to_id( const uuid_t uu, uid_t* id, int* id_type)
{
struct kauth_identity_extlookup request;
- security_token_t token;
kern_return_t result;
int error = 0;
- token.val[0] = -1;
- token.val[1] = -1;
-
- request.el_flags = KAUTH_EXTLOOKUP_VALID_UGUID | KAUTH_EXTLOOKUP_VALID_GGUID | KAUTH_EXTLOOKUP_WANT_UID | KAUTH_EXTLOOKUP_WANT_GID;
+ request.el_seqno = 1; // used as byte order field
+ request.el_flags = KAUTH_EXTLOOKUP_VALID_UGUID | KAUTH_EXTLOOKUP_VALID_GGUID |
+ KAUTH_EXTLOOKUP_WANT_UID | KAUTH_EXTLOOKUP_WANT_GID;
memcpy(&request.el_uguid, uu, sizeof(guid_t));
memcpy(&request.el_gguid, uu, sizeof(guid_t));
- result = _mbr_DoMembershipCall(GetServerPort(), &request, &token);
- if (result != KERN_SUCCESS) return EIO;
- if (token.val[0] != 0) return EAUTH;
-
+ result = _mbr_DoMembershipCall(GetServerPort(), &request);
+ if (result != KERN_SUCCESS)
+ return EIO;
+
if ((request.el_flags & KAUTH_EXTLOOKUP_VALID_UID) != 0)
{
*id = request.el_uid;
*id_type = ID_TYPE_GID;
}
else
- {
error = ENOENT;
- }
-
+
return error;
}
-int mbr_sid_to_uuid(const nt_sid_t *sid, uuid_t uu)
+int mbr_sid_to_uuid(const nt_sid_t* sid, uuid_t uu)
{
struct kauth_identity_extlookup request;
- security_token_t token;
kern_return_t result;
int error = 0;
- token.val[0] = -1;
- token.val[1] = -1;
-
+ request.el_seqno = 1; // used as byte order field
request.el_flags = KAUTH_EXTLOOKUP_VALID_GSID | KAUTH_EXTLOOKUP_WANT_GGUID;
memset(&request.el_gsid, 0, sizeof(ntsid_t));
memcpy(&request.el_gsid, sid, KAUTH_NTSID_SIZE(sid));
- result = _mbr_DoMembershipCall(GetServerPort(), &request, &token);
- if (result != KERN_SUCCESS) return EIO;
- if (token.val[0] != 0) return EAUTH;
-
+ result = _mbr_DoMembershipCall(GetServerPort(), &request);
+ if (result != KERN_SUCCESS)
+ return EIO;
+
if ((request.el_flags & KAUTH_EXTLOOKUP_VALID_GGUID) != 0)
memcpy(uu, &request.el_gguid, sizeof(guid_t));
else
error = ENOENT;
-
+
return error;
}
-int mbr_uuid_to_sid(const uuid_t uu, nt_sid_t *sid)
+int mbr_uuid_to_sid(const uuid_t uu, nt_sid_t* sid)
{
struct kauth_identity_extlookup request;
- security_token_t token;
kern_return_t result;
int error = 0;
- token.val[0] = -1;
- token.val[1] = -1;
-
+ request.el_seqno = 1; // used as byte order field
request.el_flags = KAUTH_EXTLOOKUP_VALID_GGUID | KAUTH_EXTLOOKUP_WANT_GSID;
memcpy(&request.el_gguid, uu, sizeof(guid_t));
- result = _mbr_DoMembershipCall(GetServerPort(), &request, &token);
- if (result != KERN_SUCCESS) return EIO;
- if (token.val[0] != 0) return EAUTH;
-
+ result = _mbr_DoMembershipCall(GetServerPort(), &request);
+ if (result != KERN_SUCCESS)
+ return EIO;
+
if ((request.el_flags & KAUTH_EXTLOOKUP_VALID_GSID) != 0)
memcpy(sid, &request.el_gsid, sizeof(nt_sid_t));
else
error = ENOENT;
-
+
return error;
}
-int mbr_check_membership(uuid_t user, uuid_t group, int *ismember)
+int mbr_check_membership(uuid_t user, uuid_t group, int* ismember)
{
struct kauth_identity_extlookup request;
- security_token_t token;
kern_return_t result;
int error = 0;
- token.val[0] = -1;
- token.val[1] = -1;
-
- request.el_flags = KAUTH_EXTLOOKUP_VALID_UGUID | KAUTH_EXTLOOKUP_VALID_GGUID | KAUTH_EXTLOOKUP_WANT_MEMBERSHIP;
+ request.el_seqno = 1; // used as byte order field
+ request.el_flags = KAUTH_EXTLOOKUP_VALID_UGUID | KAUTH_EXTLOOKUP_VALID_GGUID |
+ KAUTH_EXTLOOKUP_WANT_MEMBERSHIP;
memcpy(&request.el_uguid, user, sizeof(guid_t));
memcpy(&request.el_gguid, group, sizeof(guid_t));
- result = _mbr_DoMembershipCall(GetServerPort(), &request, &token);
- if (result != KERN_SUCCESS) return EIO;
- if (token.val[0] != 0) return EAUTH;
-
+ result = _mbr_DoMembershipCall(GetServerPort(), &request);
+ if (result != KERN_SUCCESS)
+ return EIO;
+
if ((request.el_flags & KAUTH_EXTLOOKUP_VALID_MEMBERSHIP) != 0)
+ {
*ismember = ((request.el_flags & KAUTH_EXTLOOKUP_ISMEMBER) != 0);
+ }
else
error = ENOENT;
-
+
return error;
}
-int mbr_check_membership_refresh(uuid_t user, uuid_t group, int *ismember)
+int mbr_check_membership_refresh(uuid_t user, uuid_t group, int* ismember)
{
struct kauth_identity_extlookup request;
- security_token_t token;
kern_return_t result;
int error = 0;
- token.val[0] = -1;
- token.val[1] = -1;
-
- request.el_flags = KAUTH_EXTLOOKUP_VALID_UGUID | KAUTH_EXTLOOKUP_VALID_GGUID | KAUTH_EXTLOOKUP_WANT_MEMBERSHIP | (1 << 15);
+ request.el_seqno = 1; // used as byte order field
+ request.el_flags = KAUTH_EXTLOOKUP_VALID_UGUID | KAUTH_EXTLOOKUP_VALID_GGUID |
+ KAUTH_EXTLOOKUP_WANT_MEMBERSHIP | (1<<15);
memcpy(&request.el_uguid, user, sizeof(guid_t));
memcpy(&request.el_gguid, group, sizeof(guid_t));
- result = _mbr_DoMembershipCall(GetServerPort(), &request, &token);
- if (result != KERN_SUCCESS) return EIO;
- if (token.val[0] != 0) return EAUTH;
-
+ result = _mbr_DoMembershipCall(GetServerPort(), &request);
+ if (result != KERN_SUCCESS)
+ return EIO;
+
if ((request.el_flags & KAUTH_EXTLOOKUP_VALID_MEMBERSHIP) != 0)
+ {
*ismember = ((request.el_flags & KAUTH_EXTLOOKUP_ISMEMBER) != 0);
+ }
else
error = ENOENT;
-
+
return error;
}
-int mbr_check_membership_by_id(uuid_t user, gid_t group, int *ismember)
+int mbr_check_membership_by_id(uuid_t user, gid_t group, int* ismember)
{
struct kauth_identity_extlookup request;
- security_token_t token;
kern_return_t result;
int error = 0;
- token.val[0] = -1;
- token.val[1] = -1;
-
- request.el_flags = KAUTH_EXTLOOKUP_VALID_UGUID | KAUTH_EXTLOOKUP_VALID_GID | KAUTH_EXTLOOKUP_WANT_MEMBERSHIP;
+ request.el_seqno = 1; // used as byte order field
+ request.el_flags = KAUTH_EXTLOOKUP_VALID_UGUID | KAUTH_EXTLOOKUP_VALID_GID |
+ KAUTH_EXTLOOKUP_WANT_MEMBERSHIP;
memcpy(&request.el_uguid, user, sizeof(guid_t));
request.el_gid = group;
- result = _mbr_DoMembershipCall(GetServerPort(), &request, &token);
- if (result != KERN_SUCCESS) return EIO;
- if (token.val[0] != 0) return EAUTH;
-
+ result = _mbr_DoMembershipCall(GetServerPort(), &request);
+ if (result != KERN_SUCCESS)
+ return EIO;
+
if ((request.el_flags & KAUTH_EXTLOOKUP_VALID_MEMBERSHIP) != 0)
+ {
*ismember = ((request.el_flags & KAUTH_EXTLOOKUP_ISMEMBER) != 0);
+ }
else
error = ENOENT;
-
+
return error;
}
int mbr_reset_cache()
{
- security_token_t token;
kern_return_t result;
-
- token.val[0] = -1;
- token.val[1] = -1;
-
- result = _mbr_ClearCache(GetServerPort(), &token);
- if (result != KERN_SUCCESS) return EIO;
- if (token.val[0] != 0) return EAUTH;
-
+ result = _mbr_ClearCache(GetServerPort());
+ if (result != KERN_SUCCESS)
+ return EIO;
return 0;
}
-int mbr_user_name_to_uuid(const char *name, uuid_t uu)
+int mbr_user_name_to_uuid(const char* name, uuid_t uu)
{
- security_token_t token;
kern_return_t result;
-
- if (name == NULL) return EINVAL;
- if (strlen(name) > 255) return EINVAL;
-
- token.val[0] = -1;
- token.val[1] = -1;
-
- result = _mbr_MapName(GetServerPort(), 1, (char *)name, (guid_t *)uu, &token);
- if (result == KERN_FAILURE) return ENOENT;
- else if (result != KERN_SUCCESS) return EIO;
-
- if (token.val[0] != 0) return EAUTH;
-
+
+ if (strlen(name) > 255)
+ return EINVAL;
+
+ result = _mbr_MapName(GetServerPort(), 1, (char*)name, (guid_t*)uu);
+
+ if (result == KERN_FAILURE)
+ return ENOENT;
+ else if (result != KERN_SUCCESS)
+ return EIO;
+
return 0;
}
-int mbr_group_name_to_uuid(const char *name, uuid_t uu)
+int mbr_group_name_to_uuid(const char* name, uuid_t uu)
{
- security_token_t token;
kern_return_t result;
-
- if (name == NULL) return EINVAL;
- if (strlen(name) > 255) return EINVAL;
-
- token.val[0] = -1;
- token.val[1] = -1;
-
- result = _mbr_MapName(GetServerPort(), 0, (char *)name, (guid_t *)uu, &token);
- if (result == KERN_FAILURE) return ENOENT;
- else if (result != KERN_SUCCESS) return EIO;
-
- if (token.val[0] != 0) return EAUTH;
-
+
+ if (strlen(name) > 255)
+ return EINVAL;
+
+ result = _mbr_MapName(GetServerPort(), 0, (char*)name, (guid_t*)uu);
+
+ if (result == KERN_FAILURE)
+ return ENOENT;
+ else if (result != KERN_SUCCESS)
+ return EIO;
+
return 0;
}
-int mbr_check_service_membership(const uuid_t user, const char *servicename, int *ismember)
+int mbr_check_service_membership(const uuid_t user, const char* servicename, int* ismember)
{
- char *prefix = "com.apple.access_";
- char *all_services = "com.apple.access_all_services";
+ char* prefix = "com.apple.access_";
+ char* all_services = "com.apple.access_all_services";
char groupName[256];
uuid_t group_uu;
int result, dummy;
-
- if (servicename == NULL) return EINVAL;
- if (strlen(servicename) > (255 - strlen(prefix))) return EINVAL;
-
- /* start by checking "all services" */
+
+ if (strlen(servicename) > 255 - strlen(prefix))
+ return EINVAL;
+
+ // start by checking "all services"
result = mbr_group_name_to_uuid(all_services, group_uu);
-
- if (result == EAUTH) return result;
-
+
if (result == ENOENT)
{
- /* all_services group didn't exist, check individual group */
+ // all_services group didn't exist, check individual group
memcpy(groupName, prefix, strlen(prefix));
strcpy(groupName + strlen(prefix), servicename);
result = mbr_group_name_to_uuid(groupName, group_uu);
}
-
+
if (result == 0)
- {
result = mbr_check_membership_refresh(user, group_uu, ismember);
- }
- else if (result == EAUTH)
- {
- return result;
- }
else
{
- /* just force cache update with bogus membership check */
+ // just force cache update with bogus membership check
memset(group_uu, 0, sizeof(group_uu));
mbr_check_membership_refresh(user, group_uu, &dummy);
}
-
+
return result;
}
-static char *ConvertBytesToDecimal(char *buffer, unsigned long long value)
+static char* ConvertBytesToDecimal(char* buffer, unsigned long long value)
{
- char *temp;
+ char* temp;
buffer[24] = '\0';
buffer[23] = '0';
-
- if (value == 0) return &buffer[23];
-
+
+ if (value == 0)
+ return &buffer[23];
+
temp = &buffer[24];
while (value != 0)
{
*temp = '0' + (value % 10);
value /= 10;
}
-
+
return temp;
}
-int mbr_sid_to_string(const nt_sid_t *sid, char *string)
+int mbr_sid_to_string(const nt_sid_t* sid, char* string)
{
- char *current = string;
+ char* current = string;
long long temp = 0;
int i;
char tempBuffer[25];
-
- if (sid->sid_authcount > NTSID_MAX_AUTHORITIES) return EINVAL;
-
+
+ if (sid->sid_authcount > NTSID_MAX_AUTHORITIES)
+ return EINVAL;
+
for (i = 0; i < 6; i++)
temp = (temp << 8) | sid->sid_authority[i];
-
+
current[0] = 'S';
current[1] = '-';
current += 2;
*current = '-';
current++;
strcpy(current, ConvertBytesToDecimal(tempBuffer, temp));
-
- for (i = 0; i < sid->sid_authcount; i++)
+
+ for(i=0; i < sid->sid_authcount; i++)
{
current = current + strlen(current);
*current = '-';
current++;
strcpy(current, ConvertBytesToDecimal(tempBuffer, sid->sid_authorities[i]));
}
-
+
return 0;
}
-int mbr_string_to_sid(const char *string, nt_sid_t *sid)
+int mbr_string_to_sid(const char* string, nt_sid_t* sid)
{
- char *current = string+2;
+ char* current = string+2;
int count = 0;
long long temp;
memset(sid, 0, sizeof(nt_sid_t));
- if ((string[0] != 'S') || (string[1] != '-')) return EINVAL;
-
+ if (string[0] != 'S' || string[1] != '-') return EINVAL;
+
sid->sid_kind = strtol(current, ¤t, 10);
if (*current == '\0') return EINVAL;
current++;
temp = strtoll(current, ¤t, 10);
-
- /* convert to BigEndian before copying */
+ // convert to BigEndian before copying
temp = OSSwapHostToBigInt64(temp);
memcpy(sid->sid_authority, ((char*)&temp)+2, 6);
- while ((*current != '\0') && (count < NTSID_MAX_AUTHORITIES))
+ while (*current != '\0' && count < NTSID_MAX_AUTHORITIES)
{
current++;
sid->sid_authorities[count] = strtol(current, ¤t, 10);
count++;
}
-
- if (*current != '\0') return EINVAL;
-
+
+ if (*current != '\0')
+ return EINVAL;
+
sid->sid_authcount = count;
-
+
return 0;
}
-static void ConvertBytesToHex(char **string, char **data, int numBytes)
+static void ConvertBytesToHex(char** string, char** data, int numBytes)
{
int i;
-
- for (i = 0; i < numBytes; i++)
+
+ for (i=0; i < numBytes; i++)
{
unsigned char hi = ((**data) >> 4) & 0xf;
unsigned char low = (**data) & 0xf;
**string = '0' + hi;
else
**string = 'A' + hi - 10;
-
+
(*string)++;
if (low < 10)
}
}
-int mbr_uuid_to_string(const uuid_t uu, char *string)
+int mbr_uuid_to_string(const uuid_t uu, char* string)
{
- char *guid = (char *)uu;
- char *strPtr = string;
+ char* guid = (char*)uu;
+ char* strPtr = string;
ConvertBytesToHex(&strPtr, &guid, 4);
*strPtr = '-'; strPtr++;
ConvertBytesToHex(&strPtr, &guid, 2);
*strPtr = '-'; strPtr++;
ConvertBytesToHex(&strPtr, &guid, 6);
*strPtr = '\0';
-
+
return 0;
}
-int mbr_string_to_uuid(const char *string, uuid_t uu)
+int mbr_string_to_uuid(const char* string, uuid_t uu)
{
short dataIndex = 0;
int isFirstNibble = 1;
-
+
if (strlen(string) > MBR_UU_STRING_SIZE)
return EINVAL;
-
+
while (*string != '\0' && dataIndex < 16)
{
char nibble;
-
- if ((*string >= '0') && (*string <= '9'))
- {
+
+ if (*string >= '0' && *string <= '9')
nibble = *string - '0';
- }
- else if ((*string >= 'A') && (*string <= 'F'))
- {
+ else if (*string >= 'A' && *string <= 'F')
nibble = *string - 'A' + 10;
- }
- else if ((*string >= 'a') && (*string <= 'f'))
- {
+ else if (*string >= 'a' && *string <= 'f')
nibble = *string - 'a' + 10;
- }
else
{
- if (*string != '-') return EINVAL;
+ if (*string != '-')
+ return EINVAL;
string++;
continue;
}
-
+
if (isFirstNibble)
{
uu[dataIndex] = nibble << 4;
dataIndex++;
isFirstNibble = 1;
}
-
+
string++;
}
-
- if (dataIndex != 16) return EINVAL;
-
+
+ if (dataIndex != 16)
+ return EINVAL;
+
return 0;
}
+
static struct rpcent *
interpret(val, len)
char *val;
- u_int len;
+ int len;
{
register struct rpcdata *d = _rpcdata();
char *p;
char area_machname[MAX_MACHINE_NAME+1];
int area_gids[NGROUPS];
} *area;
- u_int auth_len, str_len, gid_len;
+ u_int auth_len;
+ int str_len, gid_len;
register int i;
area = (struct area *) rqst->rq_clntcred;
stat = AUTH_BADCRED;
goto done;
}
- bcopy((caddr_t)buf, aup->aup_machname, str_len);
+ bcopy((caddr_t)buf, aup->aup_machname, (u_int)str_len);
aup->aup_machname[str_len] = 0;
str_len = RNDUP(str_len);
buf += str_len / sizeof (long);
* timestamp, hostname len (0), uid, gid, and gids len (0).
*/
if ((5 + gid_len) * BYTES_PER_XDR_UNIT + str_len > auth_len) {
- /* LIBRARY CODE SHOULD NOT PRINT
- (void) printf("bad auth_len gid %d str %d auth %d\n", gid_len, str_len, auth_len);
- */
+ (void) printf("bad auth_len gid %d str %d auth %d\n",
+ gid_len, str_len, auth_len);
stat = AUTH_BADCRED;
goto done;
}