-diff -ur courier-authlib-0.56.orig/checkpasswordmd5.c courier-authlib-0.56/checkpasswordmd5.c
---- courier-authlib-0.56.orig/checkpasswordmd5.c 2004-10-21 02:10:49.000000000 +0200
-+++ courier-authlib-0.56/checkpasswordmd5.c 2005-08-09 12:27:03.000000000 +0200
-@@ -25,7 +25,11 @@
+--- courier-authlib-0.71.4/checkpasswordmd5.c.orig 2022-05-21 21:47:03.355687139 +0200
++++ courier-authlib-0.71.4/checkpasswordmd5.c 2022-05-21 21:52:29.367254317 +0200
+@@ -24,7 +24,11 @@ int authcheckpasswordmd5(const char *pas
if (strncasecmp(encrypted_password, "{MD5}", 5) == 0)
{
- return (strcmp(encrypted_password+5, md5_hash_courier(password)));
-+ int a = strcmp(encrypted_password+5, md5_hash_courier(password));
-+ if (a != 0)
-+ return (strcasecmp(encrypted_password+5, md5_hash_hex(password)));
-+ else
-+ return(a);
++ int a = strcmp(encrypted_password+5, md5_hash_courier(password));
++ if (a != 0)
++ return (strcasecmp(encrypted_password+5, md5_hash_raw(password)));
++ else
++ return(a);
}
- return (-1);
- }
---- courier-authlib-0.68.0.orig/libs/md5/md5.h 2002-12-12 05:23:58.000000000 +0100
-+++ courier-authlib-0.68.0/md5/libs/md5.h 2005-08-09 12:26:27.000000000 +0200
-@@ -56,6 +56,7 @@
-
- const char *md5_hash_courier(const char *);
- const char *md5_hash_raw(const char *);
-+const char *md5_hash_hex(const char *);
-
- #ifdef __cplusplus
- } ;
---- courier-authlib-0.68.0.orig/libs/md5/md5_hash.c 2002-12-12 05:23:58.000000000 +0100
-+++ courier-authlib-0.68.0/libs/md5/md5_hash.c 2005-08-09 12:24:05.000000000 +0200
-@@ -11,6 +11,8 @@
- static const char base64tab[]=
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-
-+static const char hextab[] = "0123456789abcdef";
-+
- const char *md5_hash_courier(const char *passw)
- {
- MD5_DIGEST md5buf;
-@@ -44,3 +46,19 @@
- hash_buffer[j]=0;
- return (hash_buffer);
- }
-+
-+const char *md5_hash_hex(const char *passw) {
-+ MD5_DIGEST md5buf;
-+ static char hash_buffer[2*sizeof(md5buf)+1];
-+ int i, j = 0;
-+
-+ md5_digest(passw, strlen(passw), md5buf);
-+
-+ for (i=0; i<sizeof(md5buf); i++) {
-+ hash_buffer[j++] = hextab[(md5buf[i] & 0xF0) >> 4];
-+ hash_buffer[j++] = hextab[md5buf[i] & 0x0F];
-+ }
-+
-+ hash_buffer[j]=0;
-+ return (hash_buffer);
-+}
+ if (strncasecmp(encrypted_password, "{MD5RAW}", 8) == 0)
+ {
Summary: Courier authentication library
Summary(pl.UTF-8): Biblioteka uwierzytelniania Couriera
Name: courier-authlib
-Version: 0.69.0
+Version: 0.71.4
Release: 1
License: GPL v3 with OpenSSL exception
Group: Networking/Daemons
Source0: http://downloads.sourceforge.net/courier/%{name}-%{version}.tar.bz2
-# Source0-md5: 581ed4b8a39d00b11f7fe1e534ce57ff
+# Source0-md5: 9c0a5657760065c4a49fcb7fc8b4b0e1
Source1: %{name}.init
Patch0: %{name}-md5sum-passwords.patch
Patch1: %{name}-authdaemonrc.patch
Patch2: %{name}-nostatic.patch
-Patch3: %{name}-no_la.patch
URL: http://www.courier-mta.org/authlib/
BuildRequires: autoconf >= 2.63
BuildRequires: automake
%define schemadir /usr/share/openldap/schema
+# refers to tcpremoteip variable from daemon
+%define skip_post_check_so libauthpam.so.*
+
%description
The Courier authentication library provides authentication services
for other Courier applications.
i zainstalowaniu ten pakiet można usunąć. Pliki z tego pakietu nie są
potrzebne w czasie działania programów.
+%package authcustom
+Summary: Custom module for the Courier authentication library
+Summary(pl.UTF-8): Moduł custom dla biblioteki uwierzytelniania Couriera
+Group: Networking/Daemons
+Requires(pre,postun): sed >= 4.0
+Requires: %{name} = %{version}-%{release}
+
+%description authcustom
+Custom module for the Courier authentication library.
+
+%description authcustom -l pl.UTF-8
+Moduł custom dla biblioteki uwierzytelniania Couriera.
+
%package authldap
Summary: LDAP support for the Courier authentication library
Summary(pl.UTF-8): Obsługa LDAP dla biblioteki uwierzytelniania Couriera
Couriera. Należy go zainstalować aby móc uwierzytelniać się z użyciem
MySQL.
+%package authpam
+Summary: PAM module for the Courier authentication library
+Summary(pl.UTF-8): Moduł PAM dla biblioteki uwierzytelniania Couriera
+Group: Networking/Daemons
+Requires(pre,postun): sed >= 4.0
+Requires: %{name} = %{version}-%{release}
+
+%description authpam
+PAM module for the Courier authentication library.
+
+%description authpam -l pl.UTF-8
+Moduł PAM dla biblioteki uwierzytelniania Couriera.
+
%package authpgsql
Summary: PostgreSQL support for the Courier authentication library
Summary(pl.UTF-8): Obsługa PostgreSQL dla biblioteki uwierzytelniania Couriera
%patch0 -p1
%patch1 -p1
%patch2 -p1
-%patch3 -p1
%build
%{__libtoolize}
%service courier-authlib stop
fi
+%post authcustom
+if [ "$1" = 1 ]; then
+ # add to authmodulelist list if package is first installed
+ %{__sed} -i -e '/^authmodulelist=/{/\bauthcustom\b/!s/"$/ authcustom"/}' /etc/authlib/authdaemonrc
+fi
+%service -q courier-authlib restart
+
+%postun authcustom
+if [ "$1" = 0 ]; then
+ # remove from authmodulelist if package is removed
+ %{__sed} -i -e '/^authmodulelist=/{s/ \?\bauthldap\b \?//}' /etc/authlib/authdaemonrc
+fi
+%service -q courier-authlib restart
+
%post authldap
if [ "$1" = 1 ]; then
# add to authmodulelist list if package is first installed
fi
%service -q courier-authlib restart
+%post authpam
+if [ "$1" = 1 ]; then
+ # add to authmodulelist list if package is first installed
+ %{__sed} -i -e '/^authmodulelist=/{/\bauthpam\b/!s/"$/ authpam"/}' /etc/authlib/authdaemonrc
+fi
+%service -q courier-authlib restart
+
+%postun authpam
+if [ "$1" = 0 ]; then
+ # remove from authmodulelist if package is removed
+ %{__sed} -i -e '/^authmodulelist=/{s/ \?\bauthpam\b \?//}' /etc/authlib/authdaemonrc
+fi
+%service -q courier-authlib restart
+
%post authpgsql
if [ "$1" = 1 ]; then
# add to authmodulelist list if package is first installed
%files libs
%defattr(644,root,root,755)
%dir %{_libdir}/courier-authlib
-%attr(755,root,root) %{_libdir}/courier-authlib/libcourierauth.so
-%attr(755,root,root) %{_libdir}/courier-authlib/libcourierauthcommon.so
-%attr(755,root,root) %{_libdir}/courier-authlib/libcourierauthsasl.so
-%attr(755,root,root) %{_libdir}/courier-authlib/libcourierauthsaslclient.so
+%attr(755,root,root) %{_libdir}/courier-authlib/libcourierauth.so.*
+%attr(755,root,root) %{_libdir}/courier-authlib/libcourierauthcommon.so.*
+%attr(755,root,root) %{_libdir}/courier-authlib/libcourierauthsasl.so.*
+%attr(755,root,root) %{_libdir}/courier-authlib/libcourierauthsaslclient.so.*
%files devel
%defattr(644,root,root,755)
%doc authlib.html auth_*.html
%attr(755,root,root) %{_bindir}/courierauthconfig
-%{_includedir}/courier_auth_config.h
+%attr(755,root,root) %{_libdir}/courier-authlib/libcourierauth.so
+%attr(755,root,root) %{_libdir}/courier-authlib/libcourierauthcommon.so
+%attr(755,root,root) %{_libdir}/courier-authlib/libcourierauthsasl.so
+%attr(755,root,root) %{_libdir}/courier-authlib/libcourierauthsaslclient.so
%{_includedir}/courierauth*.h
%{_mandir}/man3/auth_*.3*
%{_mandir}/man3/authlib.3*
+%files authcustom
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/courier-authlib/libauthcustom.so*
+
%if %{with ldap}
%files authldap
%defattr(644,root,root,755)
%doc authldap.schema README.ldap
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/authlib/authldaprc
-%attr(755,root,root) %{_libdir}/courier-authlib/libauthldap.so
+%attr(755,root,root) %{_libdir}/courier-authlib/libauthldap.so*
%endif
%files authmysql
%defattr(644,root,root,755)
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/authlib/authmysqlrc
-%attr(755,root,root) %{_libdir}/courier-authlib/libauthmysql.so
+%attr(755,root,root) %{_libdir}/courier-authlib/libauthmysql.so*
+
+%files authpam
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/courier-authlib/libauthpam.so*
%files authpgsql
%defattr(644,root,root,755)
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/authlib/authpgsqlrc
-%attr(755,root,root) %{_libdir}/courier-authlib/libauthpgsql.so
+%attr(755,root,root) %{_libdir}/courier-authlib/libauthpgsql.so*
%files authpipe
%defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/courier-authlib/libauthpipe.so
+%attr(755,root,root) %{_libdir}/courier-authlib/libauthpipe.so*
%files authsqlite
%defattr(644,root,root,755)
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/authlib/authsqliterc
-%attr(755,root,root) %{_libdir}/courier-authlib/libauthsqlite.so
+%attr(755,root,root) %{_libdir}/courier-authlib/libauthsqlite.so*
%files authuserdb
%defattr(644,root,root,755)
%attr(755,root,root) %{_sbindir}/userdb
%attr(755,root,root) %{_sbindir}/userdb-test-cram-md5
%attr(755,root,root) %{_sbindir}/userdbpw
-%attr(755,root,root) %{_libdir}/courier-authlib/libauthuserdb.so
+%attr(755,root,root) %{_libdir}/courier-authlib/libauthuserdb.so*
%{_mandir}/man8/makeuserdb.8*
%{_mandir}/man8/pw2userdb.8*
%{_mandir}/man8/userdb.8*