components/proftpd/patches/17599705.patch
author Tomas Klacko <tomas.klacko@oracle.com>
Tue, 25 Feb 2014 02:29:07 -0800
branchs11-update
changeset 2966 93b92606f5e1
permissions -rw-r--r--
15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps 17599705 proftpd NLST ../ returns ./
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2966
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     1
http://bugs.proftpd.org/show_bug.cgi?id=4011
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     2
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     3
diff --git a/include/fsio.h b/include/fsio.h
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     4
index 07c18c1..a4c395e 100644
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     5
--- a/include/fsio.h
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     6
+++ b/include/fsio.h
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     7
@@ -189,6 +189,9 @@ struct fh_rec {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     8
   size_t fh_iosz;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     9
 };
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    10
 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    11
+/* Maximum symlink count, for loop detection. */
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    12
+#define PR_FSIO_MAX_LINK_COUNT         32
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    13
+
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    14
 /* Macros for that code that needs to get into the internals of pr_fs_t.
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    15
  * (These will help keep the internals as opaque as possible).
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    16
  */
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    17
@@ -319,7 +322,11 @@ char *pr_fs_encode_path(pool *, const char *);
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    18
 int pr_fs_use_encoding(int bool);
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    19
 int pr_fs_valid_path(const char *);
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    20
 void pr_fs_virtual_path(const char *, char *, size_t);
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    21
+
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    22
 void pr_fs_clean_path(const char *, char *, size_t);
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    23
+int pr_fs_clean_path2(const char *, char *, size_t, int);
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    24
+#define PR_FSIO_CLEAN_PATH_FL_MAKE_ABS_PATH    0x001
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    25
+
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    26
 int pr_fs_glob(const char *, int, int (*errfunc)(const char *, int), glob_t *);
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    27
 void pr_fs_globfree(glob_t *);
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    28
 void pr_resolve_fs_map(void);
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    29
diff --git a/modules/mod_ls.c b/modules/mod_ls.c
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    30
index 50e8035..58e81d7 100644
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    31
--- a/modules/mod_ls.c
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    32
+++ b/modules/mod_ls.c
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    33
@@ -2571,46 +2571,6 @@ MODRET ls_nlst(cmd_rec *cmd) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    34
     }
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    35
   }
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    36
 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    37
-  /* Clean the path. */
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    38
-  if (*target != '/') {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    39
-    size_t cwdlen = strlen(pr_fs_getcwd());
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    40
-
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    41
-    pr_fs_clean_path(pdircat(cmd->tmp_pool, pr_fs_getcwd(), target, NULL),
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    42
-      buf, sizeof(buf));
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    43
-
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    44
-    target = buf;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    45
-
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    46
-    /* If the given target was not an absolute path, advance past the
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    47
-     * current working directory prefix in the cleaned up target path.
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    48
-     */
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    49
-    target += cwdlen;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    50
-
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    51
-    /* If the length of the current working directory (cwdlen) is one,
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    52
-     * it means that the current working directory is the root ('/'),
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    53
-     * and so we don't want to advance past that into the file name
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    54
-     * portion of the path.
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    55
-     */
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    56
-    if (cwdlen > 1)
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    57
-      target += 1;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    58
-
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    59
-  } else {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    60
-    pr_fs_clean_path(target, buf, sizeof(buf));
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    61
-    target = buf;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    62
-  }
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    63
-
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    64
-  /* Remove any trailing separators. */
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    65
-  targetlen = strlen(target);
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    66
-  while (targetlen >= 1 &&
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    67
-         target[targetlen-1] == '/') {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    68
-
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    69
-    if (strcmp(target, "/") == 0) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    70
-      break;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    71
-    }
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    72
-
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    73
-    target[targetlen-1] = '\0';
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    74
-    targetlen = strlen(target);
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    75
-  }
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    76
-
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    77
   /* If the target is a glob, get the listing of files/dirs to send. */
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    78
   if (use_globbing &&
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    79
       pr_str_is_fnmatch(target)) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    80
@@ -2715,12 +2675,36 @@ MODRET ls_nlst(cmd_rec *cmd) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    81
     }
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    82
 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    83
   } else {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    84
-
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    85
     /* A single target. If it's a directory, list the contents; if it's a
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    86
      * file, just list the file.
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    87
      */
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    88
     struct stat st;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    89
 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    90
+    if (!is_dotdir(target)) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    91
+      /* Clean the path. */
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    92
+      if (*target != '/') {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    93
+        pr_fs_clean_path2(target, buf, sizeof(buf), 0);
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    94
+
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    95
+      } else {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    96
+        pr_fs_clean_path(target, buf, sizeof(buf));
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    97
+      }
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    98
+
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    99
+      target = buf;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   100
+
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   101
+    } else {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   102
+      /* Remove any trailing separators. */
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   103
+      targetlen = strlen(target);
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   104
+      while (targetlen >= 1 &&
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   105
+             target[targetlen-1] == '/') {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   106
+        if (strncmp(target, "/", 2) == 0) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   107
+          break;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   108
+        }
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   109
+
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   110
+        target[targetlen-1] = '\0';
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   111
+        targetlen = strlen(target);
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   112
+      }
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   113
+    }
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   114
+
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   115
     if (!ls_perms_full(cmd->tmp_pool, cmd, target, &hidden)) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   116
       int xerrno = errno;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   117
 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   118
