@@ -701,28 +701,40 @@ for other purposes too.
701701
702702The ` perMachine ` field in the top-level object is an array of objects. When
703703processing the user record first the various fields on the top-level object
704- should be used. Then this array should be iterated in order, and the various
705- settings be applied that match either the indicated machine ID or host
706- name. There may be multiple array entries that match a specific system, in
707- which case all the object's setting should be applied. If the same option is
708- set in the top-level object as in a per-machine object the latter wins and
709- entirely undoes the setting in the top-level object (i.e. no merging of
710- properties that are arrays themselves is done). If the same option is set in
711- multiple per-machine objects the one specified later in the array wins (and
712- here too no merging of individual fields is done, the later field always wins
713- in full).
704+ should be parsed. Then, the ` perMachine ` array should be iterated in order, and
705+ the various settings within each contained object should be applied that match
706+ either the indicated machine ID or host name, overriding any corresponding
707+ settings previously parsed from the top-level object. There may be multiple
708+ array entries that match a specific system, in which case all settings should
709+ be applied. If the same option is set in the top-level object as in a
710+ per-machine object then the per-machine setting wins and entirely undoes the
711+ setting in the top-level object (i.e. no merging of properties that are arrays
712+ is done). If the same option is set in multiple per-machine objects the one
713+ specified later in the array wins (and here too no merging of individual fields
714+ is done, the later field always wins in full). To summarize, the order of
715+ application is (last one wins):
716+
717+ 1 . Settings in the top-level object
718+ 2 . Settings in the first matching ` perMachine ` array entry
719+ 3 . Settings in the second matching ` perMachine ` array entry
720+ 4 . …
721+ 5 . Settings in the last matching ` perMachine ` array entry
714722
715723The following fields are defined in this section:
716724
717725` matchMachineId ` → An array of strings that are formatted 128bit IDs in
718726hex. If any of the specified IDs match the system's local machine ID
719- (i.e. matches ` /etc/machine-id ` ) the fields in this object are honored.
727+ (i.e. matches ` /etc/machine-id ` ) the fields in this object are honored. (As a
728+ special case, if only a single machine ID is listed this field may be a single
729+ string rather than an array of strings.)
720730
721- ` matchHostname ` → An array of strings that are valid hostnames. If any of
722- the specified hostnames match the system's local hostname, the fields in this
731+ ` matchHostname ` → An array of strings that are valid hostnames. If any of the
732+ specified hostnames match the system's local hostname, the fields in this
723733object are honored. If both ` matchHostname ` and ` matchMachineId ` are used
724734within the same array entry, the object is honored when either match succeeds,
725- i.e. the two match types are combined in OR, not in AND.
735+ i.e. the two match types are combined in OR, not in AND. (As a special case, if
736+ only a single machine ID is listed this field may be a single string rather
737+ than an array of strings.)
726738
727739These two are the only two fields specific to this section. All other fields
728740that may be used in this section are identical to the equally named ones in the
0 commit comments