summaryrefslogtreecommitdiff
path: root/sal
AgeCommit message (Collapse)Author
2013-08-30WaE: C4334: '<<' : result of 32-bit shift implicitly converted to 64 bitsTor Lillqvist
1UL is not a portable way to get a size_t -sized one. Change-Id: I8fac16b7e1f1b8bbccb4bd11eacc9449fc3f8c33
2013-08-30WaE: possible loss of dataTor Lillqvist
Change-Id: I2a1d47cc3eca40ddd7e9502ffe71337ab2268858
2013-08-27fdo#67313: Use "lo" suffix for private URE libsStephan Bergmann
...(like is done for most of LO's non-URE libs already) to reduce likelihood of name clashes, esp. on Windows where URE libs are found via PATH. This introduces PRIVATELIBS_URE, and removes now-unused UNOLIBS_URE. Change-Id: Ib95dd45f18de140a54e62d632dbf2239f83c232e
2013-08-26Use strncmp()Tor Lillqvist
Change-Id: I593ce24ce83cd3034d23297adc3de5f6de18f3a9
2013-08-26Be careful not to access a string out of boundsTor Lillqvist
Change-Id: Ibc43ffa0c535e0baf1bb6d8b213320da345a3d65
2013-08-25Fix "Save As" when sandboxed on OS XTor Lillqvist
Change-Id: Ibe2ea21265a0bb9c4fedcef137626df2a8019116
2013-08-25TypoTor Lillqvist
Change-Id: Icfb6c58d8a73e45d7d9c5629ac0d808f7afcf9ff
2013-08-25More work on a sandboxed LibreOffice on OS XTor Lillqvist
In particular, surround also the ftruncate() operation that osl_setFileSize() does with access through a security scope bookmark for the file, if available. This fixes file saving in a sandboxed LibreOffice. (But oh boy, does simply saving an ODT document go though a weird dance of file operations.) Luckily the C++ oslFileHandle abstraction keeps the pathname that the file was opened with, so even if ftruncate() as such takes only the file descriptor, we can get at the pathname to retrieve our security scope bookmark. Change-Id: I8acb1b2f3fb3ec0cea833697b7f1d4a1912ed551
2013-08-25Switch from OSL_TRACE to SAL_INFO()Tor Lillqvist
Change-Id: I2222a8db929e2f17aff9f72ff2ae1ca6e081e576
2013-08-25Do more syscalls using a security scope bookmark on OS X when sandboxedTor Lillqvist
Move the handling of the bookmarks to the wrappers in uunxapi.cxx, and add wrappers for open() and utime(). Change-Id: I92f9941152b567545eea60f2aaae6a3b8d35e792
2013-08-24A slash is a slash, a dot is a dotTor Lillqvist
Bin pointless abstraction. Change-Id: I193842dff5a86f58f53827712e2f16f6bdd83c3d
2013-08-24Bin "temporary hack" code that has been commented-out since 2002Tor Lillqvist
Change-Id: If228820b35927d24a1ae2e19c184767a447f829b
2013-08-24Simplify osl_getSystemPathFromFileURL_Ex()Tor Lillqvist
It was always called with the bAllowRelative parameter as false anyway. Change-Id: I6c4bf739e3f8c1d52dbe8af5df13e97dc9be96e5
2013-08-24Remove function that has been commented-out since 2000Tor Lillqvist
Change-Id: I18ed3ba6f1567ec40f3a87d988863680c55f665b
2013-08-24Cleanup some weird or inconsistent indentaion and bin some pointless commentsTor Lillqvist
Sometimes one just can't resist. Change-Id: I3550f30cc206e2efe361a669b4f8e740d9c3c339
2013-08-24Bin line of code commented out since 2009Tor Lillqvist
Change-Id: I89c2cf3c82617bada72053678a6fb6013bfbca13
2013-08-23Bypass the alias resolving completely when sandboxedTor Lillqvist
Attempting to look up the bookmark data for a file will try acessing its resource fork, causing messages like: soffice(83685) deny file-read-data /Users/tml/Documents/b.odt/..namedfork/rsrc Change-Id: I1b2b0b493a46aa629581b921c94c5014f994e75c
2013-08-23Make our File>Recent Documents work better when sandboxedTor Lillqvist
Store security scope bookmarks for files selected in the file picker in the user data. (I looked into storing it in the LO "registry" in the Histories/PickList thingies, but that was horribly complex.) When opening a file, if we have stored a security scope bookmark for it, use that while opening the file. Change-Id: I347ae2dd815299441c17467d9b66a226061d0ed2
2013-08-23fix hex escape sequenceCaolán McNamara
Change-Id: I8bc9d3812977589e96f5440afa8d46bfe4d3b88e
2013-08-22Various undefined behavior involving signed integersStephan Bergmann
as flagged by Clang -fsanitize=undefined Change-Id: Iff1aa4473d960009890b923fba734257ecd8b3ef
2013-08-21finish deprecation of O(U)String::valueOf()Luboš Luňák
Compiler plugin to replace with matching number(), boolean() or OUString ctor, ran it, few manual tweaks, mark as really deprecated. Change-Id: I4a79bdbcf4c460d21e73b635d2bd3725c22876b2
2013-08-21osl_getThreadIdentifier(0) -> osl::Thread::getCurrentIdentifier()Stephan Bergmann
Change-Id: Ida9785c4b9fda0459769957734952e69d7a9de44
2013-08-20rtl::compareAsciiIgnoreCase cannot be used hereStephan Bergmann
...as its assert requires that both input characters are ASCII, which need not be the case in these compareIgnoreAsciiCase functions. (Even if they take one literal argument that must be strictly ASCII, the other argument can be an arbitrary Unicode string in the case of OUString or an arbitrary 8-bit string in the case of OString). The logically correct version of rtl::compareAsciiIgnoreCase would arguably be one that requires its two arguments to be valid UTF-32 code units, but that could not be used in these places either, as for OUString they operate on individual UTF-16 code units. rtl::compareAsciiIgnoreCase likely makes less sense after all than assumed in c8e39e66528affb66f1ae121fa36dd4ab31a9b0b "Introduce rtl::compareIgnoreCase and deprecate rtl/character.hxx equivalents," which this commit partly reverts. Change-Id: Ib2eed3a1896e83d9c66b0479a03f9ec51e1c4dc0
2013-08-19Introduce rtl::compareIgnoreCase and deprecate rtl/character.hxx equivalents.Arnaud Versini
Change-Id: Id90935fd2b0f904f89477792edc8140cfc31e91f Reviewed-on: https://gerrit.libreoffice.org/5412 Reviewed-by: Petr Mladek <pmladek@suse.cz> Tested-by: Petr Mladek <pmladek@suse.cz>
2013-08-19Rename SOLAR_JAVA to ENABLE_JAVA and HAVE_FEATURE_JAVATor Lillqvist
Change-Id: Ib451bdb3c1c2ca42347abfde44651d5cf5eef4f3
2013-08-18Use subfolder names from <config_folders.h>Tor Lillqvist
Change all instances of hardcoded "program", "share" etc subfolder names to use those from <config_folders.h> instead. In normal builds, the end result will not change. Change-Id: I91c95cd8e482818be67307e889ae6df887763f53
2013-08-18Bypass the O_NONBLOCK resetting for now when sandboxed on OS XTor Lillqvist
The fcntl fails. Will have to check later whether we should also drop using O_NONBLOCK when opening then. Change-Id: I529a4d728563eb323e35487782f7fee88b2faa0c
2013-08-15Mark as constTakeshi Abe
Change-Id: Ic7ee570935b5d827dc01a483877ea5021da5abea
2013-08-08Add SDT probes for interning rtl_uStrings.Mark Wielaard
This adds RTL_LOG_STRING_INTERN_NEW and RTL_LOG_STRING_INTERN_DELETE which are connected to SDT probes if available. It introduces two new SDT probes. new_string_intern_16 and delete_string_intern_16 (there is currently no interning for 8-bit rtl_Strings). For consistency both have the same 4 arguments as new_string_(8|16) and delete_string_(8|16). new_string_intern_16 has as 5th argument the address of the original rtl_uString being interned (which may or may not be the same as $arg1). Change-Id: Ib117bba932c1908abc70a7fdd4140c0af76d54cb Reviewed-on: https://gerrit.libreoffice.org/5308 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2013-08-03Add SDT probes for RTL_LOG_STRING_NEW/DELETE.Mark Wielaard
Change-Id: I938259f90aee9d277c9ff5b72c9120b93311cbd3 Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2013-08-02CFErrorRef is apparently not always initialized by the calleeNorbert Thiebaud
on 10.6 SDK this coredumped in some case in CFRelease(cferror) Maing sure that cferror is initialized to NULL avoid the problem Change-Id: I5624416867670bfd4c8db9b35e3b3d37494f79fd
2013-08-02No self-execing when HAVE_FEATURE_MACOSX_SANDBOX so no need to close fdsTor Lillqvist
Change-Id: Iea03aa4708427772952add0f2fc40012b22e572b
2013-08-01Mark as constTakeshi Abe
Change-Id: Idd1d0641d5b7d8594f354c7d2e2a9093ecc6b2f7
2013-07-31Fix memory leak in osl_getSystemPathFromFileURL.Mark Wielaard
rtl_uStrings should never be directly assigned. That might mess up reference counting. osl_getSystemPathFromFileURL can be called with pustrSystemPath pointing to a non-empty rtl_uStrings. A special case being when the ustrFileURL input and the pustrSystemPath output point to the same rtl_uString instance. So use rtl_uString_assign. Change-Id: I48e17817cba905a4a6d4bc303d072d62941b0d9c Reviewed-on: https://gerrit.libreoffice.org/5209 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
2013-07-30Be a bit more lax when resolving bookmarks when sandboxedTor Lillqvist
Change-Id: I6ada3e660ee58f7937425eea40a4bbd82754f4b1
2013-07-29Avoid crash on OS X: guarded fd exceptionTor Lillqvist
On OS X, a file descriptor that shows up as being of type "KQUEUE" in lsof output is apparently created behind the scenes when starting a thread. (Related to BSD kernel event queues: see man kqueue.) When we re-exec ourselves on OS X, and then close all file descriptors >= 3, closing such a KQUEUE fd causes a crash. Guard against this by closing only regular files. Change-Id: I5011bfbaed156b04248b6bddb2a1a58624bee3d4 5011bfbaed156b04248b6bddb2a1a58624bee3d4
2013-07-26fdo#63690 - replace RTL_CONTEXT_ macros with SAL_INFOJelle van der Waa
Change-Id: Ic762d02458265fe1ef2f4ba0b286438b6082e805 Reviewed-on: https://gerrit.libreoffice.org/5120 Reviewed-by: Luboš Luňák <l.lunak@suse.cz> Tested-by: Luboš Luňák <l.lunak@suse.cz>
2013-07-22Fix file_path_helper FPH_LOCAL_DIR_ENTRY.Mark Wielaard
Commit e5e4c54da changed "." to a constant, but the wrong one. Should have been FPH_CHAR_DOT, not FPH_CHAR_PATH_SEPARATOR. Change-Id: I041f6507947f1631f0af133bff0fa3270313391a Reviewed-on: https://gerrit.libreoffice.org/5001 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
2013-07-17Fix memory leak with osl_getCurrentSecurity ().Mark Wielaard
The result of osl_getCurrentSecurity () should always be deleted again with osl_freeSecurityHandle (). Change-Id: If0991937fcb24207d1f78166f61c4be22d423629 Reviewed-on: https://gerrit.libreoffice.org/4947 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2013-07-11Uknown -> UnknownCaolán McNamara
Change-Id: I06d48669804d2ae99c47a0df1ed3c6f45c87a57e
2013-07-06Don't use mach_absolute_time(), it gives time since bootTor Lillqvist
Which definitely is not what we want here. Use clock_get_time() on a CALENDAR_CLOCK instead, that gives time since the Unix epoch. So our osl_getSystemTime() had been completely broken on OS X since May 19 (d8d55787b81cdc955b73c8befa4ab608f46e32aa) and no unit test had noticed... Fairly coincidentally, an assert() introduced yesterday in 4d220882b46d5f8edd4d09e5f66722cd296a092e caught it. Change-Id: Iad76a7aadc39159fdc80c99087bb527d6aa49c66
2013-07-05janitorial / stylisticLionel Elie Mamane
Change-Id: I8e7c1e63ff04220e530662d9a6e142f4f0e7247f
2013-07-05API change: osl/time.h take const pointers where appropriateLionel Elie Mamane
Should be backwards-compatible... Change-Id: I6b04bec2c032ff8c57a1b5192b2d3962dcc96c84
2013-07-05API change: oslDateTime signed yearLionel Elie Mamane
Change-Id: Ic4f1e424b130fd2ccca379adbe0a66836b6cac41
2013-07-05sal: add ERROR_SHARING_VIOLATION to win32 error tableMichael Stahl
It's apparently a popular error; map it to E_ACCES which is the same as the catch-all clause does (for compatibility). Change-Id: I55fd932248a2ecbacd4fd6584e92918da95e3cff
2013-07-01Mark as constTakeshi Abe
Change-Id: Ic71f39aaebf07d3b0435882986be71cf2b0390c2
2013-06-27Translate German comments.Chris Hoppe
Change-Id: Ida59dcca7c9a0305aecddaa68f4e585321144458
2013-06-25coverity #982634 and 5 other : Intentional fallthrough in casesNorbert Thiebaud
Change-Id: Ie6cfcc32c1ff80dab0f9835524c89d40503f69f0 Reviewed-on: https://gerrit.libreoffice.org/4498 Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
2013-06-25coverity : #984128 and 21 others : Uninitialized scalar fieldNorbert Thiebaud
Change-Id: If801818c2efc8cdec651ff259243075abac41d20 Reviewed-on: https://gerrit.libreoffice.org/4497 Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
2013-06-24coverity#706154 : Destination buffer too smallNorbert Thiebaud
Change-Id: I27bc8803353047a057caaf2353f10cdab08e81e9