5144c6
From 77fae8c48bbe0f4499f4d8ed91b268568c64cd7c Mon Sep 17 00:00:00 2001
5144c6
From: Christian Heimes <cheimes@redhat.com>
5144c6
Date: Thu, 11 Jun 2020 11:17:25 +0200
5144c6
Subject: [PATCH] Move ipa-epn systemd files and run RPM hooks
5144c6
5144c6
The init/systemd directory is for server only and not part of
5144c6
CLIENT_ONLY builds.
5144c6
5144c6
It's necesary to run pre/post installation hooks to make systemd aware
5144c6
of new files.
5144c6
5144c6
Fixes: https://pagure.io/freeipa/issue/8367
5144c6
Signed-off-by: Christian Heimes <cheimes@redhat.com>
5144c6
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
5144c6
Reviewed-By: Francois Cami <fcami@redhat.com>
5144c6
---
5144c6
 .gitignore                                    |  4 +--
5144c6
 client/Makefile.am                            |  1 +
5144c6
 client/share/Makefile.am                      |  5 ++++
5144c6
 {install => client}/share/expire_msg.template |  0
5144c6
 client/systemd/Makefile.am                    | 27 +++++++++++++++++++
5144c6
 {init => client}/systemd/ipa-epn.service.in   |  0
5144c6
 {init => client}/systemd/ipa-epn.timer.in     |  0
5144c6
 configure.ac                                  | 24 +++++++++++++++--
5144c6
 freeipa.spec.in                               | 15 +++++++++++
5144c6
 init/systemd/Makefile.am                      |  8 +++---
5144c6
 install/share/Makefile.am                     |  5 ----
5144c6
 server.m4                                     | 19 -------------
5144c6
 12 files changed, 76 insertions(+), 32 deletions(-)
5144c6
 rename {install => client}/share/expire_msg.template (100%)
5144c6
 create mode 100644 client/systemd/Makefile.am
5144c6
 rename {init => client}/systemd/ipa-epn.service.in (100%)
5144c6
 rename {init => client}/systemd/ipa-epn.timer.in (100%)
5144c6
5144c6
#diff --git a/.gitignore b/.gitignore
5144c6
#index 6584c3b4f..4cedb1ff2 100644
5144c6
#--- a/.gitignore
5144c6
#+++ b/.gitignore
5144c6
#@@ -94,8 +94,6 @@ freeipa2-dev-doc
5144c6
# /init/ipa_memcached
5144c6
# /init/systemd/ipa-custodia.service
5144c6
# /init/systemd/ipa.service
5144c6
#-/init/systemd/ipa-epn.service
5144c6
#-/init/systemd/ipa-epn.timer
5144c6
# /init/tmpfilesd/ipa.conf
5144c6
# 
5144c6
# !/install/ui/doc/Makefile.in
5144c6
#@@ -116,6 +114,8 @@ freeipa2-dev-doc
5144c6
# /client/ipa-getkeytab
5144c6
# /client/ipa-join
5144c6
# /client/ipa-rmkeytab
5144c6
#+/client/systemd/ipa-epn.service
5144c6
#+/client/systemd/ipa-epn.timer
5144c6
# 
5144c6
# /ipaplatform/override.py
5144c6
# /ipapython/version.py
5144c6
diff --git a/client/Makefile.am b/client/Makefile.am
5144c6
index 858a9369e..87da87fcd 100644
5144c6
--- a/client/Makefile.am
5144c6
+++ b/client/Makefile.am
5144c6
@@ -95,6 +95,7 @@ SUBDIRS =			\
5144c6
 	share		        \
5144c6
 	man			\
5144c6
 	sysconfig	        \
5144c6
+	systemd			\
5144c6
 	$(NULL)
5144c6
 #       init                    
5144c6
 
5144c6
diff --git a/client/share/Makefile.am b/client/share/Makefile.am
5144c6
index 6d4a62d5e..1402a3a9d 100644
5144c6
--- a/client/share/Makefile.am
5144c6
+++ b/client/share/Makefile.am
5144c6
@@ -4,3 +4,8 @@ appdir = $(IPA_DATA_DIR)/client
5144c6
 dist_app_DATA =				\
5144c6
 	freeipa.template		\
5144c6
 	$(NULL)
