LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-08-2022, 06:31 AM   #1
ZlatkO
Member
 
Registered: Oct 2020
Location: Bad Vöslau, Austria
Distribution: Slackware. What else?
Posts: 38

Rep: Reputation: 26
PAM feature request: include "--enable-vendordir=/usr/local/etc" in build options


It would be great if we could get the official pam package rebuilt with "--enable-vendordir=/usr/local/etc", so that those of us who already did a minimal PAM setup/installation on their own a while ago (in order to be able to keep up with more recent GNOME & freedesktop.org packages, like elogind, lightdm & gnome-flashback, for example) can keep their non-distro-provided stuff in /usr/local, without having to clutter the now distro-provided /etc/pam.d infrastructure.

Code:
[root@disclosure:~]# ls -ld /usr/local/stow/*/etc/pam*
drwxr-xr-x 2 root root 4096 Okt 15 05:43 /usr/local/stow/Linux-PAM-1.5.1/etc/pam.d
drwxr-xr-x 2 root root 4096 Sep 20 11:31 /usr/local/stow/elogind-246.10-@FDO/etc/pam.d
drwxr-xr-x 2 root root 4096 Jän 14 22:19 /usr/local/stow/gdm-41.3-@GNOME3/etc/pam.d
drwxr-xr-x 2 root root 4096 Dez  7 11:40 /usr/local/stow/gnome-flashback-3.42.1-@GNOME3/etc/pam.d
drwxr-xr-x 2 root root 4096 Sep 20 11:36 /usr/local/stow/lightdm-1.30.0/etc/pam.d
drwxr-xr-x 2 root root 4096 Jun 26  2019 /usr/local/stow/openvpn-admin-1.9.4-2-@TEST/etc/pam.d
drwxr-xr-x 2 root root 4096 Okt 18  2008 /usr/local/stow/openvpn-admin-1.9.4-2/etc/pam.d
drwxr-xr-x 2 root root 4096 Sep  9 22:12 /usr/local/stow/slimlock-0.11/etc/pam.d
The plan is to replace Linux-PAM and elogind from my GNU stow setup with Slackware's official packages, and it would be great if the rest my locally installed packages would just keep working. It wouldn't be a problem to keep a local patch for the pam.SlackBuild script and rebuild the official package with that one option added, of course, but it'd be nice if I don't had to.
 
Old 02-08-2022, 03:37 PM   #2
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,918

Rep: Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035
I wouldn't be opposed to having a vendor dir specified for pam, but it shouldn't point into /usr/local. 'vendordir', as its name suggests, is for Pat(our vendor) to use; /etc/pam.d is for the administrator.

So, Pat would put his stock stuff in /usr/lib/pam.d/ or some such, and you as the local admin get to play with /etc/pam.d

edit: actually, according to this page. There's 3 locations
/etc/pam.d
/usr/lib/pam.d/
<vendor-dir>/pam.d

So Pat could put his stuff in /usr/lib without enabling vendor-dir. What you describe sounds more like a site-dir though, so perhaps the option is misnamed?

Last edited by GazL; 02-08-2022 at 03:46 PM.
 
2 members found this post helpful.
Old 02-08-2022, 11:56 PM   #3
ZlatkO
Member
 
Registered: Oct 2020
Location: Bad Vöslau, Austria
Distribution: Slackware. What else?
Posts: 38

Original Poster
Rep: Reputation: 26
Yes, this also exactly matches the source code, and what gets installed with a plain vanilla "make install". From Linux-PAM-1.5.2/libpam/pam_private.h:
Code:
/* the Linux-PAM configuration file */

