summaryrefslogtreecommitdiff
path: root/dix/dixfonts.c
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2007-08-15 14:14:45 -0400
committerEamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil>2007-08-16 10:33:58 -0400
commit568ae737d1d5d476a0bf85659d88910c4e0ef5e0 (patch)
tree9d90a248b139d469ba6decf302f994bc4bd10a70 /dix/dixfonts.c
parent3c9553ac2cac7f3a41966def44a50d722d7e645b (diff)
xace: add hooks + new access codes: core protocol server requests
Diffstat (limited to 'dix/dixfonts.c')
-rw-r--r--dix/dixfonts.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/dix/dixfonts.c b/dix/dixfonts.c
index c21b3ecb3..4ea630210 100644
--- a/dix/dixfonts.c
+++ b/dix/dixfonts.c
@@ -65,6 +65,7 @@ Equipment Corporation.
#include "dixfontstr.h"
#include "closestr.h"
#include "dixfont.h"
+#include "xace.h"
#ifdef DEBUG
#include <stdio.h>
@@ -833,6 +834,10 @@ ListFonts(ClientPtr client, unsigned char *pattern, unsigned length,
if (length > XLFDMAXFONTNAMELEN)
return BadAlloc;
+ i = XaceHook(XACE_SERVER_ACCESS, client, DixGetAttrAccess);
+ if (i != Success)
+ return i;
+
if (!(c = (LFclosurePtr) xalloc(sizeof *c)))
return BadAlloc;
c->fpe_list = (FontPathElementPtr *)
@@ -1105,6 +1110,10 @@ StartListFontsWithInfo(ClientPtr client, int length, unsigned char *pattern,
if (length > XLFDMAXFONTNAMELEN)
return BadAlloc;
+ i = XaceHook(XACE_SERVER_ACCESS, client, DixGetAttrAccess);
+ if (i != Success)
+ return i;
+
if (!(c = (LFWIclosurePtr) xalloc(sizeof *c)))
goto badAlloc;
c->fpe_list = (FontPathElementPtr *)
@@ -1771,7 +1780,9 @@ bail:
int
SetFontPath(ClientPtr client, int npaths, unsigned char *paths, int *error)
{
- int err = Success;
+ int err = XaceHook(XACE_SERVER_ACCESS, client, DixManageAccess);
+ if (err != Success)
+ return err;
if (npaths == 0) {
if (SetDefaultFontPath(defaultFontPath) != Success)
@@ -1823,14 +1834,18 @@ SetDefaultFontPath(char *path)
return err;
}
-unsigned char *
-GetFontPath(int *count, int *length)
+int
+GetFontPath(ClientPtr client, int *count, int *length, unsigned char **result)
{
int i;
unsigned char *c;
int len;
FontPathElementPtr fpe;
+ i = XaceHook(XACE_SERVER_ACCESS, client, DixGetAttrAccess);
+ if (i != Success)
+ return i;
+
len = 0;
for (i = 0; i < num_fpes; i++) {
fpe = font_path_elements[i];
@@ -1838,7 +1853,7 @@ GetFontPath(int *count, int *length)
}
font_path_string = (unsigned char *) xrealloc(font_path_string, len);
if (!font_path_string)
- return NULL;
+ return BadAlloc;
c = font_path_string;
*length = 0;
@@ -1850,7 +1865,8 @@ GetFontPath(int *count, int *length)
c += fpe->name_length;
}
*count = num_fpes;
- return font_path_string;
+ *result = font_path_string;
+ return Success;
}
_X_EXPORT int