diff options
author | Alan Coopersmith <alan.coopersmith@sun.com> | 2008-11-19 13:44:26 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@sun.com> | 2008-11-20 14:02:11 -0800 |
commit | 1cd894173ee7fa3d1a78d330c12453ea53e7b908 (patch) | |
tree | a1a5cd80bf320dd910295a780b84f3dda4b0ac6f /xkb | |
parent | 1e4412abc499b9938bbac8a3ecd82f7f12d448d9 (diff) |
Always use server-<display>.xkm to avoid races when multiple servers start
Previously each server starting ran xkbcomp with the output set to
<keymapname>.xkm, read it, then deleted it - which led to races if
two servers were starting at the same time with the same keymap.
Sun bug #6773816 Xorg uses the same xkm output file for compiled keymap file
<http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6773816>
Diffstat (limited to 'xkb')
-rw-r--r-- | xkb/ddxLoad.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c index fc49d998b..80da96317 100644 --- a/xkb/ddxLoad.c +++ b/xkb/ddxLoad.c @@ -192,16 +192,8 @@ char *buf = NULL, keymap[PATH_MAX],xkm_output_dir[PATH_MAX]; #ifdef WIN32 char tmpname[PATH_MAX]; #endif - if ((names->keymap==NULL)||(names->keymap[0]=='\0')) { - sprintf(keymap,"server-%s",display); - } - else { - if (strlen(names->keymap) > PATH_MAX - 1) { - ErrorF("[xkb] name of keymap (%s) exceeds max length\n", names->keymap); - return False; - } - strcpy(keymap,names->keymap); - } + + snprintf(keymap, sizeof(keymap), "server-%s", display); XkbEnsureSafeMapName(keymap); OutputDirectory(xkm_output_dir, sizeof(xkm_output_dir)); |