Commit Graph

150 Commits

Author SHA1 Message Date
Sebastian Bergmann
f5426838f9 Fix ZTS build. Fix warning. 2002-09-26 07:30:16 +00:00
Hartmut Holzgraefe
1a2df34d9d fix windows build 2002-09-26 07:15:33 +00:00
Hartmut Holzgraefe
0d815b5713 glob should now be ZTS/open_basedir/safe_mode aware (finally) 2002-09-26 00:27:52 +00:00
foobar
a254506a3c ws fix 2002-09-11 14:21:39 +00:00
Marcus Boerger
149ad05b4f php_error_docref
#New conversion available at: http://docref.txt.marcus-boerger.de
2002-08-24 01:19:28 +00:00
Rasmus Lerdorf
b025bb1023 Missing proto 2002-08-13 05:08:47 +00:00
Rasmus Lerdorf
d820c177bf dir() returns an instantiated object, not a class. 2002-08-13 04:24:15 +00:00
Edin Kadribasic
a55c1228ed Fixed bug #14657 (patch by Steph Fox) 2002-07-29 13:13:50 +00:00
Derick Rethans
728f2de442 Unify error messages 2002-07-08 12:52:22 +00:00
Edin Kadribasic
544694255a Added glob() support for windows. 2002-05-19 14:32:24 +00:00
Markus Fischer
25a616d7aa - Fix portability issues with empty results on Linux and FreeBSD, add safe_mode
check and simplify code.
# Hartmut, what was the VCWD check for ?!
2002-05-18 13:31:31 +00:00
Wez Furlong
b10b24d50c Always initialize wrappers, regardless of PG(allow_url_fopen).
Add is_url field to wrapper structure; the stream wrapper openers
will disallow opening is is_url && !PG(allow_url_fopen).
Add infrastructure for stat($url) and opendir($url).
Tidy up/centralize code that locates and instantiates wrappers for the
various operations.
Implement opendir for plain files.
Make the PHP opendir and dir functions use the streams implementations.
Add modelines for syntax highlighting the pear scripts in vim
2002-04-16 22:14:27 +00:00
Hartmut Holzgraefe
b00d9a5b2c added fnmatch() and glob() functions
could someone please check if i got the virtual dir stuff right?
2002-03-21 19:18:13 +00:00
James E. Flemer
01505de0b1 (PHP opendir) Changed CHECKUID_ALLOW_ONLY_DIR to CHECKUID_ALLOW_ONLY_FILE
so that relative paths (vs absolute) work correctly.
2002-03-06 18:31:33 +00:00
James E. Flemer
787ce372b9 (PHP opendir) Added safe_mode checks on path.
@- Added safe_mode checks for opendir(). (jflemer)
2002-03-03 20:46:57 +00:00
Sebastian Bergmann
90613d2282 Maintain headers. 2002-02-28 08:29:35 +00:00
Thies C. Arntzen
21cc717bac protos fixes by Wolfgang Drews 2002-01-03 06:57:22 +00:00
Zak Greant
f01745896f chdir: corrected proto, converted to zend_parse_parameters 2001-12-30 10:13:08 +00:00
Zak Greant
59a45acca6 chroot: corrected prototype, converted to zend_parse_parameters 2001-12-30 09:50:41 +00:00
Sebastian Bergmann
38933514e1 Update headers. 2001-12-11 15:32:16 +00:00
Jeroen van Wolffelaar
c033288573 Back-substitute for Z_* macro's. If it breaks some extension (the script isn't optimal, it parses for example var->zval.value incorrect) please let me know. 2001-09-25 21:58:48 +00:00
foobar
5275b60398 Enable chroot() only if SAPI is CGI. 2001-09-12 02:07:46 +00:00
Derick Rethans
78747bd2df - Don't wrap lines... this is annoying while coding. 2001-09-09 13:29:31 +00:00
Zeev Suraski
c0404f4631 Whitespace 2001-08-11 17:03:37 +00:00
Zeev Suraski
bc42c37513 More TSRMLS_FETCH work. Got it under 400 now. 2001-07-31 06:28:05 +00:00
Zeev Suraski
aa1772ca72 More TSRMLS_FETCH annihilation 2001-07-31 05:44:11 +00:00
Zeev Suraski
1c25b8dd53 Avoid TSRMLS_FETCH()'s, and clean up a bit of stale extern's and layout on the way 2001-07-30 01:56:43 +00:00
Andi Gutmans
b99a590be3 - More object macros 2001-07-29 08:14:29 +00:00
Zeev Suraski
d87cc976e1 Redesigned thread safety mechanism - nua nua 2001-07-28 11:36:37 +00:00
Zeev Suraski
fe6f8712a4 - Get rid of ELS_*(), and use TSRMLS_*() instead.
- Move to the new ts_allocate_id() API
This patch is *bound* to break some files, as I must have had typos somewhere.
If you use any uncommon extension, please try to build it...
2001-07-27 10:16:41 +00:00
James E. Flemer
771e3e498f o Fixed Bug #12121: chdir and safe_mode
- [ main/safe_mode.h ] added new checkuid mode:
    CHECKUID_ALLOW_ONLY_FILE: skips directory check if file check
	fails

  - [ ext/standard/dir.c ] changed php_checkuid() to use
    CHECKUID_ALLOW_ONLY_FILE instead of CHECKUID_ALLOW_ONLY_DIR

  - [ main/safe_mode.c ] added code for new checkuid mode