diff --git a/src/fsio.c b/src/fsio.c
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   119
index 782168d..4d191fe 100644
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   120
--- a/src/fsio.c
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   121
+++ b/src/fsio.c
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   122
@@ -1627,8 +1627,8 @@ int pr_fs_resolve_partial(const char *path, char *buf, size_t buflen, int op) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   123
 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   124
   pr_fs_t *fs = NULL;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   125
   int len = 0, fini = 1, link_cnt = 0;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   126
-  ino_t last_inode = 0;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   127
-  dev_t last_device = 0;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   128
+  ino_t prev_inode = 0;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   129
+  dev_t prev_device = 0;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   130
   struct stat sbuf;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   131
 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   132
   if (!path) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   133
@@ -1740,16 +1740,16 @@ int pr_fs_resolve_partial(const char *path, char *buf, size_t buflen, int op) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   134
         char linkpath[PR_TUNABLE_PATH_MAX + 1] = {'\0'};
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   135
 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   136
         /* Detect an obvious recursive symlink */
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   137
-        if (sbuf.st_ino && (ino_t) sbuf.st_ino == last_inode &&
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   138
-            sbuf.st_dev && (dev_t) sbuf.st_dev == last_device) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   139
+        if (sbuf.st_ino && (ino_t) sbuf.st_ino == prev_inode &&
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   140
+            sbuf.st_dev && (dev_t) sbuf.st_dev == prev_device) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   141
           errno = ELOOP;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   142
           return -1;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   143
         }
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   144
 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   145
-        last_inode = (ino_t) sbuf.st_ino;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   146
-        last_device = (dev_t) sbuf.st_dev;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   147
+        prev_inode = (ino_t) sbuf.st_ino;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   148
+        prev_device = (dev_t) sbuf.st_dev;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   149
 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   150
-        if (++link_cnt > 32) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   151
+        if (++link_cnt > PR_FSIO_MAX_LINK_COUNT) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   152
           errno = ELOOP;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   153
           return -1;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   154
         }
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   155
@@ -1820,8 +1820,8 @@ int pr_fs_resolve_path(const char *path, char *buf, size_t buflen, int op) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   156
   pr_fs_t *fs = NULL;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   157
 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   158
   int len = 0, fini = 1, link_cnt = 0;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   159
-  ino_t last_inode = 0;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   160
-  dev_t last_device = 0;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   161
+  ino_t prev_inode = 0;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   162
+  dev_t prev_device = 0;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   163
   struct stat sbuf;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   164
 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   165
   if (!path) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   166
@@ -1906,16 +1906,16 @@ int pr_fs_resolve_path(const char *path, char *buf, size_t buflen, int op) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   167
         char linkpath[PR_TUNABLE_PATH_MAX + 1] = {'\0'};
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   168
 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   169
         /* Detect an obvious recursive symlink */
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   170
-        if (sbuf.st_ino && (ino_t) sbuf.st_ino == last_inode &&
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   171
-            sbuf.st_dev && (dev_t) sbuf.st_dev == last_device) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   172
+        if (sbuf.st_ino && (ino_t) sbuf.st_ino == prev_inode &&
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   173
+            sbuf.st_dev && (dev_t) sbuf.st_dev == prev_device) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   174
           errno = ELOOP;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   175
           return -1;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   176
         }
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   177
 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   178
-        last_inode = (ino_t) sbuf.st_ino;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   179
-        last_device = (dev_t) sbuf.st_dev;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   180
+        prev_inode = (ino_t) sbuf.st_ino;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   181
+        prev_device = (dev_t) sbuf.st_dev;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   182
 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   183
-        if (++link_cnt > 32) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   184
+        if (++link_cnt > PR_FSIO_MAX_LINK_COUNT) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   185
           errno = ELOOP;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   186
           return -1;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   187
         }
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   188
@@ -1977,22 +1977,33 @@ int pr_fs_resolve_path(const char *path, char *buf, size_t buflen, int op) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   189
   return 0;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   190
 }
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   191
 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   192
