diff --git a/tigervnc.spec b/tigervnc.spec index 02878e6..0fba174 100644 --- a/tigervnc.spec +++ b/tigervnc.spec @@ -2,7 +2,7 @@ Name: tigervnc Version: 1.0.90 -Release: 0.12.%{snap}%{?dist} +Release: 0.13.%{snap}%{?dist} Summary: A TigerVNC remote display system Group: User Interface/Desktops @@ -45,6 +45,8 @@ Patch10: tigervnc11-ldnow.patch Patch11: tigervnc11-libvnc.patch Patch12: tigervnc11-rh600070.patch Patch13: tigervnc11-rh597172.patch +Patch14: tigervnc11-rh611677.patch +Patch15: tigervnc11-rh611677-xorg.patch %description Virtual Network Computing (VNC) is a remote display system which @@ -102,6 +104,7 @@ to access the desktop on your machine. %patch11 -p1 -b .libvnc %patch12 -p1 -b .rh600070 %patch13 -p1 -b .rh597172 +%patch14 -p1 -b .rh611677 cp -r /usr/share/xorg-x11-server-source/* unix/xserver pushd unix/xserver @@ -111,6 +114,8 @@ done patch -p1 -b --suffix .vnc < ../xserver18.patch popd +%patch15 -p1 -b .rh611677-xorg + # Use newer gettext sed -i 's/AM_GNU_GETTEXT_VERSION.*/AM_GNU_GETTEXT_VERSION([0.17])/' \ configure.ac @@ -248,6 +253,9 @@ fi %endif %changelog +* Wed Aug 25 2010 Adam Tkac 1.0.90-0.13.20100420svn4030 +- Xvnc: handle situations when no modifiers exist well (#611677) + * Thu Jun 24 2010 Adam Tkac 1.0.90-0.12.20100420svn4030 - fix memory leak in Xvnc input code (#597172) - don't crash when receive negative encoding (#600070) diff --git a/tigervnc11-rh611677-xorg.patch b/tigervnc11-rh611677-xorg.patch new file mode 100644 index 0000000..d50b60b --- /dev/null +++ b/tigervnc11-rh611677-xorg.patch @@ -0,0 +1,45 @@ +diff -up tigervnc-1.0.90-20100420svn4030/unix/xserver/dix/inpututils.c.rh611677-xorg tigervnc-1.0.90-20100420svn4030/unix/xserver/dix/inpututils.c +--- tigervnc-1.0.90-20100420svn4030/unix/xserver/dix/inpututils.c.rh611677-xorg 2010-08-24 17:26:15.761550148 +0200 ++++ tigervnc-1.0.90-20100420svn4030/unix/xserver/dix/inpututils.c 2010-08-24 17:27:24.452403208 +0200 +@@ -287,7 +287,7 @@ int generate_modkeymap(ClientPtr client, + { + CARD8 keys_per_mod[8]; + int max_keys_per_mod; +- KeyCode *modkeymap; ++ KeyCode *modkeymap = NULL; + int i, j, ret; + + ret = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixGetAttrAccess); +@@ -311,18 +311,20 @@ int generate_modkeymap(ClientPtr client, + } + } + +- modkeymap = xcalloc(max_keys_per_mod * 8, sizeof(KeyCode)); +- if (!modkeymap) +- return BadAlloc; +- +- for (i = 0; i < 8; i++) +- keys_per_mod[i] = 0; +- +- for (i = 8; i < MAP_LENGTH; i++) { +- for (j = 0; j < 8; j++) { +- if (dev->key->xkbInfo->desc->map->modmap[i] & (1 << j)) { +- modkeymap[(j * max_keys_per_mod) + keys_per_mod[j]] = i; +- keys_per_mod[j]++; ++ if (max_keys_per_mod != 0) { ++ modkeymap = xcalloc(max_keys_per_mod * 8, sizeof(KeyCode)); ++ if (!modkeymap) ++ return BadAlloc; ++ ++ for (i = 0; i < 8; i++) ++ keys_per_mod[i] = 0; ++ ++ for (i = 8; i < MAP_LENGTH; i++) { ++ for (j = 0; j < 8; j++) { ++ if (dev->key->xkbInfo->desc->map->modmap[i] & (1 << j)) { ++ modkeymap[(j * max_keys_per_mod) + keys_per_mod[j]] = i; ++ keys_per_mod[j]++; ++ } + } + } + } diff --git a/tigervnc11-rh611677.patch b/tigervnc11-rh611677.patch new file mode 100644 index 0000000..029854b --- /dev/null +++ b/tigervnc11-rh611677.patch @@ -0,0 +1,98 @@ +diff -up tigervnc-1.0.90-20100420svn4030/unix/xserver/hw/vnc/Input.cc.rh611677 tigervnc-1.0.90-20100420svn4030/unix/xserver/hw/vnc/Input.cc +--- tigervnc-1.0.90-20100420svn4030/unix/xserver/hw/vnc/Input.cc.rh611677 2010-08-24 17:40:00.511860227 +0200 ++++ tigervnc-1.0.90-20100420svn4030/unix/xserver/hw/vnc/Input.cc 2010-08-24 17:49:23.169007409 +0200 +@@ -322,6 +322,11 @@ public: + return; + } + ++ if (maxKeysPerMod == 0) { ++ vlog.debug("Keyboard has no modifiers"); ++ return; ++ } ++ + keycode = modmap[modIndex * maxKeysPerMod]; + xfree(modmap); + #else +@@ -355,6 +360,11 @@ public: + vlog.error("generate_modkeymap failed"); + return; + } ++ ++ if (maxKeysPerMod == 0) { ++ vlog.debug("Keyboard has no modifiers"); ++ return; ++ } + #else + maxKeysPerMod = keyc->maxKeysPerModifier; + #endif +@@ -530,6 +540,9 @@ void InputDevice::keyEvent(rdr::U32 keys + return; + } + ++ if (maxKeysPerMod == 0) ++ vlog.debug("Keyboard has no modifiers"); ++ + state = XkbStateFieldFromRec(&keyc->xkbInfo->state); + #else + keyc = keyboardDev->key; +@@ -565,11 +578,13 @@ void InputDevice::keyEvent(rdr::U32 keys + ModeSwitchFound: + + int col = 0; +- if ((state & (1 << ShiftMapIndex)) != 0) +- col |= 1; +- if (modeSwitchMapIndex != 0 && +- ((state & (1 << modeSwitchMapIndex))) != 0) +- col |= 2; ++ if (maxKeysPerMod != 0) { ++ if ((state & (1 << ShiftMapIndex)) != 0) ++ col |= 1; ++ if (modeSwitchMapIndex != 0 && ++ ((state & (1 << modeSwitchMapIndex))) != 0) ++ col |= 2; ++ } + + int kc = KeysymToKeycode(keymap, keysym, &col); + +@@ -581,7 +596,8 @@ ModeSwitchFound: + * We never get ISO_Left_Tab here because it's already been translated + * in VNCSConnectionST. + */ +- if (keysym == XK_Tab && ((state & (1 << ShiftMapIndex))) != 0) ++ if (maxKeysPerMod != 0 && keysym == XK_Tab && ++ ((state & (1 << ShiftMapIndex))) != 0) + col |= 1; + + if (kc == 0) { +@@ -662,18 +678,20 @@ ModeSwitchFound: + } + } + +- ModifierState shift(keyboardDev, ShiftMapIndex); +- ModifierState modeSwitch(keyboardDev, modeSwitchMapIndex); +- if (down) { +- if (col & 1) +- shift.press(); +- else +- shift.release(); +- if (modeSwitchMapIndex) { +- if (col & 2) +- modeSwitch.press(); ++ if (maxKeysPerMod != 0) { ++ ModifierState shift(keyboardDev, ShiftMapIndex); ++ ModifierState modeSwitch(keyboardDev, modeSwitchMapIndex); ++ if (down) { ++ if (col & 1) ++ shift.press(); + else +- modeSwitch.release(); ++ shift.release(); ++ if (modeSwitchMapIndex) { ++ if (col & 2) ++ modeSwitch.press(); ++ else ++ modeSwitch.release(); ++ } + } + } +