Commit Graph

123 Commits

Author SHA1 Message Date
Sascha Schumann
5a83ad6dc1 Set the close-on-exec flag for fds. Child processes should not inherit
the fd.

Also rip out the broken O_EXCL use.  Our file names are not unique and
this left a small window open where creating a session file would fail
(a, b notice that the file does not exist; a creates the file successfully;
 b tries to create, but fails due to O_EXCL).
2002-04-22 20:39:24 +00:00
Sascha Schumann
8141c7761c Merge in session API changes (carry around tsrm context)
Now PHP_SESSION_API is defined to the date of the last change,
so that externa source-code can handle changes more gracefully.
2002-03-06 11:49:51 +00:00
Sascha Schumann
ca59cb7cf9 Weep out all recent commits of Yasuo.
I don't have time right now to leave in the good ones and remove
only the bad ones.

There are some semantical changes which I reject, because
they aim at fixing a bug which is at a completely other location.

Then SID does not gefined anymore properly. (This broken patch
has not been sent to me at all.)

Also, there were *so* many whitespace changes which already
make these commits bogus.
2002-03-06 09:02:31 +00:00
Yasuo Ohgaki
0010418ea7 Fix crash bug #14232 2002-03-06 07:49:49 +00:00
Yasuo Ohgaki
4042334882 Remove TSRMLS_FETCH() and use TSRMLS_C/TSRMLS_D
# Need a little more work for backword compatibility
2002-03-06 00:05:21 +00:00
Sebastian Bergmann
90613d2282 Maintain headers. 2002-02-28 08:29:35 +00:00
Yasuo Ohgaki
bd32363e2f Revert last commit. Last patch has problem for the 1st request.
# I also found what's wrong in mod_mm.c  :)
# I'll fix it later since don't have much time now.
2002-02-03 05:40:19 +00:00
Yasuo Ohgaki
4c6e58ac59 Fixed crash when save_path is invalid.
Fixed crash when user save handler is incorrectly used.
Fixed crash when session read failed.
2002-02-03 03:17:35 +00:00
Sebastian Bergmann
38933514e1 Update headers. 2001-12-11 15:32:16 +00:00
Derick Rethans
78747bd2df - Don't wrap lines... this is annoying while coding. 2001-09-09 13:29:31 +00:00
Zeev Suraski
1159c84ab7 - TSRMLS_FETCH work
- whitespace fixes
2001-08-05 01:43:02 +00:00
Harald Radi
22790c9602 removed warnings 2001-06-10 23:26:35 +00:00
Rasmus Lerdorf
9c55882133 Fold a bit more code 2001-06-06 14:32:27 +00:00
Sterling Hughes
db305fc6f7 small ws fix. 2001-05-30 20:16:23 +00:00
Sterling Hughes
28160f73d0 Revert as per Herr Schumann's request. 2001-05-30 19:56:11 +00:00
Sterling Hughes
506ceb28fc Try #2
# aka, flying blind in a shitstorm, but it shouldn't hurt anything
2001-05-30 19:43:27 +00:00
Sterling Hughes
948edd322b should fix warnings under winblows. 2001-05-30 18:33:46 +00:00
Sascha Schumann
90c2979144 Nuke some warnings. 2001-05-13 07:37:28 +00:00
Sascha Schumann
8a3eb51a26 Replace ssize_t with long, as Win32 lacks proper support for that type. 2001-05-12 08:39:33 +00:00
Sascha Schumann
814fa2c71c Save a couple of syscalls per session
Fix apparent new-session-files-were-not-locked bug