o Fixed Bug #12119: safe mode owner check can be bypassed with symlink
  - [ main/safe_mode.c ] use VCWD_REALPATH to resolve destination
    of symlink before trimming filename

o New Feature: safe_mode_include_dir (php.ini directive)
  - Allows bypassing UID/GID checks when including files
    from the directory in safe_mode_include_dir and its
	subdirectories. (safe_mode must be on, directory must
	also be in include_path or full path must be used when
	including)

o Fixed Feature: safe_mode_gid (php.ini directive)
  - Correctly check (and report) UID/GID bits on directories

o Changed include() fall back to scripts cwd implementation
  - CWD added to the (local) search path in php_fopen_with_path()
    instead of seperate case. [ main/fopen_wrappers.c ]
2001-07-13 18:21:21 +00:00
Thies C. Arntzen
03ae0d775b add PLS_FETCH(); 2001-06-20 15:46:47 +00:00
Rasmus Lerdorf
94897efc36 Fix for #11570 2001-06-20 14:47:26 +00:00
Rasmus Lerdorf
81e2cf03ac Fix folding and clean up some extensions 2001-06-06 13:06:12 +00:00
Rasmus Lerdorf
25c3a3a39d vim-6 does folding - clean up a bunch of missing folding tags plus
some misguided RINIT and RSHUTDOWN calls in a few fringe extensions
2001-06-05 13:12:10 +00:00
Andi Gutmans
4c823e8a89 - Change macros from V_ to VCWD_ because of AIX name clash 2001-04-30 12:45:02 +00:00
Andi Gutmans
91451bfcaf - Remove leak from opendir() under Windows. Maybe readdir.c should be
changed to use emalloc()
PR:
Submitted by:
Reviewed by:
Obtained from:
2001-04-29 18:06:56 +00:00
Andi Gutmans
21603118b1 - Fix bug Bug id #5987. It could be fixed by changing readdir.c but I
- prefered not to touch that code but to treat windows a bit differently
- in dir.c
PR:
Submitted by:
Reviewed by:
Obtained from:
2001-04-29 17:57:23 +00:00
Sean Bright
b936138fd3 Constand should be case sensitive.
# Thanks Sterling
2001-04-09 21:12:54 +00:00
Jon Parise
5464d29551 Fix whitespace (use tabs). 2001-04-09 21:08:47 +00:00
Sean Bright
ec6f1887f8 Stop SIGSEGV on Apache startup. Patch from <adam@indexdata.dk> 2001-04-09 20:56:49 +00:00
Stig Bakken
368c6bf003 @Add DIRECTORY_SEPARATOR constant ('/' on UNIX, '\' on Windows) (Stig) 2001-04-08 21:57:13 +00:00
Andi Gutmans
eb6ba01d1c - Fix copyright notices with 2001 2001-02-26 06:11:02 +00:00
Sascha Schumann
c2fb53bed7 Finish fopen-wrappers rename. 2001-02-23 22:07:16 +00:00
Sascha Schumann
637e8e14aa There might be more systems which do not support chroot, so we check
for the existence of it.

Additionally, if chroot is not supported, the warn_not_available function
is invoked now.
2001-02-15 05:21:27 +00:00
Derick Rethans
8cef8a9ca1 - chroot does not work on windows 2001-02-15 00:43:44 +00:00
Derick Rethans
2648283b5b - Added an extra chdir("/"); as sugested by Sascha 2001-02-14 11:02:54 +00:00
Derick Rethans
4a54a15fc6 - Added the chroot function for changing root in a script.
#- This can be usefull when using PHP in a shell environment, or when PHP
#  runs as CGI which needs a little more security
2001-02-14 10:48:48 +00:00
Andi Gutmans
86a1cace27 - Make all places use MAXPATHLEN in the same way. It includes the
terminating NULL.
2000-12-16 20:52:43 +00:00
Sascha Schumann
4ada3dd3a0 Hardcode all functions which are mentioned in the Large File Support Spec
http://ewe3.sas.com/standards/large.file/specs/api+.007.html
2000-12-07 12:09:38 +00:00
Andi Gutmans
e314da896f - Fix build 2000-11-04 17:15:00 +00:00
Thies C. Arntzen
b80e71fdac fix #7573
closedir() now really close the directory - used to stay open 'cause the
default-directory resource was "remembered" for arg-less calls.
2000-11-04 14:58:50 +00:00
Thies C. Arntzen
825457ae64 update my email. 2000-10-29 09:14:55 +00:00
Andrei Zmievski
f1dcb32c9f Use zend_register_list_destructors_ex() instead. 2000-10-25 17:44:02 +00:00
Andrei Zmievski
7b4983c8f8 Mega-patch to get better resource information for modules.
* Fixed a bug in zend_rsrc_list_get_rsrc_type()
  * Switched register_list_destructors() to use
    zend_register_list_destructors_ex() instead
  * Updated all relevant modules to provide the resource type name
    to register_list_destructors() call
  * Updated var_dump() to output resource type name instead of number

@- Made resource type names visible, e.g. var_dump() and
@  get_resource_type() display "file" for file resources. (Andrei)
2000-10-20 18:25:16 +00:00
foobar
7a54e0b10c Fixed crash (bus error) in readdir() and session cleanup when compiled
with Sun CC.
2000-10-18 14:14:14 +00:00
Stanislav Malyshev
662c6c6c06 Fix readdir bug in libc5
@Fix readdir bug in libc5
# If libc5 receives 0 in *result of readdir_r, it just returns error
# That's a clear bug, so this is a workaround.
2000-09-07 17:55:53 +00:00
Zeev Suraski
e065c308e9 - Fix dir.c
- Begin cleanup of php_error_cb()
2000-09-01 12:06:52 +00:00
Sascha Schumann
d60799bf6b Solaris/x86 insists of having a large buffer for storing the result of
readdir_r(), otherwise it will segfault.

PR: #6479
2000-09-01 09:38:19 +00:00
Zeev Suraski
7fb72c1726 Fixed opendir() thoroughly 2000-06-29 21:51:40 +00:00
Zeev Suraski
c860633741 Fixed a bug in opendir(), which prevented readdir() from working properly if
the $dir argument wasn't explicitly specified
2000-06-27 18:44:30 +00:00
Andi Gutmans
6ce07a85e4 - Change register_internal_class to zend_register_internal_class for
- consistency.
- Andrei: I'm still thinking about the _ex you want me to implement
2000-06-09 08:41:59 +00:00
Andi Gutmans
3701bc4207 - ARG_COUNT(ht) -> ZEND_NUM_ARGS() mega patch 2000-06-05 19:47:54 +00:00
Zeev Suraski
4a1da8b6f9 Fix Win32 build 2000-06-04 22:00:17 +00:00
Stanislav Malyshev
5af7dff758 add opendir to VIRTUAL_DIR 2000-06-04 08:29:11 +00:00
Stanislav Malyshev
7f158268aa chdir returns 0 on success, compare against it 2000-06-04 07:57:40 +00:00
Sascha Schumann
2aaa538aef Use reentrant version of readdir. If the target platform does not support
the POSIX-like readdir_r, we fall back to readdir. In ZTS mode, this will
cause php_readdir_r calls to be serialized.
2000-05-23 15:13:16 +00:00
Zeev Suraski
e043439ff6 Update the license with the new clause 6 2000-05-18 15:34:45 +00:00
Andi Gutmans
c9911a151e - Change PHP_ to V_ (directory & file functions) 2000-04-15 14:28:48 +00:00
Andi Gutmans
9c3d6304dd - Hopefully got most of them. We also need a chdir_file function like
for Apache.
2000-03-30 22:56:34 +00:00
Stig Bakken
99e0b36321 @Cleaned up extension namespace (Stig)
Cleaned up extension namespace, and changed ext/standard into one single
extension.
2000-03-06 20:37:11 +00:00
Thies C. Arntzen
88b903da66 zorro does a Z - egon does an e? 2000-02-24 09:32:50 +00:00
Egon Schmid
3b5efa05f7 More protos. 2000-02-24 07:49:43 +00:00
Zeev Suraski
86fa2aade2 the pipe is breaking all the time 2000-02-19 23:41:32 +00:00
Zeev Suraski
80bdd19e03 Fine tune Andi's patch 2000-02-11 15:59:30 +00:00
Andi Gutmans
29280bb9ec - Get rid of some more evil MSVC5's and switch standard/ to use PHP_WIN32 2000-02-10 21:53:56 +00:00
Sascha Schumann
43ae2bffbb Happy Y2K patch! Happy new year (or the new millennium, depending on whether
you start counting at 0 or 1).
2000-01-01 01:32:05 +00:00
Zeev Suraski
a1ad2872ee - The tree compiles again 1999-12-18 22:40:35 +00:00
Zeev Suraski
3ee4e65c95 More php3_ annihilation 1999-12-18 04:01:20 +00:00
Zeev Suraski
fb1c77bd4f - Made PHP_VERSION and PHP_OS work again
- More php3_ cleanup
@- Restored the PHP_VERSION and PHP_OS constants (Zeev)
1999-12-17 20:55:31 +00:00
Zeev Suraski
a3c6514332 More php3_ annihilation 1999-12-17 19:51:39 +00:00
Zeev Suraski
02d3b39420 More php3_ annihilation 1999-12-17 19:16:50 +00:00
Sascha Schumann
4a60eed469 Fix some warnings 1999-12-05 16:25:32 +00:00
Sascha Schumann
5b983c944f Clean up php3.*\.h files. The files itself are renamed, and references in all
.*\.[ch] files were changed. There is a slight chance that my script missed
a few changes, please correct them manually.
1999-12-04 19:19:57 +00:00
Andi Gutmans
5212b2fe5b - Make CVS compile on Win32.
- Rename php3_COM.h -> php_COM.h
1999-10-20 18:09:44 +00:00
Thies C. Arntzen
33ebd52387 (PHP getcwd()) added, needs to porting to Win32
@- added getcwd() function. (Thies)
# as we do have chdir() now we have getcwd() - i think we *should* restore the
# working directory in RSHUTDOWN!
1999-10-20 16:17:30 +00:00
Sascha Schumann
d71eb7bbe6 Fix typo (xml_globals => dir_globals) 1999-10-05 16:18:40 +00:00
Thies C. Arntzen
35e7bcbb9d dir modules is now resourcified & thread-safe! 1999-10-05 14:36:00 +00:00
Andi Gutmans
14d9a59f1c - Make dir functions compile in Win32
- Fix too early memory manager initialization (For you Thies)
1999-09-05 19:04:40 +00:00
Andi Gutmans
aeec4e198a - Fixed memory leaks. tsrm resource id deallocation still needs to be implemented. 1999-08-19 16:52:53 +00:00
Zeev Suraski
3cb1eb0471 Removed '3' from key functions in PHP (maintained compatibility through
php3_compat.h)
1999-08-02 19:17:14 +00:00
Andrey Hristov
1b2c932cc2 More symbol work.
I've defined a few macros to help with module/request init/startup function definitions.
Basically:

PHP_MINIT_FUNCTION(module)
PHP_MSHUTDOWN_FUNCTION(module)
PHP_RINIT_FUNCTION(module)
PHP_RSHUTDOWN_FUNCTION(module)
PHP_MINFO_FUNCTION(module)

These will expand to proper function prototypes.

Now to specify these in the module entry, use:

PHP_MINIT(module)
PHP_MSHUTDOWN(module)
PHP_RINIT(module)
PHP_RSHUTDOWN(module)
PHP_MINFO(module)

I've updated all modules in ext/standard and everything from ext/apache to ext/db.
If you can, please update your module to use these macros.
1999-07-26 20:09:08 +00:00
Andrey Hristov
736f4831a5 A bunch of grunt work updating function entries and declarations. 1999-07-24 22:16:54 +00:00
Zeev Suraski
c5724cbd14 License update 1999-07-16 13:13:16 +00:00
Stig Bakken
117a2fba07 * fixed some #if/#ifdef issues
* hand-patched in php3 changes from 3.0.6 to HEAD in these files:
   fopen-wrappers.[ch] ext/standard/file.[ch] ext/standard/fsock.[ch]
   ext/standard/php3_string.h ext/standard/string.c
* added some new file/socket macros for more readable code:
   FP_FGETS(buf,len,sock,fp,issock)
   FP_FREAD(buf,len,sock,fp,issock)
   FP_FEOF(sock,fp,issock)
   FP_FGETC(sock,fp,issock)
1999-06-16 17:06:53 +00:00
Zeev Suraski
7a167cd0c1 * Use new Zend macros for standardized definition of classes.
* Reverse bogus shutdown order.
* Use the new object/class support of Zend to make the dir functions work again.
1999-05-28 11:09:39 +00:00
Sascha Schumann
39691bed9e conv_proto *.[ch] 1999-05-16 11:19:26 +00:00
Zeev Suraski
0818d96c97 A lot of cleanups... Removed old thread-safe code and other redundant code and files 1999-04-24 00:12:00 +00:00
Zeev Suraski
6f7c0edee3 Remove tls.[ch] 1999-04-23 20:06:01 +00:00
Stig Bakken
257de2bade First commit of re-structuring phase one. We have started using automake in
sub-directories and started to move extension code into ext/<name>.  For now,
I have moved the "standard" extension (which is quite a mix of everything
right now) and the GD extension into their own subdirs in ext/.
The configure script now also runs configure in the libzend directory
automatically and makes sure php4 and libzend use the same config.cache file.
To avoid running configure in libzend, use the --no-recursion option.
"make" in php4 also builds libzend now.
The Apache module doesn't compile right now, but a fix for that is
coming up.
1999-04-17 00:37:12 +00:00