Skip to content

Commit 2104bea

Browse files
committed
Remove Netware support
If this does not break the Unix system somehow, I'll be amazed. This should get most of it out, apologies for any errors this may cause on non-Windows ends which I cannot test atm.
1 parent b309308 commit 2104bea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+90
-635
lines changed

NEWS

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ PHP NEWS
44

55
- Core:
66
. Removed the sql.safe_mode directive. (Kalle)
7+
. Removed support for Netware. (Kalle)
78
. Fixed bug #54535 (WSA cleanup executes before MSHUTDOWN). (Kalle)
89
. Implemented FR #69791 (Disallow mail header injections by extra headers)
910
(Yasuo)

TSRM/TSRM.c

-12
Original file line numberDiff line numberDiff line change
@@ -318,15 +318,6 @@ TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id)
318318
int hash_value;
319319
tsrm_tls_entry *thread_resources;
320320

321-
#ifdef NETWARE
322-
/* The below if loop is added for NetWare to fix an abend while unloading PHP
323-
* when an Apache unload command is issued on the system console.
324-
* While exiting from PHP, at the end for some reason, this function is called
325-
* with tsrm_tls_table = NULL. When this happened, the server abends when
326-
* tsrm_tls_table is accessed since it is NULL.
327-
*/
328-
if(tsrm_tls_table) {
329-
#endif
330321
if (!th_id) {
331322
/* Fast path for looking up the resources for the current
332323
* thread. Its used by just about every call to
@@ -380,9 +371,6 @@ TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id)
380371
* changes to the structure as we read it.
381372
*/
382373
TSRM_SAFE_RETURN_RSRC(thread_resources->storage, id, thread_resources->count);
383-
#ifdef NETWARE
384-
} /* if(tsrm_tls_table) */
385-
#endif
386374
}
387375

388376
/* frees an interpreter context. You are responsible for making sure that

TSRM/tsrm_config_common.h

-2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@
2525
#pragma alloca
2626
# else
2727
# ifndef alloca /* predefined by HP cc +Olibcalls */
28-
# ifndef NETWARE
2928
char *alloca ();
30-
# endif
3129
# endif
3230
# endif
3331
# endif

UPGRADING

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ PHP 7.2 UPGRADE NOTES
2424
closed resources.
2525
. is_object() will now return true for objects of class
2626
__PHP_Incomplete_Class.
27+
. Support for Netware operating systems have been removed.
2728

2829
========================================
2930
2. New Features

Zend/configure.in

-13
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,6 @@ int zend_sprintf(char *buffer, const char *format, ...);
6262

6363
#include <math.h>
6464

65-
/* To enable the is_nan, is_infinite and is_finite PHP functions */
66-
#ifdef NETWARE
67-
#define HAVE_ISNAN 1
68-
#define HAVE_ISINF 1
69-
#define HAVE_ISFINITE 1
70-
#endif
71-
7265
#ifndef zend_isnan
7366
#ifdef HAVE_ISNAN
7467
#define zend_isnan(a) isnan(a)
@@ -102,12 +95,6 @@ int zend_sprintf(char *buffer, const char *format, ...);
10295

10396
#endif /* ifndef ZEND_ACCONFIG_H_NO_C_PROTOS */
10497

105-
#ifdef NETWARE
106-
#ifdef USE_WINSOCK
107-
#/*This detection against winsock is of no use*/ undef HAVE_SOCKLEN_T
108-
#/*This detection against winsock is of no use*/ undef HAVE_SYS_SOCKET_H
109-
#endif
110-
#endif
11198
])
11299

113100
dnl We want this one before the checks, so the checks can modify CFLAGS.

Zend/zend_API.c

-2
Original file line numberDiff line numberDiff line change
@@ -2518,12 +2518,10 @@ void module_destructor(zend_module_entry *module) /* {{{ */
25182518
}
25192519

25202520
#if HAVE_LIBDL
2521-
#if !(defined(NETWARE) && defined(APACHE_1_BUILD))
25222521
if (module->handle && !getenv("ZEND_DONT_UNLOAD_MODULES")) {
25232522
DL_UNLOAD(module->handle);
25242523
}
25252524
#endif
2526-
#endif
25272525
}
25282526
/* }}} */
25292527

Zend/zend_compile.c

