Re: Bug #1293 Updated: UNC (\\server\share) pathnames don't work
| From: | Sascha Schumann | Date: | Mon, 05 Apr 1999 21:23:22 +0000 |
| Subject: | Re: Bug #1293 Updated: UNC (\\server\share) pathnames don't work | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-4939@lists.php.net to get a copy of this message | ||
On Mon, Apr 05, 1999 at 06:45:25PM -0000, Bug Database wrote:
> ID: 1293
> User Update by: mnc@nih.gov
> Old-Status: Closed
> Status: Open
> Bug Type: Other
> Description: UNC (\\server\share) pathnames don't work
>
> $fp = fopen("\\server\share\file.txt");
>
> fails, apparently because the doubled slash is removed by line 139 in
> fopen_wrappers.c prior to path validation.
>
> For this reason, escaping the path using a syntax such as
> "\\\\server\\share\\file.txt" can not work.
Well, this is a task for the operating system, not PHP to deal with. Proposed
patch:
Index: fopen-wrappers.c
===================================================================
RCS file: /repository/php3/fopen-wrappers.c,v
retrieving revision 1.57
diff -u -r1.57 fopen-wrappers.c
--- fopen-wrappers.c 1999/02/15 17:25:44 1.57
+++ fopen-wrappers.c 1999/04/05 21:29:04
@@ -131,7 +131,9 @@
) {
local_open_basedir[local_open_basedir_pos--] = 0;
}
-
+/* stripping unnecessary slashes is left
+ as an exercise for the underlying OS */
+#if 0
/* Strip double (back)slashes */
if (local_open_basedir_pos > 0) {
while ((
@@ -145,7 +147,7 @@
local_open_basedir[local_open_basedir_pos--] =
0;
}
}
-
+#endif
} else {
/* Else use the unmodified path */
strcpy(local_open_basedir, basedir);
--
Regards,
Sascha Schumann |
Consultant | finger sas@schell.de
| for PGP public key
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net