Replace %m with portable "%s", strerror(errno)
2001-05-11 17:43:40 +00:00
Andi Gutmans
4c823e8a89 - Change macros from V_ to VCWD_ because of AIX name clash 2001-04-30 12:45:02 +00:00
Sascha Schumann
86cf74a169 Nuke calls to sprintf, snprintf, strcat, strcpy and rely on
memcpy and smart_strs.
2001-03-13 16:53:34 +00:00
Andi Gutmans
eb6ba01d1c - Fix copyright notices with 2001 2001-02-26 06:11:02 +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
Sascha Schumann
7c0ba95806 fix indentation 2000-10-17 02:50:15 +00:00
Daniel Beulshausen
4086197d95 fixes bug 7055 & 7235 2000-10-16 10:35:43 +00:00
Sascha Schumann
bd616da7ca Libc5-readdir_r workaround 2000-09-11 15:24:28 +00:00
Sascha Schumann
5bbddee81e Rename symbols whose first character was an underscore. 2000-09-06 14:16:12 +00:00
Stanislav Malyshev
20a6474eae Fix crash
# This is getting worse... Seems that more work is needed
2000-09-05 19:29:03 +00:00
Sascha Schumann
d11012e2c9 s/PATH_MAX/MAXPATHLEN/ 2000-09-01 15:47:53 +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
30ccec36b9 Fix build 2000-08-20 22:18:19 +00:00
Sascha Schumann
c8b8a908ca Provide PHP_SEPARATOR which expands to the default directory separator
on the target platform.
2000-08-20 14:02:57 +00:00
Stanislav Malyshev
682c58c26f Open session files in binary mode (fix #5953)
@- Fixed \n in session variables bug on Win32 (Stas)
2000-08-05 10:25:00 +00:00
Sascha Schumann
c917e170f6 Always use the current DIR_DELIMITER to create the session file path 2000-07-11 12:29:19 +00:00
Sascha Schumann
e8101d4f7b Unify use of my email address 2000-07-10 10:09:15 +00:00
Sascha Schumann
277b0e15b8 (PHP session_destroy) return the error condition from storage handler's
session_destroy method.

Submitted by: juhl@eisenstein.dk
2000-07-05 01:26:22 +00:00
Zeev Suraski
4a1da8b6f9 Fix Win32 build 2000-06-04 22:00:17 +00:00
Andi Gutmans
8c82566b48 - Fix problem in sessions module under Win32. Need to use ; as an options
- delimiter in save_path instead of :.
2000-05-27 16:38:49 +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
Andi Gutmans
521f03c184 - Support virtual unlink() 2000-05-23 14:36:27 +00:00
Zeev Suraski
e043439ff6 Update the license with the new clause 6 2000-05-18 15:34:45 +00:00
Sascha Schumann
6baa5bc2dc Complain, if write(2) failed. 2000-05-15 13:50:39 +00:00
Andi Gutmans
5d5b09e1a7 - Change some open's to V_OPEN()'s 2000-04-30 19:01:17 +00:00
Zeev Suraski
883bd2b1de - Fix virtual cwd bug
- Add more V_STAT() V_LSTAT() changes
2000-04-20 17:24:01 +00:00
Sascha Schumann
af9a852bf1 Improved error messages 2000-03-29 20:37:12 +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
Sascha Schumann
12d3e3d775 More cosmetic things 2000-02-11 13:41:30 +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
Sascha Schumann
cb45c2ea55 Use zend_sprintf by default (which is defined to sprintf, if the system's
sprintf is useable).
1999-12-19 14:39:41 +00:00
Sascha Schumann
63d4411560 Use workaround function for sprintf, if the return value of sprintf is needed 1999-12-19 02:12:31 +00:00
Sascha Schumann
75db7e91c6 (_ps_files_path_create) terminate string correctly and append the whole key instead of the rest key 1999-12-13 15:55:49 +00:00
Andrei Zmievski
99df46fa62 Include errno.h.
# Please try compiling before committing
1999-12-03 17:05:23 +00:00
Sascha Schumann
2e024a0005 Improve locking when O_EXCL is available 1999-12-03 16:19:38 +00:00
Sascha Schumann
31f38edf35 (_ps_files_valid_key): small logic fix 1999-10-21 18:51:57 +00:00
Sascha Schumann
4703eb404d (_ps_files_open): evaluate key (session id) before path creation 1999-10-21 12:28:36 +00:00
Sascha Schumann
533ef3988b - support for external entropy sources
- extern_referer_chk => extern_referer_check
- kill a warning in mod_files.c
1999-09-11 17:20:31 +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
Sascha Schumann
7e70c1ad91 cleanup 1999-09-04 08:33:31 +00:00
Sascha Schumann
7e50dda96b implement single directory garbage collector 1999-09-04 08:20:43 +00:00
Sascha Schumann
49824ee8cb - fix potential buffer problem in send_cookie
- fix gc probability algorithm
- don't access mod_data directly
- initial version of mm support for session data storage

  This works pretty good, but we need to create the initial mm pool
  from the parent process/thread. Still looking for a clean way to do that.
1999-08-27 21:03:22 +00:00
Sascha Schumann
1dd31c38a6 - cleanup code
- add script which creates the directory tree for better scaling
  of mod_files

I have to decide yet whether we implement the garbage collection in the
module or if we simply let the user do

find path -ctime +1 | xargs rm
1999-08-22 14:14:46 +00:00
Sascha Schumann
02d6ec2a6b Use O_EXCL where possible. 1999-08-22 13:43:23 +00:00
Zeev Suraski
c5724cbd14 License update 1999-07-16 13:13:16 +00:00
Sascha Schumann
30c131c8ae that should be included 1st 1999-07-15 19:43:26 +00:00
Zeev Suraski
dbb24c2e0e *** empty log message *** 1999-07-03 23:43:02 +00:00
Sascha Schumann
c56116029d add missing include 1999-07-03 19:08:03 +00:00
Zeev Suraski
1798a0183a * Fix a buglet in the session module
* Make some renames in the session module - avoid having a function called 'delete'
  so that we don't piss any C++ compilers.  Also rename the {startup,shutdown}_globals
  to {startup,shutdown}_session_globals, so that they're a bit less general names,
  and made them static.
* Remove uselss variables
1999-06-11 09:23:00 +00:00
Sascha Schumann
4b023c157a better scaling for large servers using many session ids 1999-06-07 19:51:54 +00:00
Sascha Schumann
d8a9548cb2 - some cleanups
- add gc logic
- add session_destroy()
1999-06-07 16:43:24 +00:00
Zeev Suraski
34b3dc9b47 - Fix PSLS issues
- Add a standard info function for the session module (use them!)
- Replace PATH_MAX with MAXPATHLEN (that's our platform indepedent constant)
1999-06-06 19:53:59 +00:00
Sascha Schumann
a1b42e3f5e first import of session module 1999-06-05 19:52:58 +00:00