summaryrefslogtreecommitdiff
path: root/ucb/source
AgeCommit message (Collapse)Author
2024-05-01WaE: C6011 Dereferencing NULL pointer warningsCaolán McNamara
Change-Id: Ic2c2e227a50994298377485e9e807cd9142cc386 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166949 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-05-01WaE: C6011 Dereferencing NULL pointer warningsCaolán McNamara
Change-Id: I6eb8e490e878349f2063910e0cbc901aa7a6d524 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166942 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins
2024-04-20loplugin:constantparam in ucb,unotoolsNoel Grandin
Change-Id: I4161adac7544e7b1a8a7d8e18a3ae6c72ca77062 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166310 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-14ucb: webdav-curl: always set CURLOPT_NOBODY for HEADMichael Stahl
Otherwise there will be timeout that depends on when the server will close the connection, which varies by server but can be several minutes; getting a potential error document from the server for this one request when logging is enabled is less important. Change-Id: I505b014b148ba009c400d37d826c9edb8c3a6da2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164838 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2024-03-14ucb: webdav-curl: improve fallback authenticationMichael Stahl
The bundled curl on Linux doesn't support Negotiate, and a system curl may not support NTLM either. If setting the auth method fails with CURLE_NOT_BUILT_IN, abort. Change-Id: I7b7f7afd1ebedd665d9475fd40cac0e0641062a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164837 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2024-03-08ucb: webdav-curl: only set CURLOPT_NOBODY for HEADMichael Stahl
Some testing with Apache httpd+mod_dav reveals that it usually sends a body with a 401 status, which causes the CURLE_WEIRD_SERVER_REPLY error code from curl. So we should either ignore this error in case there's a HTTP status too, or stop using CURLOPT_NOBODY. The latter seems to have no downside, except for HEAD requests, where strangely the server keeps the connection open and curl waits for 5 seconds for no body to arrive, blocking the UI, so continue to use CURLOPT_NOBODY for HEAD. The other methods don't seem to block. It turns out that the SAL_LOG-dependent setting of g_NoBody turned HEAD into GET anyway if logging is enabled, so explicitly set the method. Change-Id: Ibe2eef8e7a827d4e356ba37c4b56bee0be3b9c13 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164569 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2024-03-08ucb: webdav-curl: try to share DNS and TLS data as wellMichael Stahl
Not necessary but probably faster. Documentation says that CURL_LOCK_DATA_CONNECT isn't safe in a multi threaded program. Change-Id: Iae79c01330b48f443b94abf6101a50559cb46189 (cherry picked from commit fa5feda2f891651933703e029dcc757e47a6801f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164553 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2024-03-08ucb: webdav-curl: add a shared cookie storeMichael Stahl
Change-Id: I8796aa7de6335c57818aa570a55fdc64d85bd9f9 (cherry picked from commit 7e8b26560020ae2819cfd621b5790e51083b7e92) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164552 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2024-03-08ucb: webdav-curl: try fallback authentication on 403 errorMichael Stahl
Sharepoint reports lack of authentication with 403 status and additional X-MSDAVEXT_ERROR header value 0x000E0098. Try to add the magic header "X-FORMS_BASED_AUTH_ACCEPTED: f" and fallback to Negotiate auth in this case; this requires cookies to be enabled. Note that the build config of libcurl on Linux is such that adding CURLAUTH_NEGOTIATE has no effect, but on WNT having both NEGOTIATE and NTLM causes the AuthMask to be ambiguous and prevents curl from trying. Change-Id: I47dada2ef08b21a43cdfa3db9eb2fcdb4043a04f Change-Id: Ia3e31c994bde0f8db84a60931702323c94c02e0e (cherry picked from commit c6df10ce7f91b3084255bfbbac95e865bbb3ce7b) Change-Id: I93e0c8f95beafc30b94296430352f2ae54e65b11 (cherry picked from commit 37abfd767874441568d9f5ac499b2d93d34e10fe) Change-Id: I0018a9904857d7521895936dc27607a54523f300 (cherry picked from commit 388a702af2fe45b2c436e64eb8639f16c1e24b76) Change-Id: Iafa8bdd183ef8a514b656ec41a9b7a6fa1e3acb9 (cherry picked from commit e84c21aca4b72d9e86c856f717b3bf1b75f190af) Change-Id: I6dfcb3ba6e44bbb76bc403e30b4a7b6ee95296f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164551 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2024-03-08ucb: webdav-curl: don't set CURLOPT_NOBODY for OPTIONSMichael Stahl
The problem is that if the server does send a body, then curl returns CURLE_WEIRD_SERVER_REPLY error code, which is translated to DAVException; this looks unnecessary now because write_callback will just return if there's no stream to write to anyway. Change-Id: Iddaee9778ac7bbd538b64584f822f65ab0e395c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164550 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2024-01-27Drop std::as_const from css::uno::Sequence iterationsMike Kaganski
Obsoleted by commit 2484de6728bd11bb7949003d112f1ece2223c7a1 (Remove non-const Sequence::begin()/end() in internal code, 2021-10-15) and commit fb3c04bd1930eedacd406874e1a285d62bbf27d9 (Drop non-const Sequence::operator[] in internal code, 2021-11-05). Change-Id: Idbafef5d34c0d4771cbbf75b9db9712e504164cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162640 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-01-13cid#1546354 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1546319 COPY_INSTEAD_OF_MOVE cid#1546286 COPY_INSTEAD_OF_MOVE cid#1546283 COPY_INSTEAD_OF_MOVE cid#1546191 COPY_INSTEAD_OF_MOVE cid#1545953 COPY_INSTEAD_OF_MOVE cid#1545874 COPY_INSTEAD_OF_MOVE cid#1545857 COPY_INSTEAD_OF_MOVE cid#1545781 COPY_INSTEAD_OF_MOVE cid#1545765 COPY_INSTEAD_OF_MOVE cid#1545546 COPY_INSTEAD_OF_MOVE cid#1545338 COPY_INSTEAD_OF_MOVE cid#1545190 COPY_INSTEAD_OF_MOVE cid#1545272 COPY_INSTEAD_OF_MOVE cid#1545242 COPY_INSTEAD_OF_MOVE cid#1545229 COPY_INSTEAD_OF_MOVE Change-Id: I88813d9dbd87ce10375db8198028f8b70e23f0fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162027 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-01-12cid#1545535 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1545526 COPY_INSTEAD_OF_MOVE cid#1545442 COPY_INSTEAD_OF_MOVE cid#1545426 COPY_INSTEAD_OF_MOVE cid#1545425 COPY_INSTEAD_OF_MOVE cid#1545387 COPY_INSTEAD_OF_MOVE cid#1545379 COPY_INSTEAD_OF_MOVE cid#1545337 COPY_INSTEAD_OF_MOVE cid#1545334 COPY_INSTEAD_OF_MOVE cid#1545289 COPY_INSTEAD_OF_MOVE cid#1545282 COPY_INSTEAD_OF_MOVE cid#1545270 COPY_INSTEAD_OF_MOVE cid#1545237 COPY_INSTEAD_OF_MOVE Change-Id: Iae44a7347c85ae2e367bf672214b2013f30466f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161968 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-01-12cid#1546222 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1546154 COPY_INSTEAD_OF_MOVE cid#1546120 COPY_INSTEAD_OF_MOVE cid#1546115 COPY_INSTEAD_OF_MOVE cid#1546111 COPY_INSTEAD_OF_MOVE cid#1546096 COPY_INSTEAD_OF_MOVE cid#1546016 COPY_INSTEAD_OF_MOVE cid#1545980 COPY_INSTEAD_OF_MOVE cid#1545942 COPY_INSTEAD_OF_MOVE cid#1545902 COPY_INSTEAD_OF_MOVE cid#1545869 COPY_INSTEAD_OF_MOVE cid#1545853 COPY_INSTEAD_OF_MOVE cid#1545769 COPY_INSTEAD_OF_MOVE cid#1545742 COPY_INSTEAD_OF_MOVE cid#1545735 COPY_INSTEAD_OF_MOVE cid#1545689 COPY_INSTEAD_OF_MOVE Change-Id: If93debe8b00991761cf1876b3fce27b09906749e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161966 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-01-09lok: external data source listSzymon Kłos
Make possible to filter allowed data sources. It is used for WebDAV curl, WEBSERVICE function, cell external references. Change-Id: Ifc82af31ff1123b5656a21e6a27624fb1616db39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160196 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161772 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2024-01-01cid#1545411 Resource leakJulien Nabet
Change-Id: I3ecb388a69c261a74b6d1a7b7d467d1a32956916 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161449 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-12-31cid#1546464 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1546346 COPY_INSTEAD_OF_MOVE cid#1546342 COPY_INSTEAD_OF_MOVE cid#1546320 COPY_INSTEAD_OF_MOVE cid#1546305 COPY_INSTEAD_OF_MOVE cid#1546241 COPY_INSTEAD_OF_MOVE cid#1546162 COPY_INSTEAD_OF_MOVE cid#1546118 COPY_INSTEAD_OF_MOVE cid#1546048 COPY_INSTEAD_OF_MOVE cid#1545989 COPY_INSTEAD_OF_MOVE cid#1545936 COPY_INSTEAD_OF_MOVE Change-Id: I63bc43378b36f7c49e66231152138ad7038971e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161507 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-31Replace "size() == 0 with empty()" (ucb)Julien Nabet
Change-Id: I82a97841d4d02d6d4388be17f5b3c87bbf0c325f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161470 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-12-30cid#1545421 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1545403 COPY_INSTEAD_OF_MOVE cid#1545397 COPY_INSTEAD_OF_MOVE cid#1545376 COPY_INSTEAD_OF_MOVE cid#1545339 COPY_INSTEAD_OF_MOVE cid#1545288 COPY_INSTEAD_OF_MOVE Change-Id: I0e24a3fc7148d0b7ff8126debe3cddbb4fbdd713 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161453 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-28Use emplace_back instead of push_back (ucb)Julien Nabet
Change-Id: I3cef6ad53d4420d259a038058f989cbdc324fb43 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161386 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-12-16cid#1545970 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1545957 COPY_INSTEAD_OF_MOVE cid#1545944 COPY_INSTEAD_OF_MOVE cid#1545939 COPY_INSTEAD_OF_MOVE cid#1545931 COPY_INSTEAD_OF_MOVE cid#1545926 COPY_INSTEAD_OF_MOVE cid#1545909 COPY_INSTEAD_OF_MOVE cid#1545899 COPY_INSTEAD_OF_MOVE cid#1545896 COPY_INSTEAD_OF_MOVE cid#1545894 COPY_INSTEAD_OF_MOVE cid#1545858 COPY_INSTEAD_OF_MOVE cid#1545823 COPY_INSTEAD_OF_MOVE cid#1545820 COPY_INSTEAD_OF_MOVE cid#1545819 COPY_INSTEAD_OF_MOVE cid#1545772 COPY_INSTEAD_OF_MOVE cid#1545749 COPY_INSTEAD_OF_MOVE cid#1545743 COPY_INSTEAD_OF_MOVE cid#1545739 COPY_INSTEAD_OF_MOVE cid#1545635 COPY_INSTEAD_OF_MOVE cid#1545603 COPY_INSTEAD_OF_MOVE cid#1545602 COPY_INSTEAD_OF_MOVE cid#1545592 COPY_INSTEAD_OF_MOVE cid#1545544 COPY_INSTEAD_OF_MOVE cid#1545532 COPY_INSTEAD_OF_MOVE cid#1545520 COPY_INSTEAD_OF_MOVE cid#1545512 COPY_INSTEAD_OF_MOVE cid#1545490 COPY_INSTEAD_OF_MOVE cid#1545483 COPY_INSTEAD_OF_MOVE cid#1545467 COPY_INSTEAD_OF_MOVE cid#1545461 COPY_INSTEAD_OF_MOVE cid#1545458 COPY_INSTEAD_OF_MOVE cid#1545428 COPY_INSTEAD_OF_MOVE cid#1545394 COPY_INSTEAD_OF_MOVE cid#1545385 COPY_INSTEAD_OF_MOVE cid#1545383 COPY_INSTEAD_OF_MOVE cid#1545366 COPY_INSTEAD_OF_MOVE cid#1545357 COPY_INSTEAD_OF_MOVE Change-Id: I76224326977b4067b94ca3176cad1ca6de17930a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160847 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-10cid#1545789 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1545791 COPY_INSTEAD_OF_MOVE cid#1545800 COPY_INSTEAD_OF_MOVE cid#1545806 COPY_INSTEAD_OF_MOVE cid#1545817 COPY_INSTEAD_OF_MOVE cid#1545832 COPY_INSTEAD_OF_MOVE cid#1545834 COPY_INSTEAD_OF_MOVE cid#1545841 COPY_INSTEAD_OF_MOVE cid#1545848 COPY_INSTEAD_OF_MOVE cid#1545852 COPY_INSTEAD_OF_MOVE cid#1545854 COPY_INSTEAD_OF_MOVE cid#1545864 COPY_INSTEAD_OF_MOVE cid#1545875 COPY_INSTEAD_OF_MOVE cid#1545882 COPY_INSTEAD_OF_MOVE cid#1545900 COPY_INSTEAD_OF_MOVE cid#1545901 COPY_INSTEAD_OF_MOVE cid#1545908 COPY_INSTEAD_OF_MOVE cid#1545921 COPY_INSTEAD_OF_MOVE cid#1546054 COPY_INSTEAD_OF_MOVE cid#1546145 COPY_INSTEAD_OF_MOVE cid#1546146 COPY_INSTEAD_OF_MOVE Change-Id: I8b23d0457cb293aa0e33593131224c1cdd1d8eb1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160545 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-10cid#1545177 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1545179 COPY_INSTEAD_OF_MOVE cid#1545187 COPY_INSTEAD_OF_MOVE cid#1545188 COPY_INSTEAD_OF_MOVE cid#1545189 COPY_INSTEAD_OF_MOVE cid#1545196 COPY_INSTEAD_OF_MOVE cid#1545197 COPY_INSTEAD_OF_MOVE cid#1545204 COPY_INSTEAD_OF_MOVE cid#1545223 COPY_INSTEAD_OF_MOVE cid#1545236 COPY_INSTEAD_OF_MOVE cid#1545239 COPY_INSTEAD_OF_MOVE cid#1545253 COPY_INSTEAD_OF_MOVE cid#1545274 COPY_INSTEAD_OF_MOVE cid#1545286 COPY_INSTEAD_OF_MOVE cid#1545309 COPY_INSTEAD_OF_MOVE cid#1545311 COPY_INSTEAD_OF_MOVE cid#1545345 COPY_INSTEAD_OF_MOVE cid#1545358 COPY_INSTEAD_OF_MOVE cid#1545361 COPY_INSTEAD_OF_MOVE cid#1545365 COPY_INSTEAD_OF_MOVE cid#1545367 COPY_INSTEAD_OF_MOVE cid#1545372 COPY_INSTEAD_OF_MOVE cid#1545373 COPY_INSTEAD_OF_MOVE cid#1545377 COPY_INSTEAD_OF_MOVE cid#1545392 COPY_INSTEAD_OF_MOVE cid#1545399 COPY_INSTEAD_OF_MOVE cid#1545404 COPY_INSTEAD_OF_MOVE cid#1545408 COPY_INSTEAD_OF_MOVE cid#1545430 COPY_INSTEAD_OF_MOVE cid#1545439 COPY_INSTEAD_OF_MOVE cid#1545449 COPY_INSTEAD_OF_MOVE Change-Id: I3afe836a0bbc8bd70937035e60eb020435e413d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160539 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-10cid#1546281 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1546278 COPY_INSTEAD_OF_MOVE cid#1546276 COPY_INSTEAD_OF_MOVE cid#1546247 COPY_INSTEAD_OF_MOVE cid#1546244 COPY_INSTEAD_OF_MOVE cid#1546243 COPY_INSTEAD_OF_MOVE cid#1546220 COPY_INSTEAD_OF_MOVE cid#1546209 COPY_INSTEAD_OF_MOVE cid#1546207 COPY_INSTEAD_OF_MOVE cid#1546206 COPY_INSTEAD_OF_MOVE cid#1546205 COPY_INSTEAD_OF_MOVE cid#1546197 COPY_INSTEAD_OF_MOVE cid#1546180 COPY_INSTEAD_OF_MOVE cid#1546172 COPY_INSTEAD_OF_MOVE cid#1546165 COPY_INSTEAD_OF_MOVE cid#1546164 COPY_INSTEAD_OF_MOVE cid#1546158 COPY_INSTEAD_OF_MOVE cid#1546151 COPY_INSTEAD_OF_MOVE cid#1546135 COPY_INSTEAD_OF_MOVE cid#1546132 COPY_INSTEAD_OF_MOVE cid#1546129 COPY_INSTEAD_OF_MOVE cid#1546128 COPY_INSTEAD_OF_MOVE cid#1546122 COPY_INSTEAD_OF_MOVE cid#1546117 COPY_INSTEAD_OF_MOVE cid#1546113 COPY_INSTEAD_OF_MOVE cid#1546106 COPY_INSTEAD_OF_MOVE cid#1546099 COPY_INSTEAD_OF_MOVE cid#1546091 COPY_INSTEAD_OF_MOVE cid#1546085 COPY_INSTEAD_OF_MOVE cid#1546069 COPY_INSTEAD_OF_MOVE cid#1546063 COPY_INSTEAD_OF_MOVE cid#1546062 COPY_INSTEAD_OF_MOVE cid#1546058 COPY_INSTEAD_OF_MOVE cid#1546056 COPY_INSTEAD_OF_MOVE cid#1546051 COPY_INSTEAD_OF_MOVE cid#1546040 COPY_INSTEAD_OF_MOVE cid#1546030 COPY_INSTEAD_OF_MOVE cid#1546028 COPY_INSTEAD_OF_MOVE cid#1546015 COPY_INSTEAD_OF_MOVE cid#1546001 COPY_INSTEAD_OF_MOVE Change-Id: Ib954c92a300fc323b29f27880fdf8bc46ed98862 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160520 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-08cid#1546472 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1546459 COPY_INSTEAD_OF_MOVE cid#1546452 COPY_INSTEAD_OF_MOVE cid#1546403 COPY_INSTEAD_OF_MOVE cid#1546396 COPY_INSTEAD_OF_MOVE cid#1546394 COPY_INSTEAD_OF_MOVE cid#1546338 COPY_INSTEAD_OF_MOVE cid#1546324 COPY_INSTEAD_OF_MOVE Change-Id: If61457cfaf1d7ce4a069bcecdc0cc657aeb43c68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160445 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-04cid#1545566 COPY_INSTEAD_OF_MOVECaolán McNamara
Change-Id: Ifd6c15630991c922f9392940142bb16c5e83685c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160286 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-04cid#1546455 COPY_INSTEAD_OF_MOVECaolán McNamara
Change-Id: I9ea3cad738f5cbef0036fde9112b391893aff615 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160277 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-11-29Extended loplugin:ostr: ucbStephan Bergmann
Change-Id: If6f818506ef7a596a6ea3af4185859b09c6d4d75 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160096 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2023-11-29cid#1557589 Use of auto that causes a copyCaolán McNamara
Change-Id: Ie2c790420ce5fe2e2804f33ff552c2252dc0cc0b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160014 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-11-20c++20: use std::erase(_if) instead of std::remove(_if)+erase (ucb)Julien Nabet
Change-Id: I9ce4ae0246f78acd7bfed89f52103c2f5e571c14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159706 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-11-11Move user agent initialization to InitCurl_easyMike Kaganski
Places that didn't initialize it previously, would benefit automatically Change-Id: I2f1ff25fc58d9378462072bc92d7b37be2370fc8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159299 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-11-09tdf#146386 curl,ucb: remove FTP UCPMichael Stahl
FTP support has been deprecated since LO 7.4. The UCP currently doesn't even support TLS connections. Also disable FTP protocol in libcurl. Also remove JunitTest_ucb_complex: turns out the only test in it, checkWrongFtpConnection, fails on Linux because now GIO UCP handles ftp:// URLs and it throws InteractiveAugmentedIOException instead of expected ones, and on other platforms it would fail differently because there is no GIO. Change-Id: I4631d124371fef390f105fb16bf09aaa59e739e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159065 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-11-09officecfg,*: add Office::Security::Net::AllowInsecureProtocolsMichael Stahl
By default, unencrypted network connections are allowed. But now it can be disabled, for everything that uses libcurl. Change-Id: I8e103f5a968ace2a19fdb9d6934c9a51b2aeabe4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159011 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-11-07curl: mitigate migration to OpenSSL on LinuxMichael Stahl
The problem is that curl 8.3.0 removed the NSS backend, so we now have no other choice than to use the bundled OpenSSL on Linux. Currently any curl https connection fails with: CurlSession.cxx:963: curl_easy_perform failed: (60) SSL certificate problem: unable to get local issuer certificate Apparently this requires manually telling curl which CA certificates to trust; there is a configure flag --with-ca-bundle but that is useless as it tries to load the file relative to whatever is the current working directory, and also did i mention that there are at least 3 different locations where a Linux system may store its system trusted CA certificates because ALL ABOUT CHOICE. So add a new header with an init function to try out various file locations listed in this nice blog article and call it from way too many places that independently use curl. https://www.happyassassin.net/posts/2015/01/12/a-note-about-ssltls-trusted-certificate-stores-and-platforms/ TODO: perhaps bundle a cacert.pem as a fallback in case the system chose to innovate by putting its certificates in yet another unexpected place (regression from commit c2930ebff82c4f7ffe8377ab82627131f8544226) Change-Id: Ibf1cc0069bc2ae011ecead9a4c2b455e94b01241 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158915 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-10-28use more XModel3::getArgs2Noel Grandin
to avoid needing to query other, rather expensive properties Change-Id: I34ebc7a03e468f0a7fa9964954e5690ad336016a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158579 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-10-23Extended loplugin:ostr: Rewrite some O[U]StringLiteral -> O[U]StringStephan Bergmann
...in include files. This is a mix of automatic rewriting in include files and manual fixups (mostly addressing loplugin:redundantfcast) in source files that include those. Change-Id: I1f3cc1e67b9cabd2e9d61a4d9e9a01e587ea35cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158337 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-20Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: ucbStephan Bergmann
Change-Id: Ic3123585203ebcdf2fe791709d38551e7a326d04 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158246 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-14Use exception ctors, instead of setting members laterMike Kaganski
Avoids overwriting source location in message Change-Id: Ia0290c7dd1ab3ea1357712a27ecab75c7b583dd4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157893 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-10-11upgrade to libcmis 0.6.0Caolán McNamara
Change-Id: Ia22d2efca14b1f55f45a4ecb9c487591c3117e17 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157704 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-09-10using decls should come after #includeNoel Grandin
Change-Id: I058551e87bca42adede860f6f299b0f7ae2af3b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156798 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-28new loplugin:optionalboolNoel Grandin
which warns against using the 'operator bool' conversion of std::optional<bool> which can lead to interesting bugs The bugs that this plugin have been submitted independantly, so this change is just using has_value() in relevant places. Change-Id: I259b837feeecddcb8cd1d7e5db1e85bf505907cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155978 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-18ucbhelper,ucb,desktop: InternetProxyServer is problematicMichael Stahl
It turns out that every single client of InternetProxyDecider simply concatenates the 2 members of InternetProxyServer into a single string and passes it on to curl_easy_setopt(CURLOPT_PROXY), which will happily take a URL including scheme and everything. It turns out that the awful GetUnixSystemProxy() tries to cut off the scheme in a terrible way, but GetPACProxy() does no such thing and WINHTTP_PROXY_INFO::lpszProxy may or may not contain scheme in its entries; fix this to only separate the port and leave the rest alone. So why do we need a InternetProxyServer struct? Because officecfg has separate entries that correspond to its members, and so InternetProxyDecider gets separate events on its listener interface when any of them changes, which is easiest to handle if it stores these separately. So just return a concatenated URL with or without scheme in getProxy(). Change-Id: I43c696471c8bec90667b5930fa00975adb432fe1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155840 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-18Fix curl proxy access for non-authenticated proxyNoel Grandin
If rSession.m_Proxy.aName is a simple host-name, the CurlUri constructor will fail with CURLUE_BAD_SCHEME, so just ignore the error here, we only care about parsing out the username/password Change-Id: Iec2d6e7315a5899ddddf6120a43199b75bf62db2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155834 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-07-01Use getXWeak in ucbMike Kaganski
Change-Id: Id94a89596bd473ed8c83d7be89ba673d8dc1bba1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150878 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-06-28Simplify a bitMike Kaganski
Change-Id: Iad2564853a2a0d74cd526b1574e421e121fd6986 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153644 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-06-27loplugin:stringstatic look for more stringsNoel Grandin
that can be initialised at compile-time instead of runtime Change-Id: I08d516fdc13a3a79f93c079f89ac44cbc7a1ed71 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153620 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-06-26new loplugin:constexprliteralNoel Grandin
OUStringLiteral should be declared constexpr, to enforce that it is initialised at compile-time and not runtime. This seems to make a different at least on Visual Studio Change-Id: I1698f5fa22ddb480347c2f4d444530c2e0e88d92 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153499 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-06-15ooo#41037 Reject URLs containing unencoded NUL charactersStephan Bergmann
Change-Id: I45bbd342734f190ce918b610441ca911a47830b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153062 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-06-07ucb: webdav-curl: auth data is invalid when receiving 401Michael Stahl
Even if it used to be valid before; unfortunately newly entered credentials weren't actually used because the flag was never reset. Change-Id: Ib36689f40ff780596b9cfe6fe589a6f2e79cfcd2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152679 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-05-25merge some stringaddsNoel Grandin
found with a lightly tweaked version of the loplugin:stringadd and some hand-holding. Change-Id: I146aadcaf665e98fea89a9cad2df4dc3935622f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152275 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>