Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use setusercontext(3) where available #334

Merged
merged 2 commits into from
Jan 17, 2024

Conversation

madpilot78
Copy link
Contributor

Hi,

I recreated the patch suggested by @DanielO in issue #269 as a pull request.

This patch adds checks in configure for setusercontext(3) and then uses it, if available, to switch user after forking int he session.

Using this method leverages existing FreeBSD code to se the user session that takes into account the login.conf values and also allows automated substitution of ~ (tilde) and $ (dollar) characters with their values.

This solves issues on FreeBSD and the patch is being discussed for inclusion in the FreeBSD port here: https://bugs.freebsd.org/266532

Manual page for setusercontext: setusercontext(3)

Copy link

Hey! madpilot78 has not signed the Canonical CLA which is required to get this contribution merged on this project.

Please head over to https://ubuntu.com/legal/contributors to read more about it.

@madpilot78
Copy link
Contributor Author

Regarding the agreement, I only reworked an existing patch already sent by the user as a Pull Request, I cannot assert any copyright myself on this patch.

So I cannot sign any agreement stating such assertion regarding this.

I'm not sure what the policy should be in this case.

@DanielO
Copy link

DanielO commented Dec 27, 2023

It is also largely copied from xdm in any case, so perhaps that complicates it more...

@madpilot78
Copy link
Contributor Author

To any project developers, I'd really like to help including this in the official port. But I'm not able to complete the CLA form, since it asks me to fill a field Canonical Project Manager or contact, where I don't know what to write into.

If you give me this information I'll be at least able to sign the CLA.

vishwin pushed a commit to vishwin/freebsd-ports that referenced this pull request Dec 29, 2023
- Add patch to use setusercontext(3) to setup user environment, so it respects login.conf among other things [1]
- Use autoreconf, since patch requires regenerating configure script to check for setusercontext(3) [2]
- Explicitly disable libaudit support, not supported in FreeBSD [3]
- Add QT5 options, disabled by default, to control linking against qt5 [4]
- Import patch adding option to enable alternative location for .xsession-errors file [5]
- Correctly define runtime dependencies
- Forcibly disable installation of apparmor files
- Install PAM configuration files as samples, so in the future they are not overwritten if customized
- Pet portclippy/portfmt
- Regenerate patches

Upstreaming:

[1] canonical/lightdm#334

[5] canonical/lightdm#335

Many thanks to all people involved!

PR:		266532 [1] [2],
		273720 [1],
		275885 [3] [4] [5]
Tested by:	Ivan Rozhuk <[email protected]>,
		Daniel Tameling <[email protected]> (provided setusercontext patch),
		Anton Saietskii <[email protected]>
@robert-ancell
Copy link
Collaborator

@madpilot78 you can set me as the contact in the form, thanks! This should be good to land after that's complete.

@madpilot78
Copy link
Contributor Author

@robert-ancell

Thanks! I just compiled and submitted the agreement online. I have found no easy way to rerun checks on this PR (and #335) but everything should be fine now.

@robert-ancell robert-ancell merged commit de36065 into canonical:main Jan 17, 2024
2 of 3 checks passed
@madpilot78 madpilot78 deleted the use_setusercontext branch January 17, 2024 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants