CVS update: php3/functions

From: Date: Fri, 14 Aug 1998 23:47:16 +0000
Subject: CVS update: php3/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-250@lists.php.net to get a copy of this message
Date: Friday August 14, 1998 @ 19:47 Author: steffann Update of /repository/php3/functions In directory asf:/tmp/cvs-serv13204/functions Modified Files: db.c dbase.c dir.c filepro.c filestat.c gd.c image.c info.c zlib.c Log Message: Changed the name of fopen_basedir to open_basedir to be a little more accurate. Index: php3/functions/db.c diff -c php3/functions/db.c:1.75 php3/functions/db.c:1.76 *** php3/functions/db.c:1.75 Fri Jul 31 09:52:40 1998 --- php3/functions/db.c Fri Aug 14 19:47:14 1998 *************** *** 28,34 **** +----------------------------------------------------------------------+ */ ! /* $Id: db.c,v 1.75 1998/07/31 13:52:40 steffann Exp $ */ #if COMPILE_DL #include "dl/phpdl.h" #endif --- 28,34 ---- +----------------------------------------------------------------------+ */ ! /* $Id: db.c,v 1.76 1998/08/14 23:47:14 steffann Exp $ */ #if COMPILE_DL #include "dl/phpdl.h" #endif *************** *** 301,307 **** return NULL; } ! if (_php3_check_fopen_basedir(filename)) { return NULL; } --- 301,307 ---- return NULL; } ! if (_php3_check_open_basedir(filename)) { return NULL; } Index: php3/functions/dbase.c diff -c php3/functions/dbase.c:1.63 php3/functions/dbase.c:1.64 *** php3/functions/dbase.c:1.63 Fri Jul 31 10:46:01 1998 --- php3/functions/dbase.c Fri Aug 14 19:47:15 1998 *************** *** 134,140 **** RETURN_FALSE; } ! if (_php3_check_fopen_basedir(dbf_name->value.str.val)) { RETURN_FALSE; } --- 134,140 ---- RETURN_FALSE; } ! if (_php3_check_open_basedir(dbf_name->value.str.val)) { RETURN_FALSE; } *************** *** 422,428 **** RETURN_FALSE; } ! if (_php3_check_fopen_basedir(filename->value.str.val)) { RETURN_FALSE; } --- 422,428 ---- RETURN_FALSE; } ! if (_php3_check_open_basedir(filename->value.str.val)) { RETURN_FALSE; } Index: php3/functions/dir.c diff -c php3/functions/dir.c:1.52 php3/functions/dir.c:1.53 *** php3/functions/dir.c:1.52 Tue Aug 4 20:33:56 1998 --- php3/functions/dir.c Fri Aug 14 19:47:15 1998 *************** *** 27,33 **** +----------------------------------------------------------------------+ */ ! /* $Id: dir.c,v 1.52 1998/08/05 00:33:56 steffann Exp $ */ #ifdef THREAD_SAFE #include "tls.h" --- 27,33 ---- +----------------------------------------------------------------------+ */ ! /* $Id: dir.c,v 1.53 1998/08/14 23:47:15 steffann Exp $ */ #ifdef THREAD_SAFE #include "tls.h" *************** *** 96,103 **** } convert_to_string(arg); ! /* Check fopen_basedir */ ! if (_php3_check_fopen_basedir(arg->value.str.val)) RETURN_FALSE; dirp = opendir(arg->value.str.val); if (!dirp) { --- 96,103 ---- } convert_to_string(arg); ! /* Check open_basedir */ ! if (_php3_check_open_basedir(arg->value.str.val)) RETURN_FALSE; dirp = opendir(arg->value.str.val); if (!dirp) { *************** *** 243,250 **** } convert_to_string(arg); ! /* Check fopen_basedir */ ! if (_php3_check_fopen_basedir(arg->value.str.val)) RETURN_FALSE; dirp = opendir(arg->value.str.val); if (!dirp) { --- 243,250 ---- } convert_to_string(arg); ! /* Check open_basedir */ ! if (_php3_check_open_basedir(arg->value.str.val)) RETURN_FALSE; dirp = opendir(arg->value.str.val); if (!dirp) { Index: php3/functions/filepro.c diff -c php3/functions/filepro.c:1.32 php3/functions/filepro.c:1.33 *** php3/functions/filepro.c:1.32 Fri Jul 31 10:46:02 1998 --- php3/functions/filepro.c Fri Aug 14 19:47:15 1998 *************** *** 217,223 **** RETURN_FALSE; } ! if (_php3_check_fopen_basedir(workbuf)) { RETURN_FALSE; } --- 217,223 ---- RETURN_FALSE; } ! if (_php3_check_open_basedir(workbuf)) { RETURN_FALSE; } *************** *** 313,319 **** RETURN_FALSE; } ! if (_php3_check_fopen_basedir(workbuf)) { RETURN_FALSE; } --- 313,319 ---- RETURN_FALSE; } ! if (_php3_check_open_basedir(workbuf)) { RETURN_FALSE; } *************** *** 523,529 **** RETURN_FALSE; } ! if (_php3_check_fopen_basedir(workbuf)) { RETURN_FALSE; } --- 523,529 ---- RETURN_FALSE; } ! if (_php3_check_open_basedir(workbuf)) { RETURN_FALSE; } Index: php3/functions/filestat.c diff -c php3/functions/filestat.c:1.74 php3/functions/filestat.c:1.75 *** php3/functions/filestat.c:1.74 Thu Aug 13 14:54:39 1998 --- php3/functions/filestat.c Fri Aug 14 19:47:15 1998 *************** *** 27,33 **** +----------------------------------------------------------------------+ */ ! /* $Id: filestat.c,v 1.74 1998/08/13 18:54:39 rasmus Exp $ */ #ifdef THREAD_SAFE #include "tls.h" #endif --- 27,33 ---- +----------------------------------------------------------------------+ */ ! /* $Id: filestat.c,v 1.75 1998/08/14 23:47:15 steffann Exp $ */ #ifdef THREAD_SAFE #include "tls.h" #endif *************** *** 150,156 **** /* #endif */ /* Check the basedir */ ! if (_php3_check_fopen_basedir(filename->value.str.val)) RETURN_FALSE; ret = chown(filename->value.str.val, -1, gid); if (ret == -1) { --- 150,156 ---- /* #endif */ /* Check the basedir */ ! if (_php3_check_open_basedir(filename->value.str.val)) RETURN_FALSE; ret = chown(filename->value.str.val, -1, gid); if (ret == -1) { *************** *** 194,200 **** } /* Check the basedir */ ! if (_php3_check_fopen_basedir(filename->value.str.val)) RETURN_FALSE; ret = chown(filename->value.str.val, uid, -1); if (ret == -1) { --- 194,200 ---- } /* Check the basedir */ ! if (_php3_check_open_basedir(filename->value.str.val)) RETURN_FALSE; ret = chown(filename->value.str.val, uid, -1); if (ret == -1) { *************** *** 225,231 **** } /* Check the basedir */ ! if (_php3_check_fopen_basedir(filename->value.str.val)) RETURN_FALSE; ret = chmod(filename->value.str.val, mode->value.lval); if (ret == -1) { --- 225,231 ---- } /* Check the basedir */ ! if (_php3_check_open_basedir(filename->value.str.val)) RETURN_FALSE; ret = chmod(filename->value.str.val, mode->value.lval); if (ret == -1) { *************** *** 276,282 **** } /* Check the basedir */ ! if (_php3_check_fopen_basedir(filename->value.str.val)) RETURN_FALSE; /* create the file if it doesn't exist already */ ret = stat(filename->value.str.val, &sb); --- 276,282 ---- } /* Check the basedir */ ! if (_php3_check_open_basedir(filename->value.str.val)) RETURN_FALSE; /* create the file if it doesn't exist already */ ret = stat(filename->value.str.val, &sb); Index: php3/functions/gd.c diff -c php3/functions/gd.c:1.89 php3/functions/gd.c:1.90 *** php3/functions/gd.c:1.89 Tue Aug 4 19:37:31 1998 --- php3/functions/gd.c Fri Aug 14 19:47:15 1998 *************** *** 29,35 **** +----------------------------------------------------------------------+ */ ! /* $Id: gd.c,v 1.89 1998/08/04 23:37:31 steffann Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ --- 29,35 ---- +----------------------------------------------------------------------+ */ ! /* $Id: gd.c,v 1.90 1998/08/14 23:47:15 steffann Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ *************** *** 701,707 **** if (argc == 2) { convert_to_string(file); fn = file->value.str.val; ! if (!fn || fn == empty_string || _php3_check_fopen_basedir(fn)) { php3_error(E_WARNING, "ImageGif: Invalid filename"); RETURN_FALSE; } --- 701,707 ---- if (argc == 2) { convert_to_string(file); fn = file->value.str.val; ! if (!fn || fn == empty_string || _php3_check_open_basedir(fn)) { php3_error(E_WARNING, "ImageGif: Invalid filename"); RETURN_FALSE; } Index: php3/functions/image.c diff -c php3/functions/image.c:1.34 php3/functions/image.c:1.35 *** php3/functions/image.c:1.34 Tue Aug 4 19:37:31 1998 --- php3/functions/image.c Fri Aug 14 19:47:16 1998 *************** *** 26,32 **** | Authors: Rasmus Lerdorf | +----------------------------------------------------------------------+ */ ! /* $Id: image.c,v 1.34 1998/08/04 23:37:31 steffann Exp $ */ /* * Based on Daniel Schmitt's imageinfo.c which carried the following * Copyright notice. --- 26,32 ---- | Authors: Rasmus Lerdorf | +----------------------------------------------------------------------+ */ ! /* $Id: image.c,v 1.35 1998/08/14 23:47:16 steffann Exp $ */ /* * Based on Daniel Schmitt's imageinfo.c which carried the following * Copyright notice. *************** *** 237,244 **** } convert_to_string(arg1); ! /* Check fopen_basedir */ ! if (_php3_check_fopen_basedir(arg1->value.str.val)) return; if ((filehandle = open(arg1->value.str.val, O_RDONLY)) < 0) { php3_error(E_WARNING, "Unable to open %s", arg1->value.str.val); --- 237,244 ---- } convert_to_string(arg1); ! /* Check open_basedir */ ! if (_php3_check_open_basedir(arg1->value.str.val)) return; if ((filehandle = open(arg1->value.str.val, O_RDONLY)) < 0) { php3_error(E_WARNING, "Unable to open %s", arg1->value.str.val); Index: php3/functions/info.c diff -c php3/functions/info.c:1.63 php3/functions/info.c:1.64 *** php3/functions/info.c:1.63 Thu Aug 13 20:25:20 1998 --- php3/functions/info.c Fri Aug 14 19:47:16 1998 *************** *** 147,153 **** PHP3_CONF_STR("doc_root", php3_ini_master.doc_root, php3_ini.doc_root); PHP3_CONF_STR("user_dir", php3_ini_master.user_dir, php3_ini.user_dir); PHP3_CONF_LONG("safe_mode", php3_ini_master.safe_mode, php3_ini.safe_mode); ! PHP3_CONF_STR("fopen_basedir", php3_ini_master.fopen_basedir, php3_ini.fopen_basedir); PHP3_CONF_LONG("track_vars", php3_ini_master.track_vars, php3_ini.track_vars); PHP3_CONF_STR("safe_mode_exec_dir", php3_ini_master.safe_mode_exec_dir, php3_ini.safe_mode_exec_dir); PHP3_CONF_STR("cgi_ext", php3_ini_master.cgi_ext, php3_ini.cgi_ext); --- 147,153 ---- PHP3_CONF_STR("doc_root", php3_ini_master.doc_root, php3_ini.doc_root); PHP3_CONF_STR("user_dir", php3_ini_master.user_dir, php3_ini.user_dir); PHP3_CONF_LONG("safe_mode", php3_ini_master.safe_mode, php3_ini.safe_mode); ! PHP3_CONF_STR("open_basedir", php3_ini_master.open_basedir, php3_ini.open_basedir); PHP3_CONF_LONG("track_vars", php3_ini_master.track_vars, php3_ini.track_vars); PHP3_CONF_STR("safe_mode_exec_dir", php3_ini_master.safe_mode_exec_dir, php3_ini.safe_mode_exec_dir); PHP3_CONF_STR("cgi_ext", php3_ini_master.cgi_ext, php3_ini.cgi_ext); Index: php3/functions/zlib.c diff -c php3/functions/zlib.c:1.6 php3/functions/zlib.c:1.7 *** php3/functions/zlib.c:1.6 Mon Aug 3 16:43:46 1998 --- php3/functions/zlib.c Fri Aug 14 19:47:16 1998 *************** *** 22,28 **** | Stefan Röhrich <sr@linux.de> | +----------------------------------------------------------------------+ */ ! /* $Id: zlib.c,v 1.6 1998/08/03 20:43:46 sr Exp $ */ #ifdef THREAD_SAFE #include "tls.h" --- 22,28 ---- | Stefan Röhrich <sr@linux.de> | +----------------------------------------------------------------------+ */ ! /* $Id: zlib.c,v 1.7 1998/08/14 23:47:16 steffann Exp $ */ #ifdef THREAD_SAFE #include "tls.h" *************** *** 204,210 **** php3_error(E_WARNING,"SAFE MODE Restriction in effect. Invalid owner of file to be read."); return NULL; } ! if (_php3_check_fopen_basedir(path)) return NULL; return gzopen(path, mode); } } --- 204,210 ---- php3_error(E_WARNING,"SAFE MODE Restriction in effect. Invalid owner of file to be read."); return NULL; } ! if (_php3_check_open_basedir(path)) return NULL; return gzopen(path, mode); } } *************** *** 230,236 **** php3_error(E_WARNING,"SAFE MODE Restriction in effect. Invalid owner."); return(NULL); } ! if (_php3_check_fopen_basedir(filename)) return NULL; zp = gzopen(filename, mode); if (zp && opened_path) { *opened_path = expand_filepath(filename); --- 230,236 ---- php3_error(E_WARNING,"SAFE MODE Restriction in effect. Invalid owner."); return(NULL); } ! if (_php3_check_open_basedir(filename)) return NULL; zp = gzopen(filename, mode); if (zp && opened_path) { *opened_path = expand_filepath(filename); *************** *** 250,263 **** php3_error(E_WARNING,"SAFE MODE Restriction in effect. Invalid owner."); return(NULL); } ! if (_php3_check_fopen_basedir(trypath)) return NULL; zp = gzopen(trypath, mode); if (zp && opened_path) { *opened_path = expand_filepath(trypath); } return zp; } else { ! if (_php3_check_fopen_basedir(filename)) return NULL; return gzopen(filename, mode); } } --- 250,263 ---- php3_error(E_WARNING,"SAFE MODE Restriction in effect. Invalid owner."); return(NULL); } ! if (_php3_check_open_basedir(trypath)) return NULL; zp = gzopen(trypath, mode); if (zp && opened_path) { *opened_path = expand_filepath(trypath); } return zp; } else { ! if (_php3_check_open_basedir(filename)) return NULL; return gzopen(filename, mode); } } *************** *** 267,273 **** php3_error(E_WARNING,"SAFE MODE Restriction in effect. Invalid owner."); return(NULL); } ! if (_php3_check_fopen_basedir(filename)) return NULL; zp = gzopen(filename, mode); if (zp && opened_path) { *opened_path = strdup(filename); --- 267,273 ---- php3_error(E_WARNING,"SAFE MODE Restriction in effect. Invalid owner."); return(NULL); } ! if (_php3_check_open_basedir(filename)) return NULL; zp = gzopen(filename, mode); if (zp && opened_path) { *opened_path = strdup(filename); *************** *** 298,304 **** } } if ((zp = gzopen(trypath, mode)) != NULL) { ! if (_php3_check_fopen_basedir(trypath)) { gzclose(zp); efree(pathbuf); return NULL; --- 298,304 ---- } } if ((zp = gzopen(trypath, mode)) != NULL) { ! if (_php3_check_open_basedir(trypath)) { gzclose(zp); efree(pathbuf); return NULL; -- 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

« previous php.dev (#250) next »