Under MacOs, I had an "invalid routine call" returned by SysFileTree
because of a path too long.
The call to variablePoolGetVariable  returned a NULL retriever.
I did not investigate more here, because I saw that the current file path
was longer than the buffer size.
After replacing MAX by PATH_MAX where appropriate, I had no more error.

My next step was to run test4.rex provided by Jerry, but I discover that
the Unix version of SysFileTree takes only 3 arguments... So no way to pass
tattrib and nattrib under Unix ?

I'm currently running test4.rex without tattrib on my Mac. Will tell you if
I have an error.

Jean-Louis

---------- Forwarded message ----------
From: <[email protected]>
Date: 2012/2/11
Subject: [Oorexx-svn] SF.net SVN: oorexx:[7518]
sandbox/jlf/trunk/extensions/rexxutil/platform/ unix/rexxutil.cpp
To: [email protected]


Revision: 7518
         http://oorexx.svn.sourceforge.net/oorexx/?rev=7518&view=rev
Author:   jfaucher
Date:     2012-02-11 13:45:14 +0000 (Sat, 11 Feb 2012)
Log Message:
-----------
A possible fix for SysFileTree bug 3405740, but not yet the ultimate good
fix.
Some buffers are too small (MAX=256).
Now using the predefined PATH_MAX, but a buffer overflow is still possible :
http://insanecoding.blogspot.com/2007/11/pathmax-simply-isnt.html

Modified Paths:
--------------
   sandbox/jlf/trunk/extensions/rexxutil/platform/unix/rexxutil.cpp

Modified: sandbox/jlf/trunk/extensions/rexxutil/platform/unix/rexxutil.cpp
===================================================================
--- sandbox/jlf/trunk/extensions/rexxutil/platform/unix/rexxutil.cpp
 2012-02-10 01:49:33 UTC (rev 7517)
+++ sandbox/jlf/trunk/extensions/rexxutil/platform/unix/rexxutil.cpp
 2012-02-11 13:45:14 UTC (rev 7518)
@@ -385,9 +385,9 @@
    SHVBLOCK shvb;                     /* Request block for RxVar    */
    size_t stemlen;                    /* Length of stem             */
    size_t vlen;                       /* Length of variable value   */
-    char TargetSpec[MAX+1];            /* Target filespec            */
-    char truefile[MAX+1];              /* expanded file name         */
-    char Temp[MAX+80];                 /* buffer for returned values */
+    char TargetSpec[PATH_MAX+1];       /* Target filespec            */
+    char truefile[PATH_MAX+1];         /* expanded file name         */
+    char Temp[PATH_MAX+80];            /* buffer for returned values */
    char varname[MAX];                 /* Buffer for variable name   */
    size_t nattrib;                    /* New attrib, diff for each  */
 } RXTREEDATA;
@@ -1282,7 +1282,7 @@
  size_t       options )               /* Search and output format   */
                                       /* options                    */
 {
-  char  tempfile[MAX+1];               /* Used to hold temp file name*/
+  char  tempfile[PATH_MAX+1];          /* Used to hold temp file name*/
  DIR *dir_handle;                     /* Directory handle           */
  struct stat finfo;                   /* file information           */
  char * filename;

This was sent by the SourceForge.net collaborative development platform,
the world's largest Open Source development site.


------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Oorexx-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-svn
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Oorexx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to