Skip to content

Commit 912fb76

Browse files
poetteringbluca
authored andcommitted
man,doc: document some aspects of user record management/homed a bit better
Fixes: #29759 (cherry picked from commit 7480859)
1 parent 9ed9bfe commit 912fb76

File tree

2 files changed

+34
-17
lines changed

2 files changed

+34
-17
lines changed

docs/USER_RECORD.md

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -704,28 +704,40 @@ for other purposes too.
704704

705705
The `perMachine` field in the top-level object is an array of objects. When
706706
processing the user record first the various fields on the top-level object
707-
should be used. Then this array should be iterated in order, and the various
708-
settings be applied that match either the indicated machine ID or host
709-
name. There may be multiple array entries that match a specific system, in
710-
which case all the object's setting should be applied. If the same option is
711-
set in the top-level object as in a per-machine object the latter wins and
712-
entirely undoes the setting in the top-level object (i.e. no merging of
713-
properties that are arrays themselves is done). If the same option is set in
714-
multiple per-machine objects the one specified later in the array wins (and
715-
here too no merging of individual fields is done, the later field always wins
716-
in full).
707+
should be parsed. Then, the `perMachine` array should be iterated in order, and
708+
the various settings within each contained object should be applied that match
709+
either the indicated machine ID or host name, overriding any corresponding
710+
settings previously parsed from the top-level object. There may be multiple
711+
array entries that match a specific system, in which case all settings should
712+
be applied. If the same option is set in the top-level object as in a
713+
per-machine object then the per-machine setting wins and entirely undoes the
714+
setting in the top-level object (i.e. no merging of properties that are arrays
715+
is done). If the same option is set in multiple per-machine objects the one
716+
specified later in the array wins (and here too no merging of individual fields
717+
is done, the later field always wins in full). To summarize, the order of
718+
application is (last one wins):
719+
720+
1. Settings in the top-level object
721+
2. Settings in the first matching `perMachine` array entry
722+
3. Settings in the second matching `perMachine` array entry
723+
4.
724+
5. Settings in the last matching `perMachine` array entry
717725

718726
The following fields are defined in this section:
719727

720728
`matchMachineId` → An array of strings that are formatted 128-bit IDs in
721729
hex. If any of the specified IDs match the system's local machine ID
722-
(i.e. matches `/etc/machine-id`) the fields in this object are honored.
730+
(i.e. matches `/etc/machine-id`) the fields in this object are honored. (As a
731+
special case, if only a single machine ID is listed this field may be a single
732+
string rather than an array of strings.)
723733

724-
`matchHostname` → An array of strings that are valid hostnames. If any of
725-
the specified hostnames match the system's local hostname, the fields in this
734+
`matchHostname` → An array of strings that are valid hostnames. If any of the
735+
specified hostnames match the system's local hostname, the fields in this
726736
object are honored. If both `matchHostname` and `matchMachineId` are used
727737
within the same array entry, the object is honored when either match succeeds,
728-
i.e. the two match types are combined in OR, not in AND.
738+
i.e. the two match types are combined in OR, not in AND. (As a special case, if
739+
only a single machine ID is listed this field may be a single string rather
740+
than an array of strings.)
729741

730742
These two are the only two fields specific to this section. All other fields
731743
that may be used in this section are identical to the equally named ones in the

man/org.freedesktop.home1.xml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,14 @@ node /org/freedesktop/home1 {
305305
user record with the new passwords/authentication token data is specified as empty the existing user
306306
record's settings are propagated down to the home directory storage. This is typically used after a
307307
user record is updated using <function>UpdateHome()</function> in order to propagate the
308-
secrets/authentication tokens down to the storage. This method is equivalent to
309-
<function>ChangePassword()</function> on the <classname>org.freedesktop.home1.Home</classname>
310-
interface.</para>
308+
secrets/authentication tokens down to the storage. Background: depending on the backend the user's
309+
authentication credentials are stored at multiple places: the user record kept on the host, the user
310+
record kept in the home directory and the encrypted LUKS volume slot. If the home directory is used on
311+
a different machined temporarily, and the password is changed there, and then is moved back to the
312+
original host, the passwords of the three might get out of sync. By issuing
313+
<function>ChangePasswordHome()</function> the three locations are updated to match the newest
314+
information. This method is equivalent to <function>ChangePassword()</function> on the
315+
<classname>org.freedesktop.home1.Home</classname> interface.</para>
311316

312317
<para><function>LockHome()</function> temporarily suspends access to a home directory, flushing out any
313318
cryptographic keys from memory. This is only supported on some back-ends, and usually done during system

0 commit comments

Comments
 (0)