Blame SOURCES/0001-create-user-add-nis-domain-option.patch

ee8dc1
From 1457b4a7623a8ae58fb8d6a652d1cc44904b8863 Mon Sep 17 00:00:00 2001
ee8dc1
From: Sumit Bose <sbose@redhat.com>
ee8dc1
Date: Mon, 18 Mar 2019 11:02:57 +0100
ee8dc1
Subject: [PATCH 1/2] create-user: add nis-domain option
ee8dc1
ee8dc1
Related to https://gitlab.freedesktop.org/realmd/adcli/issues/2
ee8dc1
---
ee8dc1
 doc/adcli.xml | 8 ++++++++
ee8dc1
 tools/entry.c | 6 ++++++
ee8dc1
 2 files changed, 14 insertions(+)
ee8dc1
ee8dc1
diff --git a/doc/adcli.xml b/doc/adcli.xml
ee8dc1
index 4722c3a..18620c0 100644
ee8dc1
--- a/doc/adcli.xml
ee8dc1
+++ b/doc/adcli.xml
ee8dc1
@@ -531,6 +531,14 @@ $ adcli create-user Fry --domain=domain.example.com \
ee8dc1
 			the new created user account, which should be the user's
ee8dc1
 			numeric primary user id.</para></listitem>
ee8dc1
 		</varlistentry>
ee8dc1
+		<varlistentry>
ee8dc1
+			<term><option>--nis-domain=<parameter>nis_domain</parameter></option></term>
ee8dc1
+			<listitem><para>Set the msSFU30NisDomain attribute of
ee8dc1
+			the new created user account, which should be the user's
ee8dc1
+			NIS domain is the NIS/YP service of Active Directory's Services for Unix (SFU)
ee8dc1
+			are used. This is needed to let the 'UNIX attributes' tab of older Active
ee8dc1
+			Directoy versions show the set UNIX specific attributes.</para></listitem>
ee8dc1
+		</varlistentry>
ee8dc1
 	</variablelist>
ee8dc1
 
ee8dc1
 </refsect1>
ee8dc1
diff --git a/tools/entry.c b/tools/entry.c
ee8dc1
index 7b6a200..69ce62c 100644
ee8dc1
--- a/tools/entry.c
ee8dc1
+++ b/tools/entry.c
ee8dc1
@@ -52,6 +52,7 @@ typedef enum {
ee8dc1
 	opt_unix_uid,
ee8dc1
 	opt_unix_gid,
ee8dc1
 	opt_unix_shell,
ee8dc1
+	opt_nis_domain,
ee8dc1
 } Option;
ee8dc1
 
ee8dc1
 static adcli_tool_desc common_usages[] = {
ee8dc1
@@ -62,6 +63,7 @@ static adcli_tool_desc common_usages[] = {
ee8dc1
 	{ opt_unix_uid, "unix uid number" },
ee8dc1
 	{ opt_unix_gid, "unix gid number" },
ee8dc1
 	{ opt_unix_shell, "unix shell" },
ee8dc1
+	{ opt_nis_domain, "NIS domain" },
ee8dc1
 	{ opt_domain, "active directory domain name" },
ee8dc1
 	{ opt_domain_realm, "kerberos realm for the domain" },
ee8dc1
 	{ opt_domain_controller, "domain directory server to connect to" },
ee8dc1
@@ -159,6 +161,7 @@ adcli_tool_user_create (adcli_conn *conn,
ee8dc1
 		{ "unix-uid", required_argument, NULL, opt_unix_uid },
ee8dc1
 		{ "unix-gid", required_argument, NULL, opt_unix_gid },
ee8dc1
 		{ "unix-shell", required_argument, NULL, opt_unix_shell },
ee8dc1
+		{ "nis-domain", required_argument, NULL, opt_nis_domain },
ee8dc1
 		{ "domain-ou", required_argument, NULL, opt_domain_ou },
ee8dc1
 		{ "domain", required_argument, NULL, opt_domain },
ee8dc1
 		{ "domain-realm", required_argument, NULL, opt_domain_realm },
ee8dc1
@@ -200,6 +203,9 @@ adcli_tool_user_create (adcli_conn *conn,
ee8dc1
 		case opt_unix_shell:
ee8dc1
 			adcli_attrs_add (attrs, "loginShell", optarg, NULL);
ee8dc1
 			break;
ee8dc1
+		case opt_nis_domain:
ee8dc1
+			adcli_attrs_add (attrs, "msSFU30NisDomain", optarg, NULL);
ee8dc1
+			break;
ee8dc1
 		case opt_domain_ou:
ee8dc1
 			ou = optarg;
ee8dc1
 			break;
ee8dc1
-- 
ee8dc1
2.20.1
ee8dc1