-27
Original file line numberDiff line numberDiff line change
@@ -1879,22 +1879,6 @@ ZEND_API size_t zend_dirname(char *path, size_t len)
18791879
return len;
18801880
}
18811881
}
1882-
#elif defined(NETWARE)
1883-
/*
1884-
* Find the first occurrence of : from the left
1885-
* move the path pointer to the position just after :
1886-
* increment the len_adjust to the length of path till colon character(inclusive)
1887-
* If there is no character beyond : simple return len
1888-
*/
1889-
char *colonpos = NULL;
1890-
colonpos = strchr(path, ':');
1891-
if (colonpos != NULL) {
1892-
len_adjust = ((colonpos - path) + 1);
1893-
path += len_adjust;
1894-
if (len_adjust == len) {
1895-
return len;
1896-
}
1897-
}
18981882
#endif
18991883

19001884
if (len == 0) {
@@ -1919,20 +1903,9 @@ ZEND_API size_t zend_dirname(char *path, size_t len)
19191903
}
19201904
if (end < path) {
19211905
/* No slash found, therefore return '.' */
1922-
#ifdef NETWARE
1923-
if (len_adjust == 0) {
1924-
path[0] = '.';
1925-
path[1] = '\0';
1926-
return 1; /* only one character */
1927-
} else {
1928-
path[0] = '\0';
1929-
return len_adjust;
1930-
}
1931-
#else
19321906
path[0] = '.';
19331907
path[1] = '\0';
19341908
return 1 + len_adjust;
1935-
#endif
19361909
}
19371910

19381911
/* Strip slashes which came before the file name */

Zend/zend_portability.h

+1-4
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@
3838
#ifdef ZEND_WIN32
3939
# include "zend_config.w32.h"
4040
# define ZEND_PATHS_SEPARATOR ';'
41-
#elif defined(NETWARE)
42-
# include <zend_config.h>
43-
# define ZEND_PATHS_SEPARATOR ';'
4441
#elif defined(__riscos__)
4542
# include <zend_config.h>
4643
# define ZEND_PATHS_SEPARATOR ';'
@@ -338,7 +335,7 @@ char *alloca();
338335

339336
#endif
340337

341-
#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(NETWARE)) && !(defined(ZTS) && defined(HPUX)) && !defined(DARWIN)
338+
#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS)) && !(defined(ZTS) && defined(HPUX)) && !defined(DARWIN)
342339
# define ZEND_ALLOCA_MAX_SIZE (32 * 1024)
343340
# define ALLOCA_FLAG(name) \
344341
zend_bool name;

Zend/zend_stream.c

-9
Original file line numberDiff line numberDiff line change
@@ -156,16 +156,7 @@ static size_t zend_stream_read(zend_file_handle *file_handle, char *buf, size_t
156156
int c = '*';
157157
size_t n;
158158

159-
#ifdef NETWARE
160-
/*
161-
c != 4 check is there as fread of a character in NetWare LibC gives 4 upon ^D character.
162-
Ascii value 4 is actually EOT character which is not defined anywhere in the LibC
163-
or else we can use instead of hardcoded 4.
164-
*/
165-
for (n = 0; n < len && (c = zend_stream_getc(file_handle)) != EOF && c != 4 && c != '\n'; ++n) {
166-
#else
167159
for (n = 0; n < len && (c = zend_stream_getc(file_handle)) != EOF && c != '\n'; ++n) {
168-
#endif
169160
buf[n] = (char)c;
170161
}
171162
if (c == '\n') {

Zend/zend_virtual_cwd.c

+7-69
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@
5353
# endif
5454
#endif
5555

56-
#ifdef NETWARE
57-
#include <fsio.h>
58-
#endif
59-
6056
#ifndef HAVE_REALPATH
6157
#define realpath(x,y) strcpy(y,x)
6258
#endif
@@ -65,8 +61,8 @@
6561

6662
#include "TSRM.h"
6763

68-
/* Only need mutex for popen() in Windows and NetWare because it doesn't chdir() on UNIX */
69-
#if (defined(ZEND_WIN32) || defined(NETWARE)) && defined(ZTS)
64+
/* Only need mutex for popen() in Windows because it doesn't chdir() on UNIX */
65+
#if defined(ZEND_WIN32) && defined(ZTS)
7066
MUTEX_T cwd_mutex;
7167
#endif
7268

@@ -407,23 +403,12 @@ CWD_API void virtual_cwd_startup(void) /* {{{ */
407403
char cwd[MAXPATHLEN];
408404
char *result;
409405

410-
#ifdef NETWARE
411-
result = getcwdpath(cwd, NULL, 1);
412-
if(result)
413-
{
414-
char *c=cwd;
415-
while(c = strchr(c, '\\'))
416-
{
417-
*c='/';
418-
++c;
419-
}
420-
}
421-
#else
406+
422407
#ifdef ZEND_WIN32
423408
ZeroMemory(&cwd, sizeof(cwd));
424409
#endif
425410
result = getcwd(cwd, sizeof(cwd));
426-
#endif
411+
427412
if (!result) {
428413
cwd[0] = '\0';
429414
}
@@ -442,7 +427,7 @@ CWD_API void virtual_cwd_startup(void) /* {{{ */
442427
cwd_globals_ctor(&cwd_globals);
443428
#endif
444429

445-
#if (defined(ZEND_WIN32) || defined(NETWARE)) && defined(ZTS)
430+
#if (defined(ZEND_WIN32)) && defined(ZTS)
446431
cwd_mutex = tsrm_mutex_alloc();
447432
#endif
448433
}
@@ -453,7 +438,7 @@ CWD_API void virtual_cwd_shutdown(void) /* {{{ */
453438
#ifndef ZTS
454439
cwd_globals_dtor(&cwd_globals);
455440
#endif
456-
#if (defined(ZEND_WIN32) || defined(NETWARE)) && defined(ZTS)
441+
#if (defined(ZEND_WIN32)) && defined(ZTS)
457442
tsrm_mutex_free(cwd_mutex);
458443
#endif
459444

@@ -1054,11 +1039,6 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
10541039
return -1;
10551040
}
10561041
}
1057-
1058-
#elif defined(NETWARE)
1059-
save = 0;
1060-
tmp = do_alloca(len+1, use_heap);
1061-
memcpy(tmp, path, len+1);
10621042
#else
10631043
if (save && php_sys_lstat(path, &st) < 0) {
10641044
if (use_realpath == CWD_REALPATH) {
@@ -1296,18 +1276,6 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
12961276
resolved_path[2] = DEFAULT_SLASH;
12971277
start = 3;
12981278
}
1299-
#elif defined(NETWARE)
1300-
if (IS_ABSOLUTE_PATH(resolved_path, path_length)) {
1301-
/* skip VOLUME name */
1302-
start = 0;
1303-
while (start != ':') {
1304-
if (resolved_path[start] == 0) return -1;
1305-
start++;
1306-
}
1307-
start++;
1308-
if (!IS_SLASH(resolved_path[start])) return -1;
1309-
resolved_path[start++] = DEFAULT_SLASH;
1310-
}
13111279
#endif
13121280

13131281
add_slash = (use_realpath != CWD_REALPATH) && path_length > 0 && IS_SLASH(resolved_path[path_length-1]);
@@ -1595,7 +1563,7 @@ CWD_API int virtual_chmod(const char *filename, mode_t mode) /* {{{ */
15951563
}
15961564
/* }}} */
15971565

