summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2010-11-23 15:42:32 -0500
committerKohei Yoshida <kyoshida@novell.com>2010-11-23 23:04:59 -0500
commit5e2fc23bbd05cc3f1a1a8aa90118c8d6012ba371 (patch)
treefccf9d6b738e52afafd084df29c18feccfa53b06
parent6d716265f4871dfcb899d5a0fae971f99e36c3e8 (diff)
Temporarily disable the extra ACL check.
The fix for i#102464 no longer seems necessary. In fact, leaving that "fix" would interfere with documents saved in samba shere; when a 2nd user tries to open a document in a samba share that's already opened by someone else, it would silently open in read-only mode, but the correct behavior is to launch the "Document in Use" dialog telling the 2nd user which user has it open. If disabling this checks causes no regressions, we can remove this.
-rw-r--r--sfx2/source/doc/docfile.cxx9
-rw-r--r--sfx2/source/doc/sfxacldetect.cxx9
-rw-r--r--sfx2/source/doc/sfxacldetect.hxx39
3 files changed, 55 insertions, 2 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index f2e903e417..7da31fb56b 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -143,12 +143,11 @@ using namespace ::com::sun::star::io;
#include "openflag.hxx" // SFX_STREAM_READONLY etc.
#include "sfxresid.hxx"
#include <sfx2/appuno.hxx>
+#include "sfxacldetect.hxx"
#define MAX_REDIRECT 5
-sal_Bool IsReadonlyAccordingACL( const sal_Unicode* pFilePath );
-
//==========================================================
namespace {
@@ -1055,6 +1054,11 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI )
catch( uno::Exception )
{}
+#if EXTRA_ACL_CHECK
+ // This block was introduced as a fix to i#102464, but removing
+ // this does not make the problem re-appear. But leaving this
+ // part would interfere with documents saved in samba share. This
+ // affects Windows only.
if ( !bContentReadonly )
{
// the file is not readonly, check the ACL
@@ -1063,6 +1067,7 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI )
if ( ::utl::LocalFileHelper::ConvertURLToPhysicalName( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ), aPhysPath ) )
bContentReadonly = IsReadonlyAccordingACL( aPhysPath.GetBuffer() );
}
+#endif
}
// do further checks only if the file not readonly in fs
diff --git a/sfx2/source/doc/sfxacldetect.cxx b/sfx2/source/doc/sfxacldetect.cxx
index 825bbddba2..0aa9cb9ddf 100644
--- a/sfx2/source/doc/sfxacldetect.cxx
+++ b/sfx2/source/doc/sfxacldetect.cxx
@@ -26,6 +26,13 @@
*
************************************************************************/
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_sfx2.hxx"
+
+#include "sfxacldetect.hxx"
+
+#if EXTRA_ACL_CHECK
+
#ifdef WNT
// necessary to include system headers without warnings
@@ -104,4 +111,6 @@ sal_Bool IsReadonlyAccordingACL( const sal_Unicode* )
#endif
+#endif
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/doc/sfxacldetect.hxx b/sfx2/source/doc/sfxacldetect.hxx
new file mode 100644
index 0000000000..99868f6507
--- /dev/null
+++ b/sfx2/source/doc/sfxacldetect.hxx
@@ -0,0 +1,39 @@
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Kohei Yoshida <kyoshida@novell.com>
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef __SFXACLDETECT_HXX__
+#define __SFXACLDETECT_HXX__
+
+// Let's check if this extra ACL check is still necessary... If disabling it
+// causes no regressions, then we can safely remove this code.
+#define EXTRA_ACL_CHECK 0
+
+#if EXTRA_ACL_CHECK
+sal_Bool IsReadonlyAccordingACL( const sal_Unicode* pFilePath );
+#endif
+
+#endif