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

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