2019-12-08 00:29:43 -05:00
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
2019-12-10 07:00:13 -05:00
|
|
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
|
|
|
elementFormDefault="qualified"
|
2019-12-08 14:57:32 -05:00
|
|
|
attributeFormDefault="unqualified">
|
2019-12-08 01:42:33 -05:00
|
|
|
|
2019-12-09 08:29:38 -05:00
|
|
|
<xs:include schemaLocation="./std.xsd"/>
|
2019-12-08 03:27:20 -05:00
|
|
|
|
2019-12-10 07:00:13 -05:00
|
|
|
<xs:simpleType name="t_unix_filepath">
|
2019-12-08 02:07:21 -05:00
|
|
|
<xs:restriction base="xs:string">
|
2019-12-10 07:00:13 -05:00
|
|
|
<xs:pattern value="\s*(/[^/]+)+/?\s*"/>
|
|
|
|
<xs:whiteSpace value="collapse"/>
|
2019-12-08 02:07:21 -05:00
|
|
|
</xs:restriction>
|
|
|
|
</xs:simpleType>
|
|
|
|
|
2019-12-10 07:00:13 -05:00
|
|
|
<xs:complexType name="t_unix_nixpass">
|
2019-12-08 03:37:19 -05:00
|
|
|
<xs:choice minOccurs="1" maxOccurs="1">
|
|
|
|
<xs:element name="passwordPlain">
|
|
|
|
<xs:complexType>
|
|
|
|
<xs:simpleContent>
|
|
|
|
<xs:extension base="xs:string">
|
2019-12-10 07:00:13 -05:00
|
|
|
<xs:attribute name="hashType" use="optional" default="md5" type="t_unix_passwd_hashtypes"/>
|
2019-12-08 03:37:19 -05:00
|
|
|
<xs:attribute name="rounds" use="optional" default="5000" type="xs:positiveInteger"/>
|
|
|
|
</xs:extension>
|
|
|
|
</xs:simpleContent>
|
|
|
|
</xs:complexType>
|
|
|
|
</xs:element>
|
|
|
|
<xs:element name="passwordHash">
|
|
|
|
<xs:complexType>
|
|
|
|
<xs:simpleContent>
|
2019-12-10 07:00:13 -05:00
|
|
|
<xs:extension base="t_unix_shadowhash">
|
|
|
|
<xs:attribute name="hashType" use="optional" default="md5" type="t_unix_passwd_hashtypes"/>
|
2019-12-08 03:37:19 -05:00
|
|
|
</xs:extension>
|
|
|
|
</xs:simpleContent>
|
|
|
|
</xs:complexType>
|
|
|
|
</xs:element>
|
|
|
|
</xs:choice>
|
|
|
|
<xs:attribute name="locked" use="optional" default="false" type="xs:boolean"/>
|
|
|
|
</xs:complexType>
|
|
|
|
|
2019-12-10 07:00:13 -05:00
|
|
|
<xs:simpleType name="t_unix_passwd_hashtypes">
|
2019-12-08 02:07:21 -05:00
|
|
|
<xs:restriction base="xs:string">
|
|
|
|
<xs:enumeration value="md5"/>
|
|
|
|
</xs:restriction>
|
|
|
|
</xs:simpleType>
|
|
|
|
|
2019-12-10 07:00:13 -05:00
|
|
|
<xs:simpleType name="t_unix_posixUserGroup">
|
2019-12-08 01:42:33 -05:00
|
|
|
<!-- https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_437
|
|
|
|
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_282
|
|
|
|
https://unix.stackexchange.com/a/435120/284004 -->
|
|
|
|
<xs:restriction base="xs:token">
|
2019-12-10 07:00:13 -05:00
|
|
|
<xs:pattern value="\s*[a-z_]([a-z0-9_-]{0,31}|[a-z0-9_-]{0,30}$)\s*"/>
|
2019-12-08 01:42:33 -05:00
|
|
|
<xs:whiteSpace value="collapse"/>
|
|
|
|
</xs:restriction>
|
|
|
|
</xs:simpleType>
|
|
|
|
|
2019-12-10 07:00:13 -05:00
|
|
|
<xs:simpleType name="t_unix_shadowhash">
|
2019-12-08 01:42:33 -05:00
|
|
|
<!-- http://man7.org/linux/man-pages/man3/crypt.3.html#NOTES -->
|
|
|
|
<xs:restriction base="xs:token">
|
2019-12-10 07:00:13 -05:00
|
|
|
<xs:pattern value="\s*($1)?($[a-zA-Z0-9./]{1,16})$[a-zA-Z0-9./]{22}\s*"/><!-- md5 -->
|
2019-12-08 01:42:33 -05:00
|
|
|
<xs:whiteSpace value="collapse"/>
|
|
|
|
</xs:restriction>
|
|
|
|
</xs:simpleType>
|
|
|
|
|
2019-12-10 07:00:13 -05:00
|
|
|
<xs:complexType name="t_unix_user">
|
2019-12-08 03:05:00 -05:00
|
|
|
<xs:sequence>
|
2019-12-10 07:00:13 -05:00
|
|
|
<xs:element name="password" minOccurs="0" maxOccurs="1" type="t_unix_nixpass"/>
|
2019-12-08 03:05:00 -05:00
|
|
|
<xs:element name="xGroup" minOccurs="0" maxOccurs="unbounded">
|
|
|
|
<xs:complexType>
|
2019-12-10 07:00:13 -05:00
|
|
|
<xs:attribute name="name" type="t_unix_posixUserGroup" use="required"/>
|
2019-12-09 08:29:38 -05:00
|
|
|
<xs:attribute name="create" type="xs:boolean" use="optional" default="false"/>
|
|
|
|
<xs:attribute name="gid" type="xs:positiveInteger" use="optional"/>
|
2019-12-08 03:05:00 -05:00
|
|
|
</xs:complexType>
|
2019-12-10 07:00:13 -05:00
|
|
|
<xs:unique name="uniq_unix_grp">
|
|
|
|
<xs:selector xpath="xGroup"/>
|
2019-12-08 03:05:00 -05:00
|
|
|
<xs:field xpath="@name"/>
|
|
|
|
</xs:unique>
|
|
|
|
</xs:element>
|
|
|
|
</xs:sequence>
|
2019-12-10 07:00:13 -05:00
|
|
|
<xs:attribute name="name" type="t_unix_posixUserGroup" use="required"/>
|
|
|
|
<xs:attribute name="home" type="t_unix_filepath" use="optional"/>
|
2019-12-08 03:05:00 -05:00
|
|
|
<xs:attribute name="uid" type="xs:positiveInteger" use="optional"/>
|
2019-12-10 07:00:13 -05:00
|
|
|
<xs:attribute name="group" type="t_unix_posixUserGroup" use="optional"/>
|
2019-12-08 03:05:00 -05:00
|
|
|
<xs:attribute name="gid" type="xs:positiveInteger" use="optional"/>
|
2019-12-10 07:00:13 -05:00
|
|
|
<xs:attribute name="comment" type="t_std_nonempty" use="optional"/>
|
2019-12-09 08:29:38 -05:00
|
|
|
<xs:attribute name="sudo" type="xs:boolean" use="optional" default="false"/>
|
|
|
|
<xs:attribute name="sudoPassword" type="xs:boolean" use="optional" default="true"/>
|
2019-12-10 07:00:13 -05:00
|
|
|
<xs:attribute name="shell" type="t_unix_filepath" use="optional" default="/bin/bash"/>
|
2019-12-08 03:05:00 -05:00
|
|
|
<!-- TODO: change the positiveIntegers to xs:duration? or union? -->
|
|
|
|
<!-- Might be pointless since the smallest increment is 1 day in
|
|
|
|
shadow(5). -->
|
|
|
|
<xs:attribute name="minAge" type="xs:positiveInteger" use="optional"/>
|
|
|
|
<xs:attribute name="maxAge" type="xs:positiveInteger" use="optional"/>
|
2019-12-09 08:29:38 -05:00
|
|
|
<xs:attribute name="warnDays" type="xs:positiveInteger" use="optional"/>
|
|
|
|
<xs:attribute name="inactiveDays" type="xs:positiveInteger" use="optional"/>
|
2019-12-10 07:00:13 -05:00
|
|
|
<xs:attribute name="expireDate" type="t_std_epoch_or_iso" use="optional"/>
|
2019-12-08 03:05:00 -05:00
|
|
|
</xs:complexType>
|
|
|
|
|
2019-12-08 00:29:43 -05:00
|
|
|
</xs:schema>
|