5144c6
+
5144c6
+epnconfdir = $(IPA_SYSCONF_DIR)/epn
5144c6
+dist_epnconf_DATA =			\
5144c6
+	expire_msg.template	\
5144c6
+	$(NULL)
5144c6
diff --git a/install/share/expire_msg.template b/client/share/expire_msg.template
5144c6
similarity index 100%
5144c6
rename from install/share/expire_msg.template
5144c6
rename to client/share/expire_msg.template
5144c6
diff --git a/client/systemd/Makefile.am b/client/systemd/Makefile.am
5144c6
new file mode 100644
5144c6
index 000000000..1f591be83
5144c6
--- /dev/null
5144c6
+++ b/client/systemd/Makefile.am
5144c6
@@ -0,0 +1,27 @@
5144c6
+# This file will be processed with automake-1.7 to create Makefile.in
5144c6
+#
5144c6
+AUTOMAKE_OPTIONS = 1.7
5144c6
+
5144c6
+NULL =
5144c6
+
5144c6
+dist_noinst_DATA = 			\
5144c6
+	ipa-epn.service.in		\
5144c6
+	ipa-epn.timer.in		\
5144c6
+	$(NULL)
5144c6
+
5144c6
+systemdsystemunit_DATA = 	\
5144c6
+	ipa-epn.service			\
5144c6
+	ipa-epn.timer		\
5144c6
+	$(NULL)
5144c6
+
5144c6
+CLEANFILES = $(systemdsystemunit_DATA)
5144c6
+
5144c6
+%: %.in Makefile
5144c6
+	sed \
5144c6
+		-e 's|@bindir[@]|$(bindir)|g' \
5144c6
+		-e 's|@IPA_SYSCONF_DIR[@]|$(IPA_SYSCONF_DIR)|g' \
5144c6
+		-e 's|@localstatedir[@]|$(localstatedir)|g' \
5144c6
+		-e 's|@sbindir[@]|$(sbindir)|g' \
5144c6
+		-e 's|@libexecdir[@]|$(libexecdir)|g' \
5144c6
+		-e 's|@sysconfenvdir[@]|$(sysconfenvdir)|g' \
5144c6
+		'$(srcdir)/$@.in' >$@
5144c6
diff --git a/init/systemd/ipa-epn.service.in b/client/systemd/ipa-epn.service.in
5144c6
similarity index 100%
5144c6
rename from init/systemd/ipa-epn.service.in
5144c6
rename to client/systemd/ipa-epn.service.in
5144c6
diff --git a/init/systemd/ipa-epn.timer.in b/client/systemd/ipa-epn.timer.in
5144c6
similarity index 100%
5144c6
rename from init/systemd/ipa-epn.timer.in
5144c6
rename to client/systemd/ipa-epn.timer.in
5144c6
diff --git a/configure.ac b/configure.ac
5144c6
index 5ec529088..586b2532a 100644
5144c6
--- a/configure.ac
5144c6
+++ b/configure.ac
5144c6
@@ -220,6 +220,25 @@ AC_ARG_WITH([runstatedir],
5144c6
             [runstatedir="/run"])
5144c6
 AC_SUBST([runstatedir])
5144c6
 
5144c6
+dnl ---------------------------------------------------------------------------
5144c6
+dnl - Check for systemd directories
5144c6
+dnl ---------------------------------------------------------------------------
5144c6
+
5144c6
+PKG_CHECK_EXISTS([systemd], [], [AC_MSG_ERROR([systemd not found])])
5144c6
+AC_ARG_WITH([systemdsystemunitdir],
5144c6
+            AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
5144c6
+               [Directory for systemd service files]),
5144c6
+            [systemdsystemunitdir=$with_systemdsystemunitdir],
5144c6
+        [systemdsystemunitdir=$($PKG_CONFIG --define-variable=prefix='${prefix}' --variable=systemdsystemunitdir systemd)])
5144c6
+AC_SUBST([systemdsystemunitdir])
5144c6
+
5144c6
+AC_ARG_WITH([systemdtmpfilesdir],
5144c6
+            AS_HELP_STRING([--with-systemdtmpfilesdir=DIR],
5144c6
+               [Directory for systemd-tmpfiles configuration files]),
5144c6
+            [systemdtmpfilesdir=$with_systemdtmpfilesdir],
5144c6
+        [systemdtmpfilesdir=$($PKG_CONFIG --define-variable=prefix='${prefix}' --variable=tmpfilesdir systemd)])
5144c6
+AC_SUBST([systemdtmpfilesdir])
5144c6
+
5144c6
 dnl ---------------------------------------------------------------------------
