summaryrefslogtreecommitdiffstats
path: root/support/htpasswd.c
diff options
context:
space:
mode:
authorStefan Fritsch <sf@apache.org>2012-08-05 18:55:00 +0200
committerStefan Fritsch <sf@apache.org>2012-08-05 18:55:00 +0200
commit7ab70fec3dc3088e0ece261e1955efe1be12b80c (patch)
tree3582e3728edf1e9bb2916dd16bca4488b065b9e9 /support/htpasswd.c
parentRevert r1367504: (diff)
downloadapache2-7ab70fec3dc3088e0ece261e1955efe1be12b80c.tar.xz
apache2-7ab70fec3dc3088e0ece261e1955efe1be12b80c.zip
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
Diffstat (limited to 'support/htpasswd.c')
-rw-r--r--support/htpasswd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/support/htpasswd.c b/support/htpasswd.c
index 993ce625e3..31e766211d 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);