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