Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 908431 - sys-auth/pam_xdg-0.8.1: New package.
Summary: sys-auth/pam_xdg-0.8.1: New package.
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Default Assignee for New Packages
URL:
Whiteboard:
Keywords: EBUILD, PATCH
Depends on:
Blocks:
 
Reported: 2023-06-13 08:20 UTC by Alexis
Modified: 2024-11-23 04:11 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
sys-auth/pam_xdg-0.8.1: New package (0001-sys-auth-pam_xdg-Add.patch,2.41 KB, patch)
2023-06-13 08:22 UTC, Alexis
Details | Diff
sys-auth/pam_xdg-0.8.1: New package (0001-sys-auth-pam_xdg-Add.patch,2.40 KB, patch)
2023-06-17 06:22 UTC, Alexis
Details | Diff
sys-auth/pam_xdg-0.8.1: New package (0001-sys-auth-pam_xdg-Add.patch,2.60 KB, patch)
2023-08-10 09:24 UTC, Alexis
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexis 2023-06-13 08:20:59 UTC
Further to sam@'s comment at https://forums.gentoo.org/viewtopic-p-8792180.html?sid=3b503a27eeca2d556d02e8ae54e1d584#8792180.

`ebuild pam_xdg-0.8.1.ebuild install` ran successfully on my AMD64 machine. But as i'm new to putting together new ebuilds, there's likely to be things i've missed doing!

Reproducible: Always
Comment 1 Alexis 2023-06-13 08:22:33 UTC
Created attachment 863760 [details, diff]
sys-auth/pam_xdg-0.8.1: New package
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-06-15 00:33:30 UTC
This is a pretty solid start.

I assume this definitely works for you at runtime too (you've tried using the module)?

As for the ebuild:
>SRC_URI="https://ftp.sdaoden.eu/pam_xdg-${PV}.tar.gz"

Use ${P} instead

>+IUSE="doc"

Drop, you're not using it anywhere.

+src_compile() {
+	emake
+}
+

Drop, this is the default definition.

Also, you'll have to add yourself as a maintainer. We can't add new stuff as maintainer-needed. See https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers/User_Guide#Proxied_maintainer_in_metadata.xml.
Comment 3 Alexis 2023-06-17 06:22:20 UTC
Created attachment 864003 [details, diff]
sys-auth/pam_xdg-0.8.1: New package
Comment 4 Alexis 2023-06-17 06:32:40 UTC
(In reply to Sam James from comment #2)
> I assume this definitely works for you at runtime too (you've tried using
> the module)?
i _believe_ it does, in the sense that XDG_CONFIG_DIRS, XDG_DATA_HOME, XDG_CONFIG_HOME, XDG_CACHE_HOME, XDG_STATE_HOME, XDG_RUNTIME_DIR and
XDG_DATA_DIRS all get set to appropriate values. But i should describe my test setup, in case i've approached it the wrong way:

* i edited /etc/pam.d/system-login, commenting out:

    -session        optional        pam_elogind.so

and at the end adding:

    -session        optional        pam_xdg.so

* i created a new user, logged in as that user, and immediately checked the output of `env`.

i've now updated the patch to address the issues you raised.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-06-23 22:15:10 UTC
Thanks, this looks almost perfect.

Should we be calling `dopamd` to install a snippet into /etc/pam.d, or should we instead defer to user configuration and/or add a USE flag into pambase instead?
Comment 6 Alexis 2023-06-25 04:37:31 UTC
(In reply to Sam James from comment #5)
> Thanks, this looks almost perfect.
> 
> Should we be calling `dopamd` to install a snippet into /etc/pam.d, or
> should we instead defer to user configuration and/or add a USE flag into
> pambase instead?
tl;dr: i'm not sure. :-)

Here's what i've learned from various bits of testing:

* Shells that utilise /etc/profile will source /etc/profile.env, which will set XDG_CONFIG_DIRS and XDG_DATA_DIRS after any setting of these vars done via PAM.

* Despite having `-elogind` in my USE in make.conf (probably done early on in my Gentoo usage as i was doing some initial playing around, and then forgotten about), elogind is installed and being used (presumably because some hard dep is overriding the USE flag). What this means in this context is that there are actually *two* locations in /etc/pam.d where pam_elogind.so gets referenced: not only /etc/pam.d/system-login, but *also* /etc/pam.d/elogind-user.

* Taking the preceding into consideration, the only XDG_* var set by pam_elogind.so that's *also* set by pam_xdg.so is XDG_RUNTIME_DIR, and they both set it to the same (i believe correct) value.

Given the above, off the top of my head, it *seems* that unconditionally adding a conf snippet shouldn't cause any issues, and would avoid requiring extra work from users. But since i'm no expert on PAM, perhaps someone from e.g. the Security team might be able to offer their thoughts?
Comment 7 Alexis 2023-08-10 09:24:10 UTC
Created attachment 867542 [details, diff]
sys-auth/pam_xdg-0.8.1: New package
Comment 8 Alexis 2024-10-13 03:46:21 UTC
Ping?
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-10-14 01:00:18 UTC
If nobody else looks, please remind me in a little while. Too busy at the moment
Comment 10 Alexis 2024-10-14 03:03:35 UTC
Fair enough, no worries - will do.
Comment 11 Ilja ”Zucca” Sara 2024-11-22 08:48:05 UTC
I would like to test this out.
So... *bump* ;)
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-11-22 10:55:36 UTC
The only thing to keep in mind with ordering in PAM is if you're modifying an existing pam.d snippet, you must check skip=N directives above/below.
Comment 13 Alexis 2024-11-23 04:11:10 UTC
Hmm, that complicates things further.

My own feeling is that it would be best to not rely on the user to set things up correctly, given that they might inadvertently negatively impact the security of their system - that instead, setup should be done by the ebuild, which can be reviewed to make sure it does things Right.

However, i'm no expert in PAM myself, so might it be possible for someone from the Security project to detail what to put in the ebuild to appropriately modify (i assume) pam.d/system-login while taking into consideration the possibility of skip actions somewhere else in the file?