xserver: Branch 'master' - 2 commits

Keith Packard keithp at kemper.freedesktop.org
Sun Jan 4 16:38:08 PST 2015


 configure.ac                 |    2 +-
 dix/getevents.c              |    6 +++---
 hw/xfree86/Makefile.am       |    2 +-
 hw/xfree86/Xorg.sh.in        |    4 ++--
 hw/xfree86/man/Xorg.wrap.man |    2 +-
 hw/xfree86/xorg-wrapper.c    |   10 +++++-----
 6 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit de89c6b8c6e81bad131c7f432e355cb42d233e87
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Dec 16 13:59:45 2014 +1000

    xfree86: rename Xorg.bin to Xorg
    
    If the suid wrapper is enabled, /usr/bin/Xorg is just a shell script that
    execs either /usr/libexec/Xorg.bin directly or the Xorg.wrap binary which then
    execve's /usr/libexec/Xorg.bin.
    
    Either way, we end up with Xorg.bin, which is problematic for two reasons:
    * ps shows the command as Xorg.bin
    * _COMM and _EXE in systemd's journal will both show Xorg.bin as well
    
    There's not much we can do about the path, but having the actual command stay
    as Xorg means better compatibility to existing scripts. And, the reason for
    this path: the command
       journalctl _COMM=Xorg
    works universally, regardless of whether the wrapper is used or not.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Acked-by: Hans de Goede <hdegoede at redhat.com>

diff --git a/configure.ac b/configure.ac
index 96524c5..b593fc7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -923,7 +923,7 @@ if test "x$SUID_WRAPPER" = xyes; then
         PKG_CHECK_MODULES([LIBDRM], $LIBDRM)
         dnl This is a define so that if some platforms want to put the wrapper
         dnl somewhere else this can be easily changed
-        AC_DEFINE_DIR(SUID_WRAPPER_DIR, libexecdir, [Where to install Xorg.bin and Xorg.wrap])
+        AC_DEFINE_DIR(SUID_WRAPPER_DIR, libexecdir, [Where to install the Xorg binary and Xorg.wrap])
         SETUID="no"
 fi
 AM_CONDITIONAL(SUID_WRAPPER, [test "x$SUID_WRAPPER" = xyes])
diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am
index d46bf0a..27f2cc6 100644
--- a/hw/xfree86/Makefile.am
+++ b/hw/xfree86/Makefile.am
@@ -106,7 +106,7 @@ if INSTALL_SETUID
 endif
 if SUID_WRAPPER
 	$(MKDIR_P) $(DESTDIR)$(SUID_WRAPPER_DIR)
-	mv $(DESTDIR)$(bindir)/Xorg $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.bin
+	mv $(DESTDIR)$(bindir)/Xorg $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg
 	${INSTALL} -m 755 Xorg.sh $(DESTDIR)$(bindir)/Xorg
 	-chown root $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.wrap && chmod u+s $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.wrap
 endif
diff --git a/hw/xfree86/Xorg.sh.in b/hw/xfree86/Xorg.sh.in
index cef4859..4814135 100644
--- a/hw/xfree86/Xorg.sh.in
+++ b/hw/xfree86/Xorg.sh.in
@@ -1,11 +1,11 @@
 #!/bin/sh
 #
-# Execute Xorg.wrap if it exists otherwise execute Xorg.bin directly.
+# Execute Xorg.wrap if it exists otherwise execute Xorg directly.
 # This allows distros to put the suid wrapper in a separate package.
 
 basedir=@SUID_WRAPPER_DIR@
 if [ -x "$basedir"/Xorg.wrap ]; then
 	exec "$basedir"/Xorg.wrap "$@"
 else
-	exec "$basedir"/Xorg.bin "$@"
+	exec "$basedir"/Xorg "$@"
 fi
diff --git a/hw/xfree86/man/Xorg.wrap.man b/hw/xfree86/man/Xorg.wrap.man
index 58937c7..11090f1 100644
--- a/hw/xfree86/man/Xorg.wrap.man
+++ b/hw/xfree86/man/Xorg.wrap.man
@@ -33,7 +33,7 @@ Xorg.wrap \- Xorg X server binary wrapper
 The Xorg X server may need root rights to function properly. To start the
 Xorg X server with these rights your system is using a suid root wrapper
 installed as __suid_wrapper_dir__/Xorg.wrap which will execute the real
-X server which is installed as __suid_wrapper_dir__/Xorg.bin .
+X server which is installed as __suid_wrapper_dir__/Xorg.
 .PP
 By default Xorg.wrap will autodetect if root rights are necessary, and
 if not it will drop its elevated rights before starting the real X server.
diff --git a/hw/xfree86/xorg-wrapper.c b/hw/xfree86/xorg-wrapper.c
index 4ea4733..22e97ad 100644
--- a/hw/xfree86/xorg-wrapper.c
+++ b/hw/xfree86/xorg-wrapper.c
@@ -255,18 +255,18 @@ int main(int argc, char *argv[])
         }
     }
 
-    snprintf(buf, sizeof(buf), "%s/Xorg.bin", SUID_WRAPPER_DIR);
+    snprintf(buf, sizeof(buf), "%s/Xorg", SUID_WRAPPER_DIR);
 
     /* Check if the server is executable by our real uid */
     if (access(buf, X_OK) != 0) {
-        fprintf(stderr, "%s: Missing execute permissions for %s/Xorg.bin: %s\n",
-            progname, SUID_WRAPPER_DIR, strerror(errno));
+        fprintf(stderr, "%s: Missing execute permissions for %s: %s\n",
+            progname, buf, strerror(errno));
         exit(1);
     }
 
     argv[0] = buf;
     (void) execv(argv[0], argv);
-    fprintf(stderr, "%s: Failed to execute %s/Xorg.bin: %s\n",
-        progname, SUID_WRAPPER_DIR, strerror(errno));
+    fprintf(stderr, "%s: Failed to execute %s: %s\n",
+        progname, buf, strerror(errno));
     exit(1);
 }
commit ee21be1324de1d6ef14e529fed7b75992e971beb
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Thu Dec 11 10:32:45 2014 +1000

    dix: offset touch root coordinates by ScreenRec origins (#86655)
    
    For two ScreenRecs abs pointer positioning was working fine, but touch events
    stuck to the lower/right edge on any screen but the one with a 0/0 origin.
    Cause is a missing offset by the screen coordinates, causing the root
    coordinates in the event to desktop-wide, not screen-wide.
    
    Offset properly, just like we do for pointer events.
    
    X.Org Bug 86655 <http://bugs.freedesktop.org/show_bug.cgi?id=86655>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/getevents.c b/dix/getevents.c
index dd96265..6fb12c5 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -2044,7 +2044,7 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid,
 
     event->root = scr->root->drawable.id;
 
-    event_set_root_coordinates(event, screenx, screeny);
+    event_set_root_coordinates(event, screenx - scr->x, screeny - scr->y);
     event->touchid = client_id;
     event->flags = flags;
 
@@ -2082,8 +2082,8 @@ GetDixTouchEnd(InternalEvent *ievent, DeviceIntPtr dev, TouchPointInfoPtr ti,
     /* Get screen event coordinates from the sprite.  Is this really the best
      * we can do? */
     event_set_root_coordinates(event,
-                               dev->last.valuators[0],
-                               dev->last.valuators[1]);
+                               dev->last.valuators[0] - scr->x,
+                               dev->last.valuators[1] - scr->y);
     event->touchid = ti->client_id;
     event->flags = flags;
 


More information about the xorg-commit mailing list