1598-
#if !defined(ZEND_WIN32) && !defined(NETWARE)
1566+
#if !defined(ZEND_WIN32)
15991567
CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group, int link) /* {{{ */
16001568
{
16011569
cwd_state new_state;
@@ -1842,36 +1810,6 @@ CWD_API FILE *virtual_popen(const char *command, const char *type) /* {{{ */
18421810
return popen_ex(command, type, CWDG(cwd).cwd, NULL);
18431811
}
18441812
/* }}} */
1845-
#elif defined(NETWARE)
1846-
/* On NetWare, the trick of prepending "cd cwd; " doesn't work so we need to perform
1847-
a VCWD_CHDIR() and mutex it
1848-
*/
1849-
CWD_API FILE *virtual_popen(const char *command, const char *type) /* {{{ */
1850-
{
1851-
char prev_cwd[MAXPATHLEN];
1852-
char *getcwd_result;
1853-
FILE *retval;
1854-
1855-
getcwd_result = VCWD_GETCWD(prev_cwd, MAXPATHLEN);
1856-
if (!getcwd_result) {
1857-
return NULL;
1858-
}
1859-
1860-
#ifdef ZTS
1861-
tsrm_mutex_lock(cwd_mutex);
1862-
#endif
1863-
1864-
VCWD_CHDIR(CWDG(cwd).cwd);
1865-
retval = popen(command, type);
1866-
VCWD_CHDIR(prev_cwd);
1867-
1868-
#ifdef ZTS
1869-
tsrm_mutex_unlock(cwd_mutex);
1870-
#endif
1871-
1872-
return retval;
1873-
}
1874-
/* }}} */
18751813
#else /* Unix */
18761814
CWD_API FILE *virtual_popen(const char *command, const char *type) /* {{{ */
18771815
{

Zend/zend_virtual_cwd.h

+3-16
Original file line numberDiff line numberDiff line change
@@ -73,19 +73,6 @@ typedef unsigned short mode_t;
7373
#define IS_ABSOLUTE_PATH(path, len) \
7474
(len >= 2 && (/* is local */isalpha(path[0]) && path[1] == ':' || /* is UNC */IS_SLASH(path[0]) && IS_SLASH(path[1])))
7575

76-
#elif defined(NETWARE)
77-
#ifdef HAVE_DIRENT_H
78-
#include <dirent.h>
79-
#endif
80-
81-
#define DEFAULT_SLASH '/'
82-
#define DEFAULT_DIR_SEPARATOR ';'
83-
#define IS_SLASH(c) ((c) == '/' || (c) == '\\')
84-
#define IS_SLASH_P(c) IS_SLASH(*(c))
85-
/* Colon indicates volume name, either first character should be forward slash or backward slash */
86-
#define IS_ABSOLUTE_PATH(path, len) \
87-
((strchr(path, ':') != NULL) || ((len >= 1) && ((path[0] == '/') || (path[0] == '\\'))))
88-
8976
#else
9077
#ifdef HAVE_DIRENT_H
9178
#include <dirent.h>
@@ -193,7 +180,7 @@ CWD_API int virtual_access(const char *pathname, int mode);
193180
CWD_API int virtual_utime(const char *filename, struct utimbuf *buf);
194181
#endif
195182
CWD_API int virtual_chmod(const char *filename, mode_t mode);
196-
#if !defined(ZEND_WIN32) && !defined(NETWARE)
183+
#if !defined(ZEND_WIN32)
197184
CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group, int link);
198185
#endif
199186

