You are not logged in.
Hello.
Regarding the man page for crypttab:
There is a parameter named try-empty-password= with the following description:
try-empty-password=
Takes a boolean argument. If enabled, right before asking the user for a password it is first attempted to unlock the volume with an empty password. This is useful for systems that are initialized with an encrypted volume with only an empty password set, which shall be replaced with a suitable password during first boot, but after activation.
Added in version 246.
From my experience, the characteristic that a parameter takes a boolean argument usually means that the parameter requires an argument that specifies unambiguously whether the parameter should be either activated or deactivated.
What exact choice of words or syntaxes would be proper as argument for this parameter? And how should I be able to figure this out? I fail to interpret this from the man page.
In contrast, for example, the parameters headless=, password-cache= and password-echo= are all described with their proper words/syntaxes. However, the same words/syntaxes are not described consistently for all boolean parameters on the man page:
headless=
Takes a boolean argument, defaults to false. If true, never query interactively for the password/PIN. Useful for headless systems.
Added in version 249.password-cache=yes|no|read-only
[...]password-echo=yes|no|masked
[...]
In my mind, the proper arguments for the parameter try-empty-password= could be anything of either yes|no, true|false, on|off, 1|0, active|inactive or something similar.
Last edited by SeagullFish (2025-09-01 19:17:53)
Offline
And you'd be right in your assumption, here's the source code for the `parse_boolean` function that systemd's cryptsetup uses: https://github.com/systemd/systemd/blob … util.c#L21
If you are worried that setting the parameter incorrectly would break something, then no, it would simply be ignored.
And how should I be able to figure this out?
I used the following steps to arrive at the solution:
man crypttab
G
[see systemd in the bottom-left corner]
go to systemd's github repository
search for the "try-empty-password=" string
click on the `parse_boolean` function
see that there are two definitions of the function
check the #include lines at the top of the file to disambiguate
see `parse-utils.h`
go to the `parse-utils.c` definition of the `parse_boolean` functionsystemd's code base is particularly well maintained so it's easy to inspect. Also, you have to be logged in to search for code on github. You can always `git clone` the repository and perform the search locally.
Offline
I used the following steps to arrive at the solution:
These were really helpful learning points for me. Thank you very much!
From what I interpret, systemd will understand any of the following arguments:
1|0, yes|no, y|n, true|false, t|f, on|off
Too bad this is not described more clearly in the man page.
Anyway, case [SOLVED].
Offline