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

Support the "%u" username alias in PlainUsers #1671

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

casantos
Copy link
Contributor

This permits to enable PAM for the effective user of the Xvnc process by adding this to ~/.vnc/config or /etc/tigervnc/vncserver-config-defaults:

SecurityTypes=TLSPlain
PlainUsers=%u

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2233204

Copy link
Member

@CendioOssman CendioOssman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks nice and clean! Thanks!

I wonder if there is a more descriptive marker we can use, though. I understand why systemd uses a single character, as it behaves more like a format string there. But in our case, it's a complete entry.

Did you stumble upon any more examples of configuration that has a marker like this? And wasn't using $USER. :)

%u probably works if we can't find anything better. But this is something we can't easily change later, so I think it is worth looking a bit extra at what options we have here.

@CendioOssman
Copy link
Member

Dovecot also uses %u for the current user:

https://doc.dovecot.org/configuration_manual/config_file/config_variables/#variables-mail-user

It also has longer names in the notation %{user}. That syntax is also used by Apache's mod_rewrite:

https://httpd.apache.org/docs/2.4/mod/mod_rewrite.html

.desktop files unfortunately use %u for URLs:

https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html

Not that I think that is a blocker.

@casantos
Copy link
Contributor Author

My first draft recognized$USER and $LOGNAME but I switched to %u to avoid confusing the parameter value with an environment variable.

I think %(user} is unnecessarily verbose. BASH uses \u for the prompt definitions but I don't consider \ better than %.

@CendioOssman
Copy link
Member

We don't seem to find any better alternatives, so let's proceed with %u.

common/rfb/SSecurityPlain.cxx Show resolved Hide resolved
common/rfb/SSecurityPlain.cxx Outdated Show resolved Hide resolved
common/rfb/SSecurityPlain.cxx Outdated Show resolved Hide resolved
unix/x0vncserver/x0vncserver.man Show resolved Hide resolved
This permits to enable PAM for the effective user of the Xvnc process by
adding this to ~/.vnc/config or /etc/tigervnc/vncserver-config-defaults:

   SecurityTypes=TLSPlain
   PlainUsers=%u

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2233204
Signed-off-by: Carlos Santos <casantos@redhat.com>
@CendioOssman CendioOssman merged commit 79d441e into TigerVNC:master Oct 4, 2023
16 checks passed
@casantos casantos deleted the casantos-rhbz_2233204 branch October 4, 2023 14:49
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.

2 participants