@@ -281,7 +268,7 @@ CWD_API realpath_cache_bucket** realpath_cache_get_buckets(void);
281268
#define VCWD_UTIME(path, time) virtual_utime(path, time)
282269
#endif
283270
#define VCWD_CHMOD(path, mode) virtual_chmod(path, mode)
284-
#if !defined(ZEND_WIN32) && !defined(NETWARE)
271+
#if !defined(ZEND_WIN32)
285272
#define VCWD_CHOWN(path, owner, group) virtual_chown(path, owner, group, 0)
286273
#if HAVE_LCHOWN
287274
#define VCWD_LCHOWN(path, owner, group) virtual_chown(path, owner, group, 1)
@@ -336,7 +323,7 @@ CWD_API realpath_cache_bucket** realpath_cache_get_buckets(void);
336323
# endif
337324
#endif
338325

339-
#if !defined(ZEND_WIN32) && !defined(NETWARE)
326+
#if !defined(ZEND_WIN32)
340327
#define VCWD_CHOWN(path, owner, group) chown(path, owner, group)
341328
#if HAVE_LCHOWN
342329
#define VCWD_LCHOWN(path, owner, group) lchown(path, owner, group)

acinclude.m4

+1-12
Original file line numberDiff line numberDiff line change
@@ -842,10 +842,6 @@ AC_DEFUN([PHP_SHARED_MODULE],[
842842
suffix=so
843843
link_cmd='$(LIBTOOL) --mode=link ifelse($4,,[$(CC)],[$(CXX)]) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$3'/$1.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $($2) $(translit($1,a-z_-,A-Z__)_SHARED_LIBADD) && mv -f '$3'/.libs/$1.so '$3'/$1.so'
844844
;;
845-
*netware*[)]
846-
suffix=nlm
847-
link_cmd='$(LIBTOOL) --mode=link ifelse($4,,[$(CC)],[$(CXX)]) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o [$]@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $($2) ifelse($1, php7lib, , -L$(top_builddir)/netware -lphp7lib) $(translit(ifelse($1, php7lib, $1, m4_substr($1, 3)),a-z_-,A-Z__)_SHARED_LIBADD)'
848-
;;
849845
*[)]
850846
suffix=la
851847
link_cmd='$(LIBTOOL) --mode=link ifelse($4,,[$(CC)],[$(CXX)]) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o [$]@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $($2) $(translit($1,a-z_-,A-Z__)_SHARED_LIBADD)'
@@ -970,14 +966,7 @@ dnl ---------------------------------------------- Static module
970966
dnl ---------------------------------------------- Shared module
971967
[PHP_]translit($1,a-z_-,A-Z__)[_SHARED]=yes
972968
PHP_ADD_SOURCES_X($ext_dir,$2,$ac_extra,shared_objects_$1,yes)
973-
case $host_alias in
974-
*netware*[)]
975-
PHP_SHARED_MODULE(php$1,shared_objects_$1, $ext_builddir, $6, $7)
976-
;;
977-
*[)]
978-
PHP_SHARED_MODULE($1,shared_objects_$1, $ext_builddir, $6, $7)
979-
;;
980-
esac
969+
PHP_SHARED_MODULE($1,shared_objects_$1, $ext_builddir, $6, $7)
981970
AC_DEFINE_UNQUOTED([COMPILE_DL_]translit($1,a-z_-,A-Z__), 1, Whether to build $1 as dynamic module)
982971
fi
983972
fi

0 commit comments

Comments
 (0)