libXtrans bug ? HAS_FCHOWN vs. HAVE_FCHOWN

Enrico Weigelt weigelt at metux.de
Mon Sep 12 10:00:30 PDT 2005


Hi folks,


there's probably a bug in libXtrans:

./configure defines HAVE_FCHOWN when the OS/libc provides the 
fchown() interface, but the code using it is surrounded by 

    #ifdef HAS_FCHOWN

maybe a typo ?

the same with HAS_STICKY_DIR_BIT


see attachement.

cu
-- 
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service
  phone:     +49 36207 519931         www:       http://www.metux.de/
  fax:       +49 36207 519932         email:     contact at metux.de
---------------------------------------------------------------------
  Realtime Forex/Stock Exchange trading powered by postgresSQL :))
                                            http://www.fxignal.net/
---------------------------------------------------------------------
-------------- next part --------------
diff -ruN libXtrans-0.1.orig/Xtranslcl.c libXtrans-0.1/Xtranslcl.c
--- libXtrans-0.1.orig/Xtranslcl.c	2005-09-12 14:55:27.000000000 +0200
+++ libXtrans-0.1/Xtranslcl.c	2005-09-12 18:58:09.000000000 +0200
@@ -443,7 +443,7 @@
 	(void) sprintf(server_path, "%s%d", PTSNODENAME, getpid());
     }
 
-#ifdef HAS_STICKY_DIR_BIT
+#ifdef HAVE_STICKY_DIR_BIT
     mode = 01777;
 #else
     mode = 0777;
@@ -719,7 +719,7 @@
 	(void) sprintf(server_path, "%s%ld", NAMEDNODENAME, (long)getpid());
     }
 
-#ifdef HAS_STICKY_DIR_BIT
+#ifdef HAVE_STICKY_DIR_BIT
     mode = 01777;
 #else
     mode = 0777;
@@ -1031,7 +1031,7 @@
     (void) sprintf(server_path, ISCDEVNODENAME, port);
     (void) sprintf(server_unix_path, ISCTMPNODENAME, port);
 
-#ifdef HAS_STICKY_DIR_BIT
+#ifdef HAVE_STICKY_DIR_BIT
     mode = 01777;
 #else
     mode = 0777;
diff -ruN libXtrans-0.1.orig/Xtranssock.c libXtrans-0.1/Xtranssock.c
--- libXtrans-0.1.orig/Xtranssock.c	2005-09-12 14:55:27.000000000 +0200
+++ libXtrans-0.1/Xtranssock.c	2005-09-12 18:58:16.000000000 +0200
@@ -999,7 +999,7 @@
     oldUmask = umask (0);
 
 #ifdef UNIX_DIR
-#ifdef HAS_STICKY_DIR_BIT
+#ifdef HAVE_STICKY_DIR_BIT
     mode = 01777;
 #else
     mode = 0777;
@@ -1096,7 +1096,7 @@
 	int oldUmask = umask (0);
 
 #ifdef UNIX_DIR
-#ifdef HAS_STICKY_DIR_BIT
+#ifdef HAVE_STICKY_DIR_BIT
 	mode = 01777;
 #else
 	mode = 0777;
diff -ruN libXtrans-0.1.orig/Xtransutil.c libXtrans-0.1/Xtransutil.c
--- libXtrans-0.1.orig/Xtransutil.c	2005-09-12 14:55:27.000000000 +0200
+++ libXtrans-0.1/Xtransutil.c	2005-09-12 18:56:31.000000000 +0200
@@ -536,7 +536,7 @@
 	    if ((mode & 01000) &&
 		(buf.st_mode & 0002) && !(buf.st_mode & 01000))
 		updateMode = 1;
-#ifdef HAS_FCHOWN
+#ifdef HAVE_FCHOWN
 	    /*
 	     * If fchown(2) and fchmod(2) are available, try to correct the
 	     * directory's owner and mode.  Otherwise it isn't safe to attempt


More information about the xorg-modular mailing list