aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/os/access.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-05-15 16:28:11 +0000
committermarha <marha@users.sourceforge.net>2010-05-15 16:28:11 +0000
commitc38dead3ea7e177728d90cd815cf4eead0c9f534 (patch)
treeb809dba1dc9013bb1e67a5ee388f2dd217dc0f88 /xorg-server/os/access.c
parent6083a94d68878c9ad5f59b28bd07e4738e9fb7b4 (diff)
downloadvcxsrv-c38dead3ea7e177728d90cd815cf4eead0c9f534.tar.gz
vcxsrv-c38dead3ea7e177728d90cd815cf4eead0c9f534.tar.bz2
vcxsrv-c38dead3ea7e177728d90cd815cf4eead0c9f534.zip
xserver git update 15/5/2010
Diffstat (limited to 'xorg-server/os/access.c')
-rw-r--r--xorg-server/os/access.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/xorg-server/os/access.c b/xorg-server/os/access.c
index 603210f85..2a0ea01cd 100644
--- a/xorg-server/os/access.c
+++ b/xorg-server/os/access.c
@@ -238,12 +238,12 @@ typedef struct _host {
int requested;
} HOST;
-#define MakeHost(h,l) (h)=xalloc(sizeof *(h)+(l));\
+#define MakeHost(h,l) (h)=malloc(sizeof *(h)+(l));\
if (h) { \
(h)->addr=(unsigned char *) ((h) + 1);\
(h)->requested = FALSE; \
}
-#define FreeHost(h) xfree(h)
+#define FreeHost(h) free(h)
static HOST *selfhosts = NULL;
static HOST *validhosts = NULL;
static int AccessEnabled = DEFAULT_ACCESS_CONTROL;
@@ -587,7 +587,7 @@ DefineSelf (int fd)
Error ("Getting interface count");
if (len < (ifn.lifn_count * sizeof(struct lifreq))) {
len = ifn.lifn_count * sizeof(struct lifreq);
- bufptr = xalloc(len);
+ bufptr = malloc(len);
}
#endif
@@ -765,7 +765,8 @@ DefineSelf (int fd)
continue;
#endif /* DNETCONN */
len = sizeof(*(ifr->ifa_addr));
- family = ConvertAddr(ifr->ifa_addr, &len, (pointer *)&addr);
+ family = ConvertAddr((struct sockaddr *) ifr->ifa_addr, &len,
+ (pointer *)&addr);
if (family == -1 || family == FamilyLocal)
continue;
#if defined(IPv6) && defined(AF_INET6)
@@ -789,7 +790,6 @@ DefineSelf (int fd)
}
#ifdef XDMCP
{
- struct sockaddr broad_addr;
/*
* If this isn't an Internet Address, don't register it.
*/
@@ -835,11 +835,10 @@ DefineSelf (int fd)
if ((ifr->ifa_flags & IFF_BROADCAST) &&
(ifr->ifa_flags & IFF_UP) &&
ifr->ifa_broadaddr)
- broad_addr = *ifr->ifa_broadaddr;
+ XdmcpRegisterBroadcastAddress(
+ (struct sockaddr_in *) ifr->ifa_broadaddr);
else
continue;
- XdmcpRegisterBroadcastAddress((struct sockaddr_in *)
- &broad_addr);
}
#endif /* XDMCP */
@@ -1131,12 +1130,12 @@ Bool LocalClient(ClientPtr client)
&alen, (pointer *)&addr);
if (family == -1)
{
- xfree (from);
+ free(from);
return FALSE;
}
if (family == FamilyLocal)
{
- xfree (from);
+ free(from);
return TRUE;
}
for (host = selfhosts; host; host = host->next)
@@ -1144,7 +1143,7 @@ Bool LocalClient(ClientPtr client)
if (addrEqual (family, addr, alen, host))
return TRUE;
}
- xfree (from);
+ free(from);
}
return FALSE;
}
@@ -1214,7 +1213,7 @@ GetLocalClientCreds(ClientPtr client, LocalClientCredRec **lccp)
}
#endif
- *lccp = Xcalloc(sizeof(LocalClientCredRec));
+ *lccp = calloc(1, sizeof(LocalClientCredRec));
if (*lccp == NULL)
return -1;
lcc = *lccp;
@@ -1250,7 +1249,7 @@ GetLocalClientCreds(ClientPtr client, LocalClientCredRec **lccp)
#endif
lcc->nSuppGids = ucred_getgroups(peercred, &gids);
if (lcc->nSuppGids > 0) {
- lcc->pSuppGids = Xcalloc((lcc->nSuppGids) * sizeof(int));
+ lcc->pSuppGids = calloc(lcc->nSuppGids, sizeof(int));
if (lcc->pSuppGids == NULL) {
lcc->nSuppGids = 0;
} else {
@@ -1287,9 +1286,9 @@ FreeLocalClientCreds(LocalClientCredRec *lcc)
{
if (lcc != NULL) {
if (lcc->nSuppGids > 0) {
- Xfree(lcc->pSuppGids);
+ free(lcc->pSuppGids);
}
- Xfree(lcc);
+ free(lcc);
}
}
@@ -1484,7 +1483,7 @@ GetHosts (
}
if (n)
{
- *data = ptr = xalloc (n);
+ *data = ptr = malloc(n);
if (!ptr)
{
return(BadAlloc);
@@ -1743,7 +1742,7 @@ siTypeAdd(const char *typeName, siAddrMatchFunc addrMatch,
}
}
- s = xalloc(sizeof(struct siType));
+ s = malloc(sizeof(struct siType));
if (s == NULL)
return BadAlloc;
@@ -2085,7 +2084,7 @@ static Bool
siLocalCredGetId(const char *addr, int len, siLocalCredPrivPtr lcPriv, int *id)
{
Bool parsedOK = FALSE;
- char *addrbuf = xalloc(len + 1);
+ char *addrbuf = malloc(len + 1);
if (addrbuf == NULL) {
return FALSE;
@@ -2119,7 +2118,7 @@ siLocalCredGetId(const char *addr, int len, siLocalCredPrivPtr lcPriv, int *id)
}
}
- xfree(addrbuf);
+ free(addrbuf);
return parsedOK;
}