Commit graph

252 commits

Author SHA1 Message Date
CismonX
1d00501355
build: refactor EX_FEAT() helper macro
- Rename local m4 definitions with `ex_` prefix.
- Rename AC_DEFINE() definitions with `ENABLE_` prefix.
- Remove flag `N`, use `Y` only.
2025-07-18 17:20:12 +08:00
CismonX
96c1835512
doc: minor cleanup for user and install manual 2025-07-14 20:43:18 +08:00
CismonX
602519db12
build: misc refactor
EX_DEP():
- Do not generate feature check code if `feat-names` is empty.
- Improve docs.

others:
- Reuse `$host_os` for system type check result.
2025-07-12 12:53:16 +08:00
CismonX
296b85cbe9
build: refactor feature variable exporting
- Remove EX_AMCOND() and EX_FEAT_EXPORT(), instead add flags to
  EX_FEAT() to check whether a feature should be exported.
- Only mark a feature to be exported with AM_CONDITIONAL() when
  it is checked within either */Makefile.am or tests/atlocal.in.
- Only add a feature to test/atlocal.in when it is checked by
  ATX_FEAT_*().
- Move feature "bookmarkfs-util" after features that may enable it,
  so that its enable status can be correctly displayed.
2025-07-12 12:52:28 +08:00
CismonX
300e3d889a
test: skip sandbox tests if not enabled 2025-07-11 23:44:21 +08:00
CismonX
328095ae43
build: install man pages by default
Since we're already installing man pages conditionally
(only install a man page when the corresponding program is enabled),
it makes more sense to install them by default,
instead of having to install separately with `make install-man`.
2025-07-09 21:02:22 +08:00
CismonX
d911439ca3
xattr: fix xattr_do_get/xattr_do_list return value
The functions should return negated errno on failure,
since bookmarkfs_xattr_get() and bookmarkfs_xattr_list() check
whether the syscall fails with ERANGE.
2025-07-06 11:29:55 +08:00
CismonX
f9940400bb
chore: bump version to 0.1.3 2025-07-01 13:37:05 +08:00
CismonX
f97e4b73c1
ci: tidy up config options
- No need to `--enable-bookmarkfs-util`, since it's implicitly done
  by enabling other components.
- No need to `--enable-xxhash-inline`, since it's now the default.
2025-06-29 12:24:04 +08:00
CismonX
65d29fd017
build: inline libxxhash by default 2025-06-29 12:19:11 +08:00
CismonX
30f82f5613
doc: update doc for the -h and -V options 2025-06-27 13:24:31 +08:00
CismonX
c90cb669f2
fsck: also print the version of the util library
This information is considered useful, since online fsck
requires the utility library (for its sandboxing feature).
2025-06-25 23:50:35 +08:00
CismonX
9703f42c0c
backend_firefox: bump max supported schema version 2025-06-24 08:47:51 +08:00
CismonX
b9f1f74c69
doc: improve docs
- Remove some useless babbles.
- Better pseudo-code examples for ioctls.
- Wording and structuring improvements.
- ...
2025-06-23 21:19:47 +08:00
CismonX
52c48c92b8
backend_firefox: use wal mode in backend_mkfs()
This also allows us to reinstate the sandboxed db_check(), which
was removed in commits 35d4a93a41
and 0fd2cbbc9d.
2025-06-22 12:44:42 +08:00
CismonX
ffa28a4091
test: fetch prng seed from environment variable
Tests that require PRNG are by default seeded from `/dev/urandom`.
However, the user should be able to override with a given seed
to reproduce a failing test.

Instead of messing with command-line arguments, a cleaner approach
is to fetch the seed from an environment variable.
2025-06-19 16:51:35 +08:00
CismonX
6c38779e78
prng: debug-print seed if fetched from getrandom() 2025-06-19 16:49:41 +08:00
CismonX
72d55ed68f
test: do not skip test if a backend is disabled
For `ATX_CHECK_FS()` and `ATX_CHECK_FS_NEW()`, do not skip the test
if a backend (or its "-write" feature) is disabled, since
`exit 77` skips the entire test group, not current `AT_CHECK()`.

Instead, silently pass the current test.
2025-06-19 08:02:03 +08:00
CismonX
dad1984d7f
build: move bookmarkfs_util.pc.in to ./src
Whatever pkg-config is interested in all lies within ./src.
2025-06-18 16:13:07 +08:00
CismonX
9de097d9ee
build: refactor configuration scripts
- Move common `AC_DEFINE()` usage to `EX_FEAT()`.
- Remove unused argument `action-if-disabled` for `EX_FEAT()`.
- Conditionally enable features by default.
2025-06-17 13:41:17 +08:00
CismonX
fb0d39dfc3
defs: remove HAVE_PIPE2 macro
This feature check is only used in `xpipe2()`.
2025-06-17 12:24:08 +08:00
CismonX
99ac2b79f8
test: misc fix and refactor 2025-06-16 18:32:36 +08:00
CismonX
ba9a23c295
backend_firefox: refactor db query utils
- `DO_QUERY()` macro:
  * Pass stmt idx as argument instead of pointer.
  * Remove the `BEFORE_QUERY` argument.
