]> granicus.if.org Git - php/commitdiff
Add open_basedir checks to readline_write_history and readline_read_history
authorRasmus Lerdorf <rasmus@php.net>
Wed, 21 Mar 2012 16:13:06 +0000 (09:13 -0700)
committerRasmus Lerdorf <rasmus@php.net>
Wed, 21 Mar 2012 16:13:06 +0000 (09:13 -0700)
ext/readline/readline.c

index c514cb8fd011e0475c1264ec2c7b94c37ec98c43..820e4b456a2864f206ad57bce2b7989ef03ac04d 100644 (file)
@@ -369,6 +369,10 @@ PHP_FUNCTION(readline_read_history)
                return;
        }
 
+       if (php_check_open_basedir(arg TSRMLS_CC)) {
+               RETURN_FALSE;
+       }
+
        /* XXX from & to NYI */
        if (read_history(arg)) {
                RETURN_FALSE;
@@ -389,6 +393,10 @@ PHP_FUNCTION(readline_write_history)
                return;
        }
 
+       if (php_check_open_basedir(arg TSRMLS_CC)) {
+               RETURN_FALSE;
+       }
+
        if (write_history(arg)) {
                RETURN_FALSE;
        } else {