]> granicus.if.org Git - apache/commitdiff
htpasswd: Use correct file mode for checking if file is writable.
authorRainer Jung <rjung@apache.org>
Mon, 13 Aug 2012 11:35:18 +0000 (11:35 +0000)
committerRainer Jung <rjung@apache.org>
Mon, 13 Aug 2012 11:35:18 +0000 (11:35 +0000)
Also switch to the non-deprecated APR_FOPEN_* flags.
PR: 45923

Backport of r1369618 from trunk.

Submitted by: sf
Reviewed by: rjung, trawick, humbedooh
Backported by: rjung

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1372373 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
support/htpasswd.c

diff --git a/CHANGES b/CHANGES
index 6ddfe4cade9ee997896c5f5e3d9b9f1458e49f5e..c63ff2ed40c0fad1c164eb010a6b8478d7c2a68a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -7,6 +7,9 @@ Changes with Apache 2.4.3
      possible XSS for a site where untrusted users can upload files to
      a location with MultiViews enabled. [Niels Heinen <heinenn google.com>]
 
+  *) htpasswd: Use correct file mode for checking if file is writable.
+     PR 45923. [Stefan Fritsch]
+
   *) mod_rewrite: Fix crash with dbd RewriteMaps. PR 53663. [Mikhail T.
      <mi apache aldan algebra com>]
 
diff --git a/STATUS b/STATUS
index 89638947ce8bf2d48886333e253ae07964a64a35..a4479b18a354c18848faeb11bc4d5ebbaf8f0749 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -88,12 +88,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-   * htpasswd: Use correct file mode for checking if file is writable.
-     Also switch to the non-deprecated APR_FOPEN_* flags.
-     PR: 45923
-     trunk patch: http://svn.apache.org/viewvc?view=rev&rev=1369618
-     2.4.x patch: trunk patch works
-     +1: rjung, trawick, humbedooh
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
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);