| 1 |
<samba:parameter name="check password script" |
| 2 |
context="G" |
| 3 |
type="string" |
| 4 |
substitution="1" |
| 5 |
xmlns:samba="http://www.samba.org/samba/DTD/samba-doc"> |
| 6 |
<description> |
| 7 |
<para>The name of a program that can be used to check password |
| 8 |
complexity. The password is sent to the program's standard input.</para> |
| 9 |
|
| 10 |
<para>The program must return 0 on a good password, or any other value |
| 11 |
if the password is bad. |
| 12 |
In case the password is considered weak (the program does not return 0) the |
| 13 |
user will be notified and the password change will fail.</para> |
| 14 |
|
| 15 |
<para>In Samba AD, this script will be run <emphasis>AS ROOT</emphasis> by |
| 16 |
<citerefentry><refentrytitle>samba</refentrytitle> <manvolnum>8</manvolnum> |
| 17 |
</citerefentry> without any substitutions.</para> |
| 18 |
|
| 19 |
<para>Note that starting with Samba 4.11 the following environment variables are exported to the script:</para> |
| 20 |
|
| 21 |
<itemizedlist> |
| 22 |
<listitem><para> |
| 23 |
SAMBA_CPS_ACCOUNT_NAME is always present and contains the sAMAccountName of user. |
| 24 |
It is the same as the '%u' substitutions in the non AD DC case. |
| 25 |
</para></listitem> |
| 26 |
|
| 27 |
<listitem><para> |
| 28 |
SAMBA_CPS_USER_PRINCIPAL_NAME is optional in the AD DC case if the userPrincipalName is present. |
| 29 |
</para></listitem> |
| 30 |
|
| 31 |
<listitem><para> |
| 32 |
SAMBA_CPS_FULL_NAME is optional if the displayName is present. |
| 33 |
</para></listitem> |
| 34 |
</itemizedlist> |
| 35 |
|
| 36 |
<para>Even on a non AD DC SAMBA_CPS_ACCOUNT_NAME is the preferred way to access the |
| 37 |
account name, as it contains the raw value provided by the client. If that's not |
| 38 |
possible you should use single quotes (directly) around %u, e.g. /path/to/somescript '%u', |
| 39 |
see CVE-2026-4408 for more details. |
| 40 |
</para> |
| 41 |
|
| 42 |
<para>Note: In the example directory is a sample program called <command moreinfo="none">crackcheck</command> |
| 43 |
that uses cracklib to check the password quality.</para> |
| 44 |
|
| 45 |
</description> |
| 46 |
|
| 47 |
<value type="default"><comment>Disabled</comment></value> |
| 48 |
<value type="example">/usr/local/sbin/crackcheck</value> |
| 49 |
</samba:parameter> |