From: Stefan Fritsch Date: Sun, 5 Aug 2012 16:55:00 +0000 (+0000) Subject: htpasswd: Use correct file mode for checking if file is writable. X-Git-Tag: 2.5.0-alpha~6503 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7ab70fec3dc3088e0ece261e1955efe1be12b80c;p=thirdparty%2Fapache%2Fhttpd.git htpasswd: Use correct file mode for checking if file is writable. Also switch to the non-deprecated APR_FOPEN_* flags PR: 45923 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1369618 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index a6a082ab903..c1340535747 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.5.0 + *) htpasswd: Use correct file mode for checking if file is writable. + PR 45923. [Stefan Fritsch] + *) core: Add post_perdir_config hook. [Steinar Gunderson ] diff --git a/support/htpasswd.c b/support/htpasswd.c index 993ce625e3e..31e766211d8 100644 --- a/support/htpasswd.c +++ b/support/htpasswd.c @@ -520,7 +520,7 @@ int main(int argc, const char * const argv[]) /* * Check that this existing file is readable and writable. */ - if (!accessible(pool, pwfilename, APR_READ | APR_APPEND)) { + if (!accessible(pool, pwfilename, APR_FOPEN_READ|APR_FOPEN_WRITE)) { apr_file_printf(errfile, "%s: cannot open file %s for " "read/write access" NL, argv[0], pwfilename); exit(ERR_FILEPERM); @@ -539,7 +539,7 @@ int main(int argc, const char * const argv[]) /* * As it doesn't exist yet, verify that we can create it. */ - if (!accessible(pool, pwfilename, APR_CREATE | APR_WRITE)) { + if (!accessible(pool, pwfilename, APR_FOPEN_WRITE|APR_FOPEN_CREATE)) { apr_file_printf(errfile, "%s: cannot create file %s" NL, argv[0], pwfilename); exit(ERR_FILEPERM);