OSSP CVS Repository

ossp - Check-in [1126]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 1126
Date: 2001-Oct-09 20:26:12 (local)
2001-Oct-09 18:26:12 (UTC)
User:rse
Branch:
Comment: support relative paths for 'unix:path'
Tickets:
Inspections:
Files:
ossp-pkg/sa/TODO      1.14 -> 1.15     0 inserted, 1 deleted
ossp-pkg/sa/sa.c      1.17 -> 1.18     7 inserted, 2 deleted

ossp-pkg/sa/TODO 1.14 -> 1.15

--- TODO 2001/10/08 15:17:47     1.14
+++ TODO 2001/10/09 18:26:12     1.15
@@ -10,7 +10,6 @@
   SA_BUFFER_KREAD
   SA_BUFFER_KWRITE
   SA_BUFFER_WRITEF
-- support for relative pathnames in unix:path
 
 - test suite:
   - inet://0.0.0.0:0 -> inet://0.0.0.0:514


ossp-pkg/sa/sa.c 1.17 -> 1.18

--- sa.c 2001/10/09 14:58:22     1.17
+++ sa.c 2001/10/09 18:26:12     1.18
@@ -481,8 +481,6 @@
     if (strncmp(uri, "unix:", 5) == 0) {
         /* parse URI */
         cpPath = uri+5;
-        if (cpPath[0] != '/')
-            return SA_ERR_ARG;
 
         /* mandatory(!) socket address structure initialization */
         memset(&un, 0, sizeof(un));
@@ -491,6 +489,13 @@
         n = strlen(cpPath);
         if ((n+1) > sizeof(un.sun_path))
             return SA_ERR_MEM;
+        if (cpPath[0] != '/') {
+            if (getcwd(un.sun_path, sizeof(un.sun_path)-(n+1)) == NULL)
+                return SA_ERR_MEM;
+            cp = un.sun_path + strlen(un.sun_path);
+        }
+        else
+            cp = un.sun_path;
         memcpy(un.sun_path, cpPath, n+1);
         un.sun_family = AF_LOCAL;
 

CVSTrac 2.0.1