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