public inbox for [email protected]  
help / color / mirror / Atom feed
Possible bug for pam auth in at least 9.6 and 10 rpms on CentOS 7
4+ messages / 2 participants
[nested] [flat]

* Possible bug for pam auth in at least 9.6 and 10 rpms on CentOS 7
@ 2017-06-08 12:11  Jesper St John <[email protected]>
  0 siblings, 2 replies; 4+ messages in thread

From: Jesper St John @ 2017-06-08 12:11 UTC (permalink / raw)
  To: pgsql-pkg-yum

When installing postgresql-server package, it puts a file in /etc/pam.d/ 
called postgresql%{majorversion}.

Postgres source says this (src/backend/libpq/auth.c):
#define PGSQL_PAM_SERVICE "postgresql"  /* Service name passed to PAM */

That creates the need to create a new file named /etc/pam.d/postgresql 
to make pam auth work for me.

I've tested this with both 9.6 and 10 beta on CentOS 7 latest.


Best regards,
Jesper St John
[email protected]



Suggested patch below:


diff --git a/rpm/redhat/10/postgresql/master/postgresql-10.spec 
b/rpm/redhat/10/postgresql/master/postgresql-10.spec
index d6e53b0c..32542462 100644
--- a/rpm/redhat/10/postgresql/master/postgresql-10.spec
+++ b/rpm/redhat/10/postgresql/master/postgresql-10.spec
@@ -781,7 +781,7 @@ install -m 755 %{sname}.init 
%{buildroot}%{_initrddir}/%{sname}-%{pgmajorversion

  %if %pam
  install -d %{buildroot}/etc/pam.d
-install -m 644 %{SOURCE14} 
%{buildroot}/etc/pam.d/%{sname}%{pgmajorversion}
+install -m 644 %{SOURCE14} %{buildroot}/etc/pam.d/%{sname}
  %endif

  # Create the directory for sockets.
@@ -1231,7 +1231,7 @@ fi
  %config(noreplace) %{_initrddir}/%{sname}-%{pgmajorversion}
  %endif
  %if %pam
-%config(noreplace) /etc/pam.d/%{sname}%{pgmajorversion}
+%config(noreplace) /etc/pam.d/%{sname}
  %endif
  %attr (755,root,root) %dir /etc/sysconfig/pgsql
  %{pgbaseinstdir}/bin/initdb


-- 
Sent via pgsql-pkg-yum mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-pkg-yum



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Possible bug for pam auth in at least 9.6 and 10 rpms on CentOS 7
@ 2017-06-09 10:40  Devrim Gündüz <[email protected]>
  parent: Jesper St John <[email protected]>
  1 sibling, 1 reply; 4+ messages in thread

From: Devrim Gündüz @ 2017-06-09 10:40 UTC (permalink / raw)
  To: Jesper St John <[email protected]>; pgsql-pkg-yum


Hi Jesper,

Seems reasonable. I'll apply this patch early next week.

Regards, Devrim

On Thu, 2017-06-08 at 14:11 +0200, Jesper St John wrote:
> When installing postgresql-server package, it puts a file in /etc/pam.d/ 
> called postgresql%{majorversion}.
> 
> Postgres source says this (src/backend/libpq/auth.c):
> #define PGSQL_PAM_SERVICE "postgresql"  /* Service name passed to PAM */
> 
> That creates the need to create a new file named /etc/pam.d/postgresql 
> to make pam auth work for me.
> 
> I've tested this with both 9.6 and 10 beta on CentOS 7 latest.
> 
> 
> Best regards,
> Jesper St John
> [email protected]
> 
> 
> 
> Suggested patch below:
> 
> 
> diff --git a/rpm/redhat/10/postgresql/master/postgresql-10.spec 
> b/rpm/redhat/10/postgresql/master/postgresql-10.spec
> index d6e53b0c..32542462 100644
> --- a/rpm/redhat/10/postgresql/master/postgresql-10.spec
> +++ b/rpm/redhat/10/postgresql/master/postgresql-10.spec
> @@ -781,7 +781,7 @@ install -m 755 %{sname}.init 
> %{buildroot}%{_initrddir}/%{sname}-%{pgmajorversion
> 
>   %if %pam
>   install -d %{buildroot}/etc/pam.d
> -install -m 644 %{SOURCE14} 
> %{buildroot}/etc/pam.d/%{sname}%{pgmajorversion}
> +install -m 644 %{SOURCE14} %{buildroot}/etc/pam.d/%{sname}
>   %endif
> 
>   # Create the directory for sockets.
> @@ -1231,7 +1231,7 @@ fi
>   %config(noreplace) %{_initrddir}/%{sname}-%{pgmajorversion}
>   %endif
>   %if %pam
> -%config(noreplace) /etc/pam.d/%{sname}%{pgmajorversion}
> +%config(noreplace) /etc/pam.d/%{sname}
>   %endif
>   %attr (755,root,root) %dir /etc/sysconfig/pgsql
>   %{pgbaseinstdir}/bin/initdb
> 
> 

-- 
Devrim Gündüz
EnterpriseDB: https://www.enterprisedb.com
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
Twitter: @DevrimGunduz , @DevrimGunduzTR


Attachments:

  [application/pgp-signature] signature.asc (819B, 2-signature.asc)
  download

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Possible bug for pam auth in at least 9.6 and 10 rpms on CentOS 7
@ 2017-06-12 07:35  Jesper St John <[email protected]>
  parent: Devrim Gündüz <[email protected]>
  0 siblings, 0 replies; 4+ messages in thread

From: Jesper St John @ 2017-06-12 07:35 UTC (permalink / raw)
  To: Devrim Gündüz <[email protected]>; +Cc: pgsql-pkg-yum

That is awesome news. Thanks!

//Jesper

2017-06-09 12:40 skrev Devrim Gündüz:
> Hi Jesper,
> 
> Seems reasonable. I'll apply this patch early next week.
> 
> Regards, Devrim
> 
> On Thu, 2017-06-08 at 14:11 +0200, Jesper St John wrote:
>> When installing postgresql-server package, it puts a file in 
>> /etc/pam.d/ 
>> called postgresql%{majorversion}.
>> 
>> Postgres source says this (src/backend/libpq/auth.c):
>> #define PGSQL_PAM_SERVICE "postgresql"  /* Service name passed to PAM 
>> */
>> 
>> That creates the need to create a new file named 
>> /etc/pam.d/postgresql 
>> to make pam auth work for me.
>> 
>> I've tested this with both 9.6 and 10 beta on CentOS 7 latest.
>> 
>> 
>> Best regards,
>> Jesper St John
>> [email protected]
>> 
>> 
>> 
>> Suggested patch below:
>> 
>> 
>> diff --git a/rpm/redhat/10/postgresql/master/postgresql-10.spec 
>> b/rpm/redhat/10/postgresql/master/postgresql-10.spec
>> index d6e53b0c..32542462 100644
>> --- a/rpm/redhat/10/postgresql/master/postgresql-10.spec
>> +++ b/rpm/redhat/10/postgresql/master/postgresql-10.spec
>> @@ -781,7 +781,7 @@ install -m 755 %{sname}.init 
>> %{buildroot}%{_initrddir}/%{sname}-%{pgmajorversion
>> 
>>   %if %pam
>>   install -d %{buildroot}/etc/pam.d
>> -install -m 644 %{SOURCE14} 
>> %{buildroot}/etc/pam.d/%{sname}%{pgmajorversion}
>> +install -m 644 %{SOURCE14} %{buildroot}/etc/pam.d/%{sname}
>>   %endif
>> 
>>   # Create the directory for sockets.
>> @@ -1231,7 +1231,7 @@ fi
>>   %config(noreplace) %{_initrddir}/%{sname}-%{pgmajorversion}
>>   %endif
>>   %if %pam
>> -%config(noreplace) /etc/pam.d/%{sname}%{pgmajorversion}
>> +%config(noreplace) /etc/pam.d/%{sname}
>>   %endif
>>   %attr (755,root,root) %dir /etc/sysconfig/pgsql
>>   %{pgbaseinstdir}/bin/initdb
>> 
>> 


-- 
Sent via pgsql-pkg-yum mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-pkg-yum



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Possible bug for pam auth in at least 9.6 and 10 rpms on CentOS 7
@ 2017-06-23 19:03  Devrim Gündüz <[email protected]>
  parent: Jesper St John <[email protected]>
  1 sibling, 0 replies; 4+ messages in thread

From: Devrim Gündüz @ 2017-06-23 19:03 UTC (permalink / raw)
  To: Jesper St John <[email protected]>; pgsql-pkg-yum


Hi,

On Thu, 2017-06-08 at 14:11 +0200, Jesper St John wrote:
> When installing postgresql-server package, it puts a file in /etc/pam.d/ 
> called postgresql%{majorversion}.
> 
> Postgres source says this (src/backend/libpq/auth.c):
> #define PGSQL_PAM_SERVICE "postgresql"  /* Service name passed to PAM */
> 
> That creates the need to create a new file named /etc/pam.d/postgresql 
> to make pam auth work for me.
> 
> I've tested this with both 9.6 and 10 beta on CentOS 7 latest.

Pushed this to 9.5+. Thanks for the patch!

Regards, Devrim

-- 
Devrim Gündüz
EnterpriseDB: https://www.enterprisedb.com
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
Twitter: @DevrimGunduz , @DevrimGunduzTR


Attachments:

  [application/pgp-signature] signature.asc (819B, 2-signature.asc)
  download

^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2017-06-23 19:03 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-06-08 12:11 Possible bug for pam auth in at least 9.6 and 10 rpms on CentOS 7 Jesper St John <[email protected]>
2017-06-09 10:40 ` Devrim Gündüz <[email protected]>
2017-06-12 07:35   ` Jesper St John <[email protected]>
2017-06-23 19:03 ` Devrim Gündüz <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox