Marcin Haba [Mon, 27 Feb 2023 09:22:16 +0000 (10:22 +0100)]
baculum: Add a new endpoint to list jobs together with objects
Other changes:
- add realstarttime_from and realstarttime_to filters to job list and job object list endpoints
- general performance improvements and optimizations
- add job result modes
- refactor job overview part
regress: fix copy-job-test for #9116, add the / in [/]bin/true
- the test was still working, but not testing the bugfix for #9116
- I have enclosed the extra code into a "if fi" just before to push
the fix, then the fix was well tested before the push, don't worry
Fix #9535 avoid "Will not descend from / to /good_dir"
- when attributes are backed up, a function check_current_fs()
update FF_PKT::last_fstype without updating FF_PKT::last_fstypename
this make fstype() not refresh last_fstypename when last_fstype
match the the value returned by statfs
- notice that fstype() whas alredy checking if last_fstypename[0]
to force a refresh
- IMPORTANT this patch change a little bit the behavior of the original
function, if fstype() cannot give a name to the FS then the
function return false, whil in the original function don't care about
the name and only compare the numeric ID
the check_current_fs() above the check the FS name (instead of its num ID)
also return false in this situation
- The problem is that the bacl.c and bxattr.c use this function
to detect the change of filesystem (this is the problem)
and if the new FS match one particular FS then set some flags.
Detecting if the FS has changed is done only with the numeric "f_type"
This is faster than comparing a string.
This is probably why check_current_fs() don't call fstype()
and call statfs() by himself.
Eric Bollengier [Tue, 10 Jan 2023 17:17:51 +0000 (18:17 +0100)]
Fix org#2666 About fixing getaddrinfo check in ./configure
Thanks to Florian Weimer
The exit function is not declared in this context, so the check will always
fail with compilers which do not accept implicit function declarations. Change
the return type of main to int and return directly from main instead.
Marcin Haba [Tue, 6 Dec 2022 10:50:14 +0000 (11:50 +0100)]
baculum: Add new filters to object category sum endpoint
Changes:
- add new filters
- rework /objects/stats/category-sum endpoint with keeping compatibility
- change /jobs/stats/sum filter into /jobs/stats/type-sum
- datestart and dateend parameters are now deprecated
- datestart does not have default value (previously 1 month)
- update documentation
Thomas Franz [Mon, 19 Dec 2022 11:21:09 +0000 (12:21 +0100)]
Fix org#2665 About memory leak on FreeBSD with extended attributes
Extended attributes in FreeBSD exists for attrnamespace "user" and
"system". Bacula saves this data serializing extended attributes for every
file.
In the source bxattr_freebsd.c of bacula 13.0.1 the following problems could be
identified:
- Bug missing data during backup: If a file has extended attributes of type
"system" but not of type "user" then these are missing in the serializing
stream for the backup. This is caused by the return statement when no
extended attribute of type "user" exists.
- Memory leak when using extattr_namespace_to_string() because this function
calls strdup() and does never free the memory allocated by strdup(). This
problem did not exists until Bacula 7.4.4, but the correct handling was
dropped in Bacula 7.4.5.
- Memory leak during backup of files having extended attributes of both types
"user" and "system". In this case the pointer "xlist" is used first for
"user" and then for "system". The space allocated for "user" remains
allocated.
- Memory leak during backup of files having extended attributes of type "user"
but not of type "system". In this case a return statetement is done for type
"system" and the allocated memory for "user" cannot be freed in the coding
after "bail_out:".