From eeeb1922c834210e63a9648fd8aacb3db30545b0 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 8 Jan 2008 09:54:45 +0000 Subject: [PATCH] Update LDAP_DUMP_PATH permissions on every action. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8246 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_CopyPasteHandler.inc | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/gosa-core/include/class_CopyPasteHandler.inc b/gosa-core/include/class_CopyPasteHandler.inc index 1c0ff8046..718d6e8e9 100644 --- a/gosa-core/include/class_CopyPasteHandler.inc +++ b/gosa-core/include/class_CopyPasteHandler.inc @@ -83,8 +83,15 @@ class CopyPasteHandler { /* Create patch if it doesn't exists */ if(!is_dir(LDAP_DUMP_PATH)){ @mkdir(LDAP_DUMP_PATH); - @chmod(LDAP_DUMP_PATH,0700); } + + /* Update folder permissions */ + if(!@chmod(LDAP_DUMP_PATH,0700)){ + $msg= sprintf(_("Cannot cleanup copy & paste queue: couldn't set permission for '%s'!"),LDAP_DUMP_PATH); + msg_dialog::display(_("Configuration error"), $msg, ERROR_DIALOG); + new log("copy","all/all","copy & paste, event queue.",array(), $msg); + return(FALSE); + } /* check if we are able to create a new file the given directory */ if(!is_writeable(LDAP_DUMP_PATH)){ @@ -133,7 +140,6 @@ class CopyPasteHandler { /* Create patch if it doesn't exists */ if(!is_dir($path)){ @mkdir($path); - @chmod($path,0700); } /* check if we are able to create a new file the given directory */ @@ -144,6 +150,14 @@ class CopyPasteHandler { return(FALSE); } + /* Update folder permissions */ + if(!@chmod(LDAP_DUMP_PATH,0700)){ + $msg= sprintf(_("Cannot save LDAP dump: couldn't set permission for '%s'!"),LDAP_DUMP_PATH); + msg_dialog::display(_("Configuration error"), $msg, ERROR_DIALOG); + new log("copy","all/all","copy & paste, event queue.",array(), $msg); + return(FALSE); + } + /* Create file handle */ $fp = @fopen($path."/".$filename,"w+"); if(!$fp){ -- 2.30.2