#define PAM_CONFIG         "/etc/pam.conf"
#define PAM_CONFIG_D       "/etc/pam.d"
#define PAM_CONFIG_DF      "/etc/pam.d/%s"
#define PAM_CONFIG_DIST_D  "/usr/lib/pam.d"
#define PAM_CONFIG_DIST_DF "/usr/lib/pam.d/%s"
#ifdef VENDORDIR
#define PAM_CONFIG_DIST2_D  VENDORDIR"/pam.d"
#define PAM_CONFIG_DIST2_DF VENDORDIR"/pam.d/%s"
#endif
Upon installation, all the actual default config files go to /etc/pam.d, and /usr/lib/pam.d remains empty (it actually doesn't even get created, IIRC). The /etc/pam.conf is deprecated (since 1997, as it seems, no less ), and under Linux-PAM-1.5.2/conf/pam_conv1/ you get a small utility to convert an existing /etc/pam.conf to the modern current modular /etc/pam.d structure. The /Linux-PAM-1.5.2/conf/pam_conv1/README says:
Code:
This directory contains a utility to convert pam.conf files to a pam.d/
tree. The conversion program takes pam.conf from the standard input and
creates the pam.d/ directory in the current directory.

The program will fail if ./pam.d/ already exists.

Andrew Morgan, February 1997
So, yeah, the --with-vendordir might be a misnomer. The _DIST_/_DIST2_ parts probably mean "distro dir 1/2". But still, no matter what it's called in the configure script or in the source code, it can be used in whatever way Pat sees fit. And given the rare number of occasions that he actually does see a need to deviate from the plain vanilla upstream sources, having /usr/lib/pam.d at his disposal is probably all he needs in that case, I'd guess (and you seem to agree in the first part of the last line you wrote).

So we still could have this "vendor dir" as the local admin's playground, and putting it into /usr/local/etc would make the most sense from an FHS point of view. Again, I could also live with keeping a local patch for the build script and do a quick rebuild whenever pam gets updated, but of course it would be a lot more convenient if I just could install the official package as-is.
 
2 members found this post helpful.
Old 02-09-2022, 03:19 AM   #4
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,918

Rep: Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035
Quote:
Originally Posted by ZlatkO View Post

So we still could have this "vendor dir" as the local admin's playground, and putting it into /usr/local/etc would make the most sense from an FHS point of view. Again, I could also live with keeping a local patch for the build script and do a quick rebuild whenever pam gets updated, but of course it would be a lot more convenient if I just could install the official package as-is.
Yes, the "vendordir" name on the 3rd location confused me initially.

To be clear, I'd like to see Pat move the stock pam configs into /usr/lib/pam.d/ leaving /etc/pam.d empty for the admin to use.
I've no objection to your /usr/local/etc pam.d as a third location, but given that /etc/pam.d would be empty and free for the admin to use I do question the usefulness of a 3rd dir under /usr/local/etc.
 
Old 02-09-2022, 04:35 AM   #5
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,918

Rep: Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035
BTW, as a test I just did:
Code:
# mkdir /usr/lib/pam.d/
# cp /etc/pam.d/* /usr/lib/pam.d/
# rm /etc/pam.d/*
Everything was fine.
 
1 members found this post helpful.
Old 02-09-2022, 07:54 AM   #6
ZlatkO
Member
 
Registered: Oct 2020
Location: Bad Vöslau, Austria
Distribution: Slackware. What else?
Posts: 38

Original Poster
Rep: Reputation: 26
Quote:
Originally Posted by GazL View Post
I've no objection to your /usr/local/etc pam.d as a third location, but given that /etc/pam.d would be empty and free for the admin to use I do question the usefulness of a 3rd dir under /usr/local/etc.
Well, that's just a personal preference. I have tons of stuff installed locally in /usr/local, including stuff that's actually provided by Slackware, but in (much) older versions. This includes the whole freedesktop.org stack, all of GTK/GNOME2/GNOME3, countless Perl, Python2 & Python3 modules, etc. I'm basically using Slackware as a vehicle to boot up my core system and start X, and almost all of my actual desktop is self-compiled and living in /usr/local/stow. I'm making extensive (or should I say excessive? ) use of Slackware's inherent beauty of not getting in your way when you wish to swap out arbitrary parts of the OS, even if it's core parts, and replace them with your own.

Code:
[root@disclosure:~]# ls -1 /var/log/packages/ | wc -l
646
[root@disclosure:~]# ls -1 /usr/local/stow/ | wc -l
4286
[root@disclosure:~]# ls -1 /usr/local/stow/*@{FDO,GNOME,CRYPTO,PYTHON,PERL,MONO,VIRT}* | sort -u | wc -l
1797
So, out of habit, I leave the "official" stuff in /etc and /usr mostly untouched, except for what I need to change to have it include my own stuff in /usr/local. In 95+% of all cases, if you compile something with --prefix=/usr/local, its configuration will end up in /usr/local/etc as well. So having it pre-included as a search path for PAM without the need for a local patch would be very convenient.

Last edited by ZlatkO; 02-09-2022 at 07:55 AM.
 
2 members found this post helpful.
Old 02-09-2022, 08:10 AM   #7
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,918

Rep: Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035
I see. yes, I can see the benefit of that. Lets see if we can get Pat on board.
 
1 members found this post helpful.
Old 02-09-2022, 08:28 AM   #8
Jan K.
Member
 
Registered: Apr 2019
Location: Esbjerg
Distribution: Windows 7...
Posts: 773

Rep: Reputation: 489Reputation: 489Reputation: 489Reputation: 489Reputation: 489
+1 here. Sound advice!

Voted by giving thread 5 stars and Thanks for useful post.


Quote:
Originally Posted by ZlatkO View Post
... I'm making extensive (or should I say excessive? ) use of Slackware's inherent beauty of not getting in your way...
It's quite good at that!
 
1 members found this post helpful.
Old 02-09-2022, 11:06 AM   #9
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by ZlatkO View Post
Well, that's just a personal preference. I have tons of stuff installed locally in /usr/local, including stuff that's actually provided by Slackware, but in (much) older versions.
Having custom configs stored in /etc/ instead of /usr/local/etc/ would match many other pieces of software, including xorg, modprobe, and udev. Their primary configs are under /usr/ and admins can adjust those by adding files into /etc/.

Personally, I believe /usr/local/etc/ should typically be used for software that is stored in /usr/local/, but Slackware is not my distro to make those types of upper management decisions.
 
Old 02-09-2022, 11:31 AM   #10
ZlatkO
Member
 
Registered: Oct 2020
Location: Bad Vöslau, Austria
Distribution: Slackware. What else?
Posts: 38

Original Poster
Rep: Reputation: 26
Quote:
Originally Posted by bassmadrigal View Post
Personally, I believe /usr/local/etc/ should typically be used for software that is stored in /usr/local/, [...]
Yes, and that's exactly what I'm doing (ie. storing/installing software in /usr/local), which in turn is exactly why having PAM include /usr/local/etc/pam.d out of the box would be very convenient.
 
1 members found this post helpful.
Old 02-09-2022, 12:42 PM   #11
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,918

Rep: Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035
Quote:
Originally Posted by bassmadrigal View Post
Having custom configs stored in /etc/ instead of /usr/local/etc/ would match many other pieces of software, including xorg, modprobe, and udev. Their primary configs are under /usr/ and admins can adjust those by adding files into /etc/.

Personally, I believe /usr/local/etc/ should typically be used for software that is stored in /usr/local/, but Slackware is not my distro to make those types of upper management decisions.
The /usr/local/etc would be the lowest precedence of the 3 locations, so it's only useful for adding new rules, not replacing old one. So,

Pat puts the "stock" stuff in /usr/lib/pam.d/
The admin can override that by using /etc/pam.d
and extra stuff can append their own rules by using /usr/local/etc/pam.d.

It seems like a sound scheme to me.
 
1 members found this post helpful.
Old 02-09-2022, 01:14 PM   #12
0XBF
Member
 
Registered: Nov 2018
Distribution: Slackware
Posts: 796

Rep: Reputation: 913Reputation: 913Reputation: 913Reputation: 913Reputation: 913Reputation: 913Reputation: 913Reputation: 913
Quote:
Originally Posted by GazL View Post
The /usr/local/etc would be the lowest precedence of the 3 locations, so it's only useful for adding new rules, not replacing old one. So,

Pat puts the "stock" stuff in /usr/lib/pam.d/
The admin can override that by using /etc/pam.d
and extra stuff can append their own rules by using /usr/local/etc/pam.d.

It seems like a sound scheme to me.
I don't have much to add other than I would support that change. I've made a few modifications to the login, sddm, and system-auth pam configs that suit my use better than stock configs. It gets a little tricky with package upgrades making sure that I don't override/revert to stock versions. I wouldn't use the "vendordir" location but just having an option to bypass default configs with customizations that dont get clobbered would be nice.
 
1 members found this post helpful.
Old 02-09-2022, 02:12 PM   #13
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by ZlatkO View Post
Yes, and that's exactly what I'm doing (ie. storing/installing software in /usr/local), which in turn is exactly why having PAM include /usr/local/etc/pam.d out of the box would be very convenient.
I thought you meant to not support /etc/, so if /usr/local/etc/ support is in addition to /etc/, I'm all for that.
 
1 members found this post helpful.
Old 02-09-2022, 10:53 PM   #14
ZlatkO
Member
 
Registered: Oct 2020
Location: Bad Vöslau, Austria
Distribution: Slackware. What else?
Posts: 38

Original Poster
Rep: Reputation: 26
Quote:
Originally Posted by bassmadrigal View Post
I thought you meant to not support /etc/, so if /usr/local/etc/ support is in addition to /etc/, I'm all for that.
Ah, I see. Yes, that would be the plan. Additional, of course. Sorry if I was not clear on that important detail.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/etc/pam.d/system-auth-ac vs. /etc/pam.d/password-auth-ac vs. /etc/pam.d/sshd christr Red Hat 2 08-01-2014 07:08 PM
please difference between /usr/include & /usr/local/include baxzius Linux - Software 2 07-09-2010 05:19 AM
changing include directories - /usr/local/include quep_fly Linux - Newbie 6 08-12-2007 04:36 PM
which headers usr/include/ or /usr/include/nptl/? Chris.Rector Linux - Enterprise 0 02-02-2007 01:40 PM
Compromised? Files "/usr/lib.hwm", "/usr/lib.pwd", "/usr/lib.pwi" Klaus Pforte Linux - Security 4 09-28-2004 11:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration