Commit graph

15 commits

Author SHA1 Message Date
Ashod Nakashian
480fb7b931 wsd: move tokenizer helpers into StringVector
In an attempt to reduce the size of Util.{c,h}pp
which has grown to contain all sorts of unrelated
helpers, we move StringVector helpers into
the StringVector.{c,h}pp files.

This makes the code better organized.

Change-Id: I152f341606807ae66253415b951bc9f89b09df57
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-04-12 07:39:07 -04:00
Ashod Nakashian
5757c17b6b wsd: clang-tidy fixes
Also, reduce public function surface-area.

Change-Id: Ia922e19c49a731a83bbd3d1dc645355926ddba3c
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-04 10:26:49 -05:00
Pranam Lashkari
63b6d8a9d2 Quarantine: fixed quarantining when jail mounting is disabled
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I9159c6fe33d66f64e56e084a203af74629e330c6
2021-12-15 08:32:19 +01:00
Andras Timar
b40a72877a quarantine: add the original file name to the quarantined file name
Instead of
1638118271_12013_%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F289_ocvq040ushf2
we would get
1638118271_12013_%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F289_ocvq040ushf2_bad.docx
I find it more useful.

Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I50918908173adeb68964b2aa542592b57ec82020
2021-11-29 13:37:19 +01:00
Pranam Lashkari
de703d6537 quarantine: quarantine file on exit too
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I1c5efa5d0e339ed2225969ad6680c73c9fe474d0
2021-11-25 09:59:11 +02:00
Andras Timar
f07ff8c7e0 rename: remaining lool->cool changes
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: Ib7d4e804bebe52dead8d53b0e0bbaed0f08bf3d0
2021-11-18 14:14:11 +01:00
Pranam Lashkari
e73cea0ff3 quarantine: automatically delete quarantined files after specified time
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Idabef2aec46d6b7c194ef06f4235b60d6ad29e4a
2021-11-17 10:43:43 +01:00
Henry Castro
c2d60f3627 wsd: rename 'lool' -> 'cool'
Change-Id: I4ece04921a0e12d4c69b2a70b563e66cc89be0a6
Signed-off-by: Henry Castro <hcastro@collabora.com>
2021-11-17 09:17:54 +01:00
Tor Lillqvist
199b608225 Improve error handling when link() fails
Use the normal convention of saving errno in a local variable right
after a system call has failed. (To be safe in case some other
irrelevant system call fails before we get to output the message for
errno.)

Use both Util::symbolicErrno() (so that a developer sees the actual
symbolic error name as in manpages and code) and strerror() (for
nominally helpful plaintext explanation of what that errno value
means) in the output.

Use explicit std:: prefix for strerror() (because that is cleaner and
it is our convention).

Use << operators in the LOG_FOO calls instead of concatenating strings
with the + operator.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I75f42051f81661eea62235019ef9a0925239ce00
2021-11-08 14:35:46 +02:00
Tor Lillqvist
07f2921c9c Fix obviously wrong strerror() usage
The parameter to strerror() should be an errno value, not the return
value from a failed system call (which is always -1 in this case).

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I61baf348988f3e6577aab30bf985e0fe646291fd
2021-11-08 14:35:46 +02:00
Andras Timar
1f4dad602f typo: missing space
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I7a25f6311f2ce5f7c20cb96eab2cb649dcdd8fa0
2021-11-04 14:23:26 +01:00
Andras Timar
531394381a Better error message when quarantining failed
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: Ib5722237a0f0b2962552470f35abc8e1042c9b7d
2021-11-04 14:09:51 +01:00
Pranam Lashkari
15f5ce6e52 Quarantine: minor correction for path resolution
some code cleaning for code repeatation

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I4ea7972ed711eba41c7bbcfa36b8db607ad3d738
2021-11-03 16:51:52 +05:30
Pranam Lashkari
e7c2f5cd07 quarantine: keep quarantine off by default
allow path specification for the quarantine directory

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I407288db60fe5fbf0f6a9346175c3d4acfd35add
2021-11-03 09:57:00 +02:00
Pranam Lashkari
f84df1161c quarantine: create hard links for quarantining when file is saved
number of versions to maintain per file can be specified in loolwsd.xml
on exceeding specified quarantine size oldest file(s) is deleted

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I3ca55b9ab29a82988f19fe0acd43e0fae2c2a423
2021-11-01 17:21:51 +02:00