- Shorter names for stmt idx.
2025-06-16 11:22:53 +08:00
CismonX
31f4311419
backend_firefox: misc refactor
- `mozorigin_get()`, `mozplace_addref()`: pass struct as argument.
- `parse_mozurl_host()`: rename to `parse_mozurl`; add comments;
  store parse results to argument of type `struct mozorigin`.
- Rename objects of type `struct mozXXX` from `XXX_cols` to `mX`.
- ...
2025-06-15 17:45:52 +08:00
CismonX
6fc165ff65
all: properly handle time_t on 32-bit platforms
Do not force 64-bit `time_t` on 32-bit platforms, since libfuse
does not do so.  Linking shared objects with incompatible types
breaks ABI, resulting in undefined behavior.

Instead, add run-time checks to make sure that timestamps do not
overflow.  If they do, set to `INT32_MAX`.

Also tidy up build scripts, tests, and the installation guide.
2025-06-14 11:43:03 +08:00
CismonX
f1451d206e
chore: bump version to 0.1.2 2025-06-12 11:31:39 +08:00
CismonX
303c934894
test: misc refactor
- If the utility library is not built, link to the existing library
  when building helper programs for filesystem tests.
- Refactor PRNG seeding in tests.
2025-06-11 20:45:16 +08:00
CismonX
14b5a79147
build: fix builds with existing utility library
Regression in commit 81db7a786c.
2025-06-11 17:11:19 +08:00
CismonX
1e5149cdc0
doc: misc corrections and improvements 2025-06-10 21:17:37 +08:00
CismonX
6f2a00dd6f
fs_ops: refactor setattr
- Only perform one operation per call.
- Always fail with EPERM if given unsupported flags.
2025-06-09 19:51:25 +08:00
CismonX
c23623b5a3
test: add tests for file atime/mtime 2025-06-08 12:34:10 +08:00
CismonX
fdfd6fe069
backend_firefox: fix directory attr update 2025-06-08 07:24:39 +08:00
CismonX
5082e7c67c
fs_ops: fix mtime update of regular files
Explicit mtime update (e.g., via futimens(2)) should override
file handle mtime.
2025-06-07 19:55:27 +08:00
CismonX
72b9e200d9
fs_ops: misc refactor
- Use nodeid for fh_map keys as well as bm_*() and intfs_*() args.
- bm_readdir(), fs_op_rename(): check subsys type more gracefully.
- ...
2025-06-07 08:57:48 +08:00
CismonX
29338ca02b
backend_firefox: purge dangling refs on delete
When a bookmark is deleted, if there are no other bookmarks
referencing the corresponding `moz_place` entry, tag and keyword
references to that entry are considered "dangling" references,
and shall be automatically removed.

Also reverts commit b5fa6960ef,
since the NULL title check is no longer necessary.
2025-06-06 22:46:44 +08:00
CismonX
eb426f9fc4
bookmarkctl: xattr-get: rename -m option to -a 2025-06-06 19:41:09 +08:00
CismonX
b5fa6960ef
backend_firefox: hide dangling keywords
When a bookmark associated with a keyword is deleted,
there may still be dangling references (e.g., tags) to the
corresponding `moz_places` entry.

By filtering out NULL titles, `bookmark_lookup()` and
`bookmark_list()` now only give keywords associated with
valid bookmarks.
2025-06-05 08:27:59 +08:00
CismonX
6fb9438d3c
fs_ops: fix opendir for keyword directory 2025-06-05 07:39:53 +08:00
CismonX
c1cf9db2a1
test: add tests for tags and keywords 2025-06-02 09:20:19 +08:00
CismonX
495f8592e6
fs_ops: fix deletion of tag directories 2025-06-02 08:41:33 +08:00
CismonX
d5eae85774
test: refactor filesystem tests 2025-06-01 21:35:07 +08:00
CismonX
ab88e0e839
test: add tests for directory entries 2025-05-28 18:51:02 +08:00
CismonX
e6809b7e84
xstd: add xgetdents() 2025-05-28 18:27:55 +08:00
CismonX
5a28b069c4
fs_ops: fix file size opened with O_CREAT|O_TRUNC
Also make sure that new regular files always have a size of zero.
2025-04-29 14:48:39 +08:00
CismonX
83f201435f
backend_firefox: add keyword xattr
This allows users to quickly discover which keyword is
associated with a given bookmark.

Updating keywords via xattr is not implemented,
since it can be done trivially using existing API.
2025-04-29 12:46:29 +08:00
CismonX
0e20604c73
backend_firefox: fix stmt id for keyword delete 2025-04-28 20:04:40 +08:00
CismonX
9c0d5fb337
test: improve filesystem tests
- Add a final check to see whether the fs daemon is still there.
- Other misc updates.
2025-04-07 19:32:44 +08:00
CismonX
565063ee9b
chore: bump version to 0.1.1 2025-04-07 12:23:50 +08:00
CismonX
763bba9444
backend_firefox: fix bookmark_check()
Regression in commit 85b02f6c2b.
2025-04-03 10:23:54 +08:00
CismonX
5ad23ac8f6
hashmap: allow rehash failure
There is a chance that rehash may fail,
even with a decent hash function, and no collision attack.

Allow the hashmap to be rehashed for a second time during insert,
and ignore rehash failures during delete.
2025-04-03 09:51:09 +08:00