summaryrefslogtreecommitdiff
path: root/sfx2/source/doc/sfxacldetect.cxx
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2009-11-23 16:33:39 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2009-11-23 16:33:39 +0000
commit893d3ed1b6d83775df277825f07bf3d47f721004 (patch)
tree1b8350e667f90a62e48cfe214790f3202a8f8dc6 /sfx2/source/doc/sfxacldetect.cxx
parentef1ec7001a06a6ba0fdbed702bcd7a6fec58eaf9 (diff)
CWS-TOOLING: integrate CWS fwk125
2009-11-19 08:11:20 +0100 jsk r277554 : fwk125: #i105760# - removed warnlog, re-enabled autotest e_help.bas 2009-11-16 16:21:49 +0100 tl r277521 : #i106571# fixed locale list for dictionaries to get rid of duplicate entries 2009-11-12 08:47:31 +0100 hde r277469 : rework of hyphenation 2009-11-11 15:25:16 +0100 hde r277462 : rework of hyphenation 2009-11-11 15:24:09 +0100 hde r277461 : rework of hyphenation 2009-11-11 13:52:02 +0100 hde r277453 : new include for hyphenation tools 2009-11-10 12:28:51 +0100 tl r277427 : #i102304# fix for hyphenation dialog 2009-11-10 12:00:10 +0100 mav r277425 : #i10000# A workaround for pch and windows headers conflict 2009-11-10 11:58:32 +0100 mav r277424 : #i10000# A workaround for pch and windows headers conflict 2009-11-09 15:47:59 +0100 kso r277414 : #i16732# fixed url matching. 2009-11-09 11:51:40 +0100 mav r277406 : #i10000# use precompiled headers 2009-11-08 23:53:03 +0100 mav r277399 : #i10000# fix warning 2009-11-08 23:50:23 +0100 mav r277398 : #i10000# adapt for unix 2009-11-08 23:49:52 +0100 mav r277397 : #i10000# adapt for unix 2009-11-08 21:26:06 +0100 mav r277396 : CWS-TOOLING: rebase CWS fwk125 to branches/OOO320@277373 (milestone: OOO320:m4) 2009-11-06 16:30:27 +0100 ab r277394 : #i106100# Hold references to packages to speed up further calls to getDeployedPackages() 2009-11-06 15:58:48 +0100 mav r277392 : #i102464# check the Windows ACL 2009-11-06 15:58:23 +0100 mav r277391 : #i102464# check the Windows ACL 2009-11-04 11:54:06 +0100 tl r277342 : #i106497# incorrectly found 'supported languages' fixed 2009-11-04 10:40:51 +0100 tl r277335 : #i106571# dictionary updates for Polish and Swedish. 2009-10-28 09:54:41 +0100 tl r277236 : #i106100# context menu performance 2009-10-27 15:47:05 +0100 tl r277213 : #i106100# context menu performance 2009-10-23 17:31:56 +0200 mav r277170 : #i106075# use correct path to inprocserv.dll 2009-10-23 16:07:27 +0200 mav r277168 : #i105760# seek the temporary file to beginning also for URL case 2009-10-23 11:03:58 +0200 mav r277134 : CWS-TOOLING: rebase CWS fwk125 to branches/OOO320@276942 (milestone: OOO320:m2)
Diffstat (limited to 'sfx2/source/doc/sfxacldetect.cxx')
-rwxr-xr-xsfx2/source/doc/sfxacldetect.cxx108
1 files changed, 108 insertions, 0 deletions
diff --git a/sfx2/source/doc/sfxacldetect.cxx b/sfx2/source/doc/sfxacldetect.cxx
new file mode 100755
index 000000000000..94370e9a1c52
--- /dev/null
+++ b/sfx2/source/doc/sfxacldetect.cxx
@@ -0,0 +1,108 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: shutdowniconw32.cxx,v $
+ * $Revision: 1.48 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifdef WNT
+
+// necessary to include system headers without warnings
+#ifdef _MSC_VER
+#pragma warning(disable:4668 4917)
+#endif
+
+#include <windows.h>
+#include <lmaccess.h>
+#include <sal/types.h>
+
+sal_Bool IsReadonlyAccordingACL( const sal_Unicode* pFilePath )
+{
+ sal_Bool bResult = sal_False;
+
+ sal_uInt32 nFDSize = 0;
+ GetFileSecurityW( pFilePath, DACL_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|OWNER_SECURITY_INFORMATION, NULL, 0, &nFDSize );
+ if ( nFDSize )
+ {
+ PSECURITY_DESCRIPTOR pFileDescr = reinterpret_cast< PSECURITY_DESCRIPTOR >( malloc( nFDSize ) );
+ if ( GetFileSecurityW( pFilePath, DACL_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|OWNER_SECURITY_INFORMATION, pFileDescr, nFDSize, &nFDSize ) )
+ {
+ HANDLE hToken = NULL;
+ if ( OpenThreadToken( GetCurrentThread(), TOKEN_DUPLICATE|TOKEN_QUERY, TRUE, &hToken )
+ || OpenProcessToken( GetCurrentProcess(), TOKEN_DUPLICATE|TOKEN_QUERY, &hToken) )
+ {
+ HANDLE hImpersonationToken = NULL;
+ if ( DuplicateToken( hToken, SecurityImpersonation, &hImpersonationToken) )
+ {
+ sal_uInt32 nDesiredAccess = ACCESS_WRITE;
+ GENERIC_MAPPING aGenericMapping = { ACCESS_READ, ACCESS_WRITE, 0, ACCESS_READ | ACCESS_WRITE };
+ MapGenericMask( &nDesiredAccess, &aGenericMapping );
+
+ PRIVILEGE_SET aPrivilegeSet;
+ sal_uInt32 nPrivilegeSetSize = sizeof( PRIVILEGE_SET );
+
+ sal_uInt32 nGrantedAccess;
+ BOOL bAccessible = TRUE;
+ if ( AccessCheck( pFileDescr,
+ hImpersonationToken,
+ nDesiredAccess,
+ &aGenericMapping,
+ &aPrivilegeSet,
+ &nPrivilegeSetSize,
+ &nGrantedAccess,
+ &bAccessible ) )
+ {
+ bResult = !bAccessible;
+ }
+
+ CloseHandle( hImpersonationToken );
+ }
+
+ CloseHandle( hToken );
+ }
+ }
+
+ free( pFileDescr );
+ }
+
+ return bResult;
+}
+
+#else // this is UNX
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_sfx2.hxx"
+
+
+#include <sal/types.h>
+
+sal_Bool IsReadonlyAccordingACL( const sal_Unicode* )
+{
+ // to be implemented
+ return sal_False;
+}
+
+#endif
+