]> granicus.if.org Git - apache/commitdiff
htpasswd: Use correct file mode for checking if file is writable.
authorStefan Fritsch <sf@apache.org>
Sun, 5 Aug 2012 16:55:00 +0000 (16:55 +0000)
committerStefan Fritsch <sf@apache.org>
Sun, 5 Aug 2012 16:55:00 +0000 (16:55 +0000)
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

CHANGES
support/htpasswd.c

diff --git a/CHANGES b/CHANGES
index a6a082ab9036562fc3e5030b777759e4f3ccf66b..c134053574706070f0aa9ccc9083a26bdc787a3b 100644 (file)
--- 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 <sgunderson bigfoot.com>]
 
index 993ce625e3e9ae9a49c6a469bb641cc0fee1f925..31e766211d8d672f9ab9b61221b5499c69c6badc 100644 (file)
@@ -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);