[omd-commits] OMD Git: omd: dokuwiki auth: do not destroy htpasswd symlinks showing to another file

git version control git at mathias-kettner.de
Tue Dec 20 18:42:54 CET 2011


Module:   omd
Branch:   master
Commit:   09720dee5b847e4568383cf6a2f82a3c6869f912
URL:      http://omdistro.org/projects/omd/repository/revisions/09720dee5b847e4568383cf6a2f82a3c6869f912

Author:   Lars Michelsen <lm at mathias-kettner.de>
Date:     Tue Dec 20 14:10:11 2011 +0100
Commiter: Lars Michelsen <lm at mathias-kettner.de>
Date:     Tue Dec 20 14:10:11 2011 +0100

dokuwiki auth: do not destroy htpasswd symlinks showing to another file

---

 packages/dokuwiki/DOKUWIKI_AUTH.hook |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/packages/dokuwiki/DOKUWIKI_AUTH.hook b/packages/dokuwiki/DOKUWIKI_AUTH.hook
index 8ec7fed..8d6354e 100755
--- a/packages/dokuwiki/DOKUWIKI_AUTH.hook
+++ b/packages/dokuwiki/DOKUWIKI_AUTH.hook
@@ -20,7 +20,7 @@ case "$1" in
    set)
        if [ "$2" == "on" ]
        then
-         if [ ! -h ${OMD_ROOT}/etc/htpasswd ]
+         if [ ! -h ${OMD_ROOT}/etc/htpasswd ] || [ ! $(readlink ${OMD_ROOT}/etc/htpasswd) = "dokuwiki/users.auth.php" ]
          then
            mv ${OMD_ROOT}/etc/htpasswd ${OMD_ROOT}/etc/htpasswd.omd
            ln -s dokuwiki/users.auth.php ${OMD_ROOT}/etc/htpasswd
@@ -28,7 +28,8 @@ case "$1" in
            ln -sf dokuwiki/users.auth.php ${OMD_ROOT}/etc/htpasswd
          fi
        else
-         if [ -h ${OMD_ROOT}/etc/htpasswd ]
+         # Prevent destroying links showing anywhere else
+         if [ -h ${OMD_ROOT}/etc/htpasswd ] && [ $(readlink ${OMD_ROOT}/etc/htpasswd) = "dokuwiki/users.auth.php" ]
          then
            ln -sf htpasswd.omd ${OMD_ROOT}/etc/htpasswd
          fi



More information about the omd-commits mailing list