-void pr_fs_clean_path(const char *path, char *buf, size_t buflen) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   193
+int pr_fs_clean_path2(const char *path, char *buf, size_t buflen, int flags) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   194
   char workpath[PR_TUNABLE_PATH_MAX + 1] = {'\0'};
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   195
   char curpath[PR_TUNABLE_PATH_MAX + 1]  = {'\0'};
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   196
   char namebuf[PR_TUNABLE_PATH_MAX + 1]  = {'\0'};
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   197
-  char *where = NULL, *ptr = NULL, *last = NULL;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   198
-  int fini = 1;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   199
+  int fini = 1, have_abs_path = FALSE; 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   200
 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   201
-  if (!path)
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   202
-    return;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   203
+  if (path == NULL ||
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   204
+      buf == NULL) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   205
+    errno = EINVAL;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   206
+    return -1;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   207
+  }
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   208
+
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   209
+  if (buflen == 0) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   210
+    return 0;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   211
+  }
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   212
 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   213
   sstrncpy(curpath, path, sizeof(curpath));
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   214
 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   215
+  if (*curpath == '/') {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   216
+    have_abs_path = TRUE;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   217
+  }
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   218
+
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   219
   /* main loop */
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   220
   while (fini--) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   221
-    where = curpath;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   222
+    char *where = NULL, *ptr = NULL, *last = NULL;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   223
 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   224
+    where = curpath;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   225
     while (*where != '\0') {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   226
       pr_signals_handle();
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   227
 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   228
@@ -2013,8 +2024,12 @@ void pr_fs_clean_path(const char *path, char *buf, size_t buflen) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   229
         ptr = last = workpath;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   230
 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   231
         while (*ptr) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   232
-          if (*ptr == '/')
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   233
+          pr_signals_handle();
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   234
+
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   235
+          if (*ptr == '/') {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   236
             last = ptr;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   237
+          }
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   238
+
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   239
           ptr++;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   240
         }
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   241
 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   242
@@ -2028,34 +2043,46 @@ void pr_fs_clean_path(const char *path, char *buf, size_t buflen) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   243
         ptr = last = workpath;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   244
 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   245
         while (*ptr) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   246
-          if (*ptr == '/')
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   247
+          pr_signals_handle();
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   248
+
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   249
+          if (*ptr == '/') {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   250
             last = ptr;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   251
+          }
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   252
           ptr++;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   253
         }
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   254
+
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   255
         *last = '\0';
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   256
         continue;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   257
       }
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   258
-      ptr = strchr(where, '/');
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   259
 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   260
-      if (!ptr) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   261
+      ptr = strchr(where, '/');
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   262
+      if (ptr == NULL) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   263
         size_t wherelen = strlen(where);
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   264
 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   265
         ptr = where;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   266
-        if (wherelen >= 1)
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   267
+        if (wherelen >= 1) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   268
           ptr += (wherelen - 1);
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   269
+        }
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   270
 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   271
-      } else
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   272
+      } else {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   273
         *ptr = '\0';
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   274
+      }
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   275
 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   276
       sstrncpy(namebuf, workpath, sizeof(namebuf));
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   277
 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   278
       if (*namebuf) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   279
         for (last = namebuf; *last; last++);
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   280
-        if (*--last != '/')
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   281
+        if (*--last != '/') {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   282
           sstrcat(namebuf, "/", sizeof(namebuf)-1);
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   283
+        }
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   284
 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   285
-      } else
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   286
-        sstrcat(namebuf, "/", sizeof(namebuf)-1);
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   287
+      } else {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   288
+        if (have_abs_path ||
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   289
+            (flags & PR_FSIO_CLEAN_PATH_FL_MAKE_ABS_PATH)) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   290
+          sstrcat(namebuf, "/", sizeof(namebuf)-1);
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   291
+          have_abs_path = FALSE;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   292
+        }
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   293
+      }
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   294
 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   295
       sstrcat(namebuf, where, sizeof(namebuf)-1);
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   296
       namebuf[sizeof(namebuf)-1] = '\0';
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   297
@@ -2066,10 +2093,16 @@ void pr_fs_clean_path(const char *path, char *buf, size_t buflen) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   298
     }
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   299
   }
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   300
 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   301
-  if (!workpath[0])
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   302
+  if (!workpath[0]) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   303
     sstrncpy(workpath, "/", sizeof(workpath));
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   304
+  }
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   305
 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   306
   sstrncpy(buf, workpath, buflen);
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   307
+  return 0;
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   308
+}
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   309
+
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   310
+void pr_fs_clean_path(const char *path, char *buf, size_t buflen) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   311
+  pr_fs_clean_path2(path, buf, buflen, PR_FSIO_CLEAN_PATH_FL_MAKE_ABS_PATH);
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   312
 }
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   313
 
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   314
 int pr_fs_use_encoding(int bool) {
93b92606f5e1 15825705 SUNBT7206929 all of the ftp test cases with "-f" are timeouted in krb5_r_apps
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
   315