5144c6
 dnl - Server-only configuration
5144c6
 dnl ---------------------------------------------------------------------------
5144c6
@@ -544,6 +563,7 @@ AC_CONFIG_FILES([
5144c6
     client/share/Makefile
5144c6
     client/man/Makefile
5144c6
     client/sysconfig/Makefile
5144c6
+    client/systemd/Makefile
5144c6
     contrib/completion/Makefile
5144c6
     contrib/Makefile
5144c6
     daemons/dnssec/Makefile
5144c6
@@ -637,13 +657,13 @@ echo "
5144c6
         jslint:                   ${JSLINT}
5144c6
         LDAP libs:                ${LDAP_LIBS}
5144c6
         OpenSSL crypto libs:      ${CRYPTO_LIBS}
5144c6
-        KRB5 libs:                ${KRB5_LIBS}"
5144c6
+        KRB5 libs:                ${KRB5_LIBS}
5144c6
+        systemdsystemunitdir:     ${systemdsystemunitdir}"
5144c6
 
5144c6
 AM_COND_IF([ENABLE_SERVER], [
5144c6
     echo "\
5144c6
         KRAD libs:                ${KRAD_LIBS}
5144c6
         krb5rundir:               ${krb5rundir}
5144c6
-        systemdsystemunitdir:     ${systemdsystemunitdir}
5144c6
         systemdtmpfilesdir:       ${systemdtmpfilesdir}
5144c6
         build mode:               server & client"
5144c6
 ], [
5144c6
diff --git a/freeipa.spec.in b/freeipa.spec.in
5144c6
index cec57e64e..1d8f4e6aa 100755
5144c6
--- a/freeipa.spec.in
5144c6
+++ b/freeipa.spec.in
5144c6
@@ -586,6 +586,10 @@ on the machine enrolled into a FreeIPA environment
5144c6
 %package client-epn
5144c6
 Summary: Tools to configure Expiring Password Notification in IPA
5144c6
 Group: System Environment/Base
5144c6
+Requires: systemd-units
5144c6
+Requires(post): systemd-units
5144c6
+Requires(preun): systemd-units
5144c6
+Requires(postun): systemd-units
5144c6
 Requires: %{name}-client = %{version}-%{release}
5144c6
 
5144c6
 %description client-epn
5144c6
@@ -1003,6 +1007,17 @@ fi
5144c6
 # ONLY_CLIENT
5144c6
 %endif
5144c6
 
5144c6
+%preun client-epn
5144c6
+%systemd_preun ipa-epn.service
5144c6
+%systemd_preun ipa-epn.timer
5144c6
+
5144c6
+%postun client-epn
5144c6
+%systemd_postun ipa-epn.service
5144c6
+%systemd_postun ipa-epn.timer
5144c6
+
5144c6
+%post client-epn
5144c6
+%systemd_post ipa-epn.service
5144c6
+%systemd_post ipa-epn.timer
5144c6
 
5144c6
 %post client
5144c6
 if [ $1 -gt 1 ] ; then
5144c6
diff --git a/init/systemd/Makefile.am b/init/systemd/Makefile.am
5144c6
index 5053dbff6..175178787 100644
5144c6
--- a/init/systemd/Makefile.am
5144c6
+++ b/init/systemd/Makefile.am
5144c6
@@ -2,17 +2,17 @@
5144c6
 #
5144c6
 AUTOMAKE_OPTIONS = 1.7
5144c6
 
5144c6
+NULL =
5144c6
+
5144c6
 dist_noinst_DATA = 			\
5144c6
 	ipa-custodia.service.in		\
5144c6
 	ipa.service.in			\
5144c6
-	ipa-epn.service.in		\
5144c6
-	ipa-epn.timer.in
5144c6
+	$(NULL)
5144c6
 
5144c6
 systemdsystemunit_DATA = 	\
5144c6
 	ipa-custodia.service	\
5144c6
 	ipa.service				\
5144c6
-	ipa-epn.service			\
5144c6
-	ipa-epn.timer
5144c6
+	$(NULL)
5144c6
 
5144c6
 CLEANFILES = $(systemdsystemunit_DATA)
5144c6
 
5144c6
diff --git a/install/share/Makefile.am b/install/share/Makefile.am
5144c6
index 496e81288..e95796dfb 100644
5144c6
--- a/install/share/Makefile.am
5144c6
+++ b/install/share/Makefile.am
5144c6
@@ -106,8 +106,3 @@ dist_app_DATA =				\
5144c6
 kdcproxyconfdir = $(IPA_SYSCONF_DIR)/kdcproxy
5144c6
 dist_kdcproxyconf_DATA =			\
5144c6
 	kdcproxy.conf
5144c6
-
5144c6
-epnconfdir = $(IPA_SYSCONF_DIR)/epn
5144c6
-dist_epnconf_DATA =			\
5144c6
-	expire_msg.template	\
5144c6
-	$(NULL)
5144c6
diff --git a/server.m4 b/server.m4
5144c6
index d35823e80..842d599d2 100644
5144c6
--- a/server.m4
5144c6
+++ b/server.m4
5144c6
@@ -153,22 +153,3 @@ dnl Check for libverto
5144c6
 dnl ---------------------------------------------------------------------------
5144c6
 
5144c6
 PKG_CHECK_MODULES([LIBVERTO], [libverto])
5144c6
-
5144c6
-dnl ---------------------------------------------------------------------------
5144c6
-dnl - Check for systemd directories
5144c6
-dnl ---------------------------------------------------------------------------
5144c6
-
5144c6
-PKG_CHECK_EXISTS([systemd], [], [AC_MSG_ERROR([systemd not found])])
5144c6
-AC_ARG_WITH([systemdsystemunitdir],
5144c6
-            AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
5144c6
-               [Directory for systemd service files]),
5144c6
-            [systemdsystemunitdir=$with_systemdsystemunitdir],
5144c6
-        [systemdsystemunitdir=$($PKG_CONFIG --define-variable=prefix='${prefix}' --variable=systemdsystemunitdir systemd)])
5144c6
-AC_SUBST([systemdsystemunitdir])
5144c6
-
5144c6
-AC_ARG_WITH([systemdtmpfilesdir],
5144c6
-            AS_HELP_STRING([--with-systemdtmpfilesdir=DIR],
5144c6
-               [Directory for systemd-tmpfiles configuration files]),
5144c6
-            [systemdtmpfilesdir=$with_systemdtmpfilesdir],
5144c6
-        [systemdtmpfilesdir=$($PKG_CONFIG --define-variable=prefix='${prefix}' --variable=tmpfilesdir systemd)])
5144c6
-AC_SUBST([systemdtmpfilesdir])
5144c6
-- 
5144c6
2.26.2
5144c6
5144c6
From 23e2935e5c5cb402dd4f6f44eaa4b013e6a8188a Mon Sep 17 00:00:00 2001
5144c6
From: =?UTF-8?q?Fran=C3=A7ois=20Cami?= <fcami@redhat.com>
5144c6
Date: Mon, 22 Jun 2020 16:39:02 +0200
5144c6
Subject: [PATCH] EPN: ship the configuration file.
5144c6
MIME-Version: 1.0
5144c6
Content-Type: text/plain; charset=UTF-8
5144c6
Content-Transfer-Encoding: 8bit
5144c6
5144c6
Ship and install /etc/ipa/epn.conf.
5144c6
Minor fixes to the associated man page.
5144c6
5144c6
Fixes: https://pagure.io/freeipa/issue/8374
5144c6
Signed-off-by: François Cami <fcami@redhat.com>
5144c6
Reviewed-By: Alexander Bokovoy <abbra@users.noreply.github.com>
5144c6
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
5144c6
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
5144c6
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
5144c6
---
5144c6
 client/man/epn.conf.5    |  5 ++--
5144c6
 client/share/Makefile.am |  7 +++++-
5144c6
 client/share/epn.conf    | 54 ++++++++++++++++++++++++++++++++++++++++
5144c6
 freeipa.spec.in          |  4 ++-
5144c6
 4 files changed, 65 insertions(+), 5 deletions(-)
5144c6
 create mode 100644 client/share/epn.conf
5144c6
5144c6
diff --git a/client/man/epn.conf.5 b/client/man/epn.conf.5
5144c6
index 38e99e25d..14f5dbb75 100644
5144c6
--- a/client/man/epn.conf.5
5144c6
+++ b/client/man/epn.conf.5
5144c6
@@ -71,11 +71,10 @@ Specifies the From e-mail address value in the e-mails sent. The default is
5144c6
 root@localhost. Bounces will be sent here.
5144c6
 .TP
5144c6
 .B smtp_delay <milliseconds>
5144c6
-Time to wait, in milliseconds, between each e-mail sent to try to avoid overloading the mail queue.
5144c6
+Time to wait, in milliseconds, between each e-mail sent to try to avoid overloading the mail queue. The default is 0.
5144c6
 .TP
5144c6
 .B mail_from <address>
5144c6
-Specifies the From: e-mal address value in the e-mails sent. The default is
5144c6
-noreply@ipadefaultemaildomain. This value can be found by running
5144c6
+Specifies the From: e-mail address value in the e-mails sent. The default is noreply@ipadefaultemaildomain. This value can be found by running
5144c6
 .I ipa config-show
5144c6
 .TP
5144c6
 .B notify_ttls <list of days>
5144c6
diff --git a/client/share/Makefile.am b/client/share/Makefile.am
5144c6
index 1402a3a9d..472242e62 100644
5144c6
--- a/client/share/Makefile.am
5144c6
+++ b/client/share/Makefile.am
5144c6
@@ -5,7 +5,12 @@ dist_app_DATA =				\
5144c6
 	freeipa.template		\
5144c6
 	$(NULL)
5144c6
 
5144c6
-epnconfdir = $(IPA_SYSCONF_DIR)/epn
5144c6
+epnconfdir = $(IPA_SYSCONF_DIR)
5144c6
 dist_epnconf_DATA =			\
5144c6
+	epn.conf			\
5144c6
+	$(NULL)
5144c6
+
5144c6
+epntemplatedir = $(IPA_SYSCONF_DIR)/epn
5144c6
+dist_epntemplate_DATA =			\
5144c6
 	expire_msg.template	\
5144c6
 	$(NULL)
5144c6
diff --git a/client/share/epn.conf b/client/share/epn.conf
5144c6
new file mode 100644
5144c6
index 000000000..0e590dfc3
5144c6
--- /dev/null
5144c6
+++ b/client/share/epn.conf
5144c6
@@ -0,0 +1,54 @@
5144c6
+# Global IPA-EPN [0] configuration file.
5144c6
+# For a complete explanation of each parameter, see the epn.conf(5)
5144c6
+# manual page.
5144c6
+# For best results, change no more than a single parameter at a time,
5144c6
+# and test if ipa-epn(1) still works as intended, using --dry-run when
5144c6
+# it makes sense.
5144c6
+#
5144c6
+# [0] https://github.com/freeipa/freeipa/blob/master/doc/designs/expiring-password-notification.md
5144c6
+
5144c6
+[global]
5144c6
+
5144c6
+# Specifies the SMTP server to use. 
5144c6
+smtp_server = localhost
5144c6
+
5144c6
+# Specifies the SMTP port.
5144c6
+smtp_port = 25
5144c6
+
5144c6
+# Specifies the id of the user to authenticate with the SMTP server.
5144c6
+# Default None (empty value).
5144c6
+# smtp_user =
5144c6
+
5144c6
+# Specifies the password for the authorized user.
5144c6
+# Default None (empty value).
5144c6
+# smtp_password =
5144c6
+
5144c6
+# pecifies the number of seconds to wait for SMTP to respond.
5144c6
+smtp_timeout = 60
5144c6
+
5144c6
+# Specifies the type of secure connection to make. Options are: none,
5144c6
+# starttls and ssl.
5144c6
+smtp_security = none
5144c6
+
5144c6
+# Specifies the From e-mail address value in the e-mails sent. Bounces will
5144c6
+# be sent here.
5144c6
+smtp_admin = root@localhost
5144c6
+
5144c6
+# Time to wait, in milliseconds, between each e-mail sent to try to avoid
5144c6
+# overloading the mail queue.
5144c6
+smtp_delay = 0
5144c6
+
5144c6
+# Specifies the From: e-mail address value in the e-mails sent.
5144c6
+# The default when unset is noreply@ipadefaultemaildomain.
5144c6
+# This value can be found by running ipa config-show.
5144c6
+# mail_from =
5144c6
+
5144c6
+# The list of days before a password expiration when ipa-epn should notify
5144c6
+# a user that their password will soon require a reset.
5144c6
+notify_ttls = 28, 14, 7, 3, 1
5144c6
+
5144c6
+# Set the character set of the message.
5144c6
+msg_charset = utf8
5144c6
+
5144c6
+# Set the message's MIME sub-content type.
5144c6
+msg_subtype = plain
5144c6
diff --git a/freeipa.spec.in b/freeipa.spec.in
5144c6
index 5bce6f118..8cca99697 100755
5144c6
--- a/freeipa.spec.in
5144c6
+++ b/freeipa.spec.in
5144c6
@@ -1387,13 +1387,15 @@ fi
5144c6
 
5144c6
 %files client-epn
5144c6
 %doc README.md Contributors.txt
5144c6
+%dir %{_sysconfdir}/ipa/epn
5144c6
 %license COPYING
5144c6
 %{_sbindir}/ipa-epn
5144c6
 %{_mandir}/man1/ipa-epn.1*
5144c6
 %{_mandir}/man5/epn.conf.5*
5144c6
 %attr(644,root,root) %{_unitdir}/ipa-epn.service
5144c6
 %attr(644,root,root) %{_unitdir}/ipa-epn.timer
5144c6
-%attr(644,root,root) %{_sysconfdir}/ipa/epn/expire_msg.template
5144c6
+%attr(600,root,root) %config(noreplace) %{_sysconfdir}/ipa/epn.conf
5144c6
+%attr(644,root,root) %config(noreplace) %{_sysconfdir}/ipa/epn/expire_msg.template
5144c6
 
5144c6
 %files -n python3-ipaclient
5144c6
 %doc README.md Contributors.txt
5144c6
-- 
5144c6
2.26.2
5144c6
5144c6
From 3b43950d35f78b28d4edde4fda475b5aa84f4587 Mon Sep 17 00:00:00 2001
5144c6
From: =?UTF-8?q?Fran=C3=A7ois=20Cami?= <fcami@redhat.com>
5144c6
Date: Tue, 23 Jun 2020 09:39:02 +0200
5144c6
Subject: [PATCH] man pages: fix epn.conf.5 and ipa-epn.1 formatting
5144c6
MIME-Version: 1.0
5144c6
Content-Type: text/plain; charset=UTF-8
5144c6
Content-Transfer-Encoding: 8bit
5144c6
5144c6
Fix formatting issues found with mandoc.
5144c6
5144c6
Signed-off-by: François Cami <fcami@redhat.com>
5144c6
Reviewed-By: Alexander Bokovoy <abbra@users.noreply.github.com>
5144c6
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
5144c6
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
5144c6
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
5144c6
---
5144c6
 client/man/epn.conf.5 | 2 +-
5144c6
 client/man/ipa-epn.1  | 8 ++++----
5144c6
 2 files changed, 5 insertions(+), 5 deletions(-)
5144c6
5144c6
diff --git a/client/man/epn.conf.5 b/client/man/epn.conf.5
5144c6
index 14f5dbb75..df1f0156c 100644
5144c6
--- a/client/man/epn.conf.5
5144c6
+++ b/client/man/epn.conf.5
5144c6
@@ -16,7 +16,7 @@
5144c6
 .\"
5144c6
 .\" Author: Rob Crittenden <rcritten@@redhat.com>
5144c6
 .\"
5144c6
-.TH "epn.conf" "5" "Apr 28 2020" "FreeIPA" "FreeIPA Manual Pages"
5144c6
+.TH "EPN.CONF" "5" "April 28, 2020" "FreeIPA" "FreeIPA Manual Pages"
5144c6
 .SH "NAME"
5144c6
 epn.conf \- Expiring Password Notification configuration file
5144c6
 .SH "SYNOPSIS"
5144c6
diff --git a/client/man/ipa-epn.1 b/client/man/ipa-epn.1
5144c6
index 9999ea8ca..124fd4536 100644
5144c6
--- a/client/man/ipa-epn.1
5144c6
+++ b/client/man/ipa-epn.1
5144c6
@@ -15,14 +15,14 @@
5144c6
 .\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
5144c6
 .\"
5144c6
 .\"
5144c6
-.TH "ipa-epn" "1" "Apr 24 2020" "FreeIPA" "FreeIPA Manual Pages"
5144c6
+.TH "IPA-EPN" "1" "April 24, 2020" "FreeIPA" "FreeIPA Manual Pages"
5144c6
 .SH "NAME"
5144c6
 ipa\-epn \- Send expiring password nofications
5144c6
 .SH "SYNOPSIS"
5144c6
-ipa\-epn \[options\]
5144c6
+ipa\-epn \fR[options\fR]
5144c6
 
5144c6
 .SH "DESCRIPTION"
5144c6
-ipa\-epn provides a method to warn users via email that their IPA account password is about to expire. 
5144c6
+ipa\-epn provides a method to warn users via email that their IPA account password is about to expire.
5144c6
 
5144c6
 It can be used in dry\-run mode which is recommmended during setup. The output is always JSON in this case.
5144c6
 
5144c6
@@ -38,7 +38,7 @@ The \-\-to\-nbdays CLI option can be used to determine the number of notificatio
5144c6
 
5144c6
 If \fB\-\-from\-nbdays\fR is not specified, ipa\-epn will look within a 24\-hour long time range in <number of days> days.
5144c6
 
5144c6
-if \fB\-\-from\-nbdays\fR is specified, the date range starts at \fB\-\-from\-nbdays\fR days in the future and ends at \fB\-\-to\-nbdays\fR in the future. 
5144c6
+if \fB\-\-from\-nbdays\fR is specified, the date range starts at \fB\-\-from\-nbdays\fR days in the future and ends at \fB\-\-to\-nbdays\fR in the future.
5144c6
 
5144c6
 Together, these two CLI options can be used to determine how many emails would be sent in a specific time in the future.
5144c6
 
5144c6
-- 
5144c6
2.26.2
5144c6
5144c6
From 2648c218467792e907435eaa5267a0f3457f634f Mon Sep 17 00:00:00 2001
5144c6
From: =?UTF-8?q?Fran=C3=A7ois=20Cami?= <fcami@redhat.com>
5144c6
Date: Tue, 23 Jun 2020 13:50:02 +0200
5144c6
Subject: [PATCH] ipatests: check that EPN's configuration file is installed.
5144c6
MIME-Version: 1.0
5144c6
Content-Type: text/plain; charset=UTF-8
5144c6
Content-Transfer-Encoding: 8bit
5144c6
5144c6
Fixes: https://pagure.io/freeipa/issue/8374
5144c6
Signed-off-by: François Cami <fcami@redhat.com>
5144c6
Reviewed-By: Alexander Bokovoy <abbra@users.noreply.github.com>
5144c6
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
5144c6
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
5144c6
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
5144c6
---
5144c6
 ipatests/test_integration/test_epn.py | 14 ++++++++++++++
5144c6
 1 file changed, 14 insertions(+)
5144c6
5144c6
diff --git a/ipatests/test_integration/test_epn.py b/ipatests/test_integration/test_epn.py
5144c6
index 7f56d4bc0..409d588d5 100644
5144c6
--- a/ipatests/test_integration/test_epn.py
5144c6
+++ b/ipatests/test_integration/test_epn.py
5144c6
@@ -209,6 +209,20 @@ class TestEPN(IntegrationTest):
5144c6
         cls.master.run_command(r'rm -f /etc/pki/tls/private/postfix.key')
5144c6
         cls.master.run_command(r'rm -f /etc/pki/tls/certs/postfix.pem')
5144c6
 
5144c6
+    @pytest.mark.xfail(reason='pr-ci issue 378', strict=True)
5144c6
+    def test_EPN_config_file(self):
5144c6
+        """Check that the EPN configuration file is installed.
5144c6
+           https://pagure.io/freeipa/issue/8374
5144c6
+        """
5144c6
+        epn_conf = "/etc/ipa/epn.conf"
5144c6
+        epn_template = "/etc/ipa/epn/expire_msg.template"
5144c6
+        cmd1 = self.master.run_command(["rpm", "-qc", "freeipa-client-epn"])
5144c6
+        assert epn_conf in cmd1.stdout_text
5144c6
+        assert epn_template in cmd1.stdout_text
5144c6
+        cmd2 = self.master.run_command(["sha256sum", epn_conf])
5144c6
+        ck = "4c207b5c9c760c36db0d3b2b93da50ea49edcc4002d6d1e7383601f0ec30b957"
5144c6
+        assert cmd2.stdout_text.find(ck) == 0
5144c6
+
5144c6
     def test_EPN_smoketest_1(self):
5144c6
         """No users except admin. Check --dry-run output.
5144c6
            With the default configuration, the result should be an empty list.
5144c6
-- 
5144c6
2.26.2
5144c6
5144c6
From 06accac8906f66ebbb31849d6528b39ae006b124 Mon Sep 17 00:00:00 2001
5144c6
From: =?UTF-8?q?Fran=C3=A7ois=20Cami?= <fcami@redhat.com>
5144c6
Date: Wed, 24 Jun 2020 23:24:36 +0200
5144c6
Subject: [PATCH] ipatests: ipa_epn: uninstall/reinstall ipa-client-epn
5144c6
MIME-Version: 1.0
5144c6
Content-Type: text/plain; charset=UTF-8
5144c6
Content-Transfer-Encoding: 8bit
5144c6
5144c6
Due to https://github.com/freeipa/freeipa-pr-ci/issues/378
5144c6
the installed version of freeipa-client-epn is not the built
5144c6
one. Temporarily force uninstall/reinstall of this package
5144c6
before running the test.
5144c6
5144c6
Fixes: https://pagure.io/freeipa/issue/8374
5144c6
Signed-off-by: François Cami <fcami@redhat.com>
5144c6
Reviewed-By: Alexander Bokovoy <abbra@users.noreply.github.com>
5144c6
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
5144c6
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
5144c6
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
5144c6
---
5144c6
 ipatests/test_integration/test_epn.py | 20 +++++++++++++++++++-
5144c6
 1 file changed, 19 insertions(+), 1 deletion(-)
5144c6
5144c6
diff --git a/ipatests/test_integration/test_epn.py b/ipatests/test_integration/test_epn.py
5144c6
index 409d588d5..9a9fb17b9 100644
5144c6
--- a/ipatests/test_integration/test_epn.py
5144c6
+++ b/ipatests/test_integration/test_epn.py
5144c6
@@ -209,11 +209,29 @@ class TestEPN(IntegrationTest):
5144c6
         cls.master.run_command(r'rm -f /etc/pki/tls/private/postfix.key')
5144c6
         cls.master.run_command(r'rm -f /etc/pki/tls/certs/postfix.pem')
5144c6
 
5144c6
-    @pytest.mark.xfail(reason='pr-ci issue 378', strict=True)
5144c6
+    @pytest.mark.skip_if_platform(
5144c6
+        "debian", reason="Cannot check installed packages using RPM"
5144c6
+    )
5144c6
     def test_EPN_config_file(self):
5144c6
         """Check that the EPN configuration file is installed.
5144c6
            https://pagure.io/freeipa/issue/8374
5144c6
         """
5144c6
+        # workaround for https://github.com/freeipa/freeipa-pr-ci/issues/378
5144c6
+        rpm_q_cmds = [
5144c6
+            ["rpm", "-qi", "freeipa-client"],
5144c6
+            ["rpm", "-qi", "freeipa-client-epn"],
5144c6
+            ["rpm", "-qc", "freeipa-client-epn"],
5144c6
+            ["rpm", "-V", "freeipa-client-epn"],
5144c6
+            ["rpm", "-qvc", "freeipa-client-epn"],
5144c6
+            ["ls", "-l", "/etc/ipa", "/etc/ipa/epn"],
5144c6
+        ]
5144c6
+        for cmd in rpm_q_cmds:
5144c6
+            self.master.run_command(cmd, raiseonerr=False)
5144c6
+        tasks.uninstall_packages(self.master, ["*ipa-client-epn"])
5144c6
+        tasks.install_packages(self.master, ["*ipa-client-epn"])
5144c6
+        for cmd in rpm_q_cmds:
5144c6
+            self.master.run_command(cmd, raiseonerr=False)
5144c6
+        # end workaround
5144c6
         epn_conf = "/etc/ipa/epn.conf"
5144c6
         epn_template = "/etc/ipa/epn/expire_msg.template"
5144c6
         cmd1 = self.master.run_command(["rpm", "-qc", "freeipa-client-epn"])
5144c6
-- 
5144c6
2.26.2
5144c6