Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] XDM: Label for password input
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
torf
n00b
n00b


Joined: 27 Apr 2004
Posts: 65
Location: Constance/Germany

PostPosted: Mon May 12, 2008 11:15 pm    Post subject: [solved] XDM: Label for password input Reply with quote

I'm currently customizing the looks of my XDM, but I have problems setting the label for the password field. All guides I have found say that it can be set in the Xresources file using the xlogin*passwdPrompt setting, but this setting has no effect for me. Other label settings, like xlogin*namePrompt, work. There's nothing interesting in /var/log/xdm.log.

Thanks for any pointers on what I'm doing wrong :)

/etc/X11/xdm/Xresources:
Code:
! Geometry
xlogin*geometry: 600x500+0+0

! Fore- and background colors for the box. Foreground is used for input text
xlogin*foreground: grey50
xlogin*background: white

! Font colors
xlogin*greetColor: white
xlogin*promptColor: black
xlogin*failColor: red

! Font
xlogin*greetFace:       Helvetica-12
xlogin*face:            Helvetica-12
xlogin*promptFace:      Helvetica-12:bold
xlogin*failFace:        Helvetica-12:bold


! Texts
!xlogin*greeting:
xlogin*namePrompt: login
xlogin*passwdPrompt: pass
xlogin*fail: login failed

! Borders
xlogin*borderWidth: 0
xlogin*frameWidth: 0
xlogin*innerFramesWidth: 0
xlogin*shdColor: white
xlogin*hiColor: white


Last edited by torf on Tue May 13, 2008 12:19 pm; edited 1 time in total
Back to top
View user's profile Send private message
BradN
Advocate
Advocate


Joined: 19 Apr 2002
Posts: 2391
Location: Wisconsin (USA)

PostPosted: Tue May 13, 2008 1:05 am    Post subject: Reply with quote

Have you tried other variations like passPrompt, passwordPrompt?

You could try running "strings" on the xdm binary to see if you can spot the setting name it's looking for.
Back to top
View user's profile Send private message
torf
n00b
n00b


Joined: 27 Apr 2004
Posts: 65
Location: Constance/Germany

PostPosted: Tue May 13, 2008 11:53 am    Post subject: Reply with quote

I just tried "passPrompt" and "passwordPrompt" as you suggested, but that did not work, either. The strings idea was nice, but did not work -- even "namePrompt" which definitely works does not show up in the listing, nor does anything containing "word" or "pass".

Is there a way to find out which Xresources a program tries to access?
Back to top
View user's profile Send private message
torf
n00b
n00b


Joined: 27 Apr 2004
Posts: 65
Location: Constance/Germany

PostPosted: Tue May 13, 2008 12:18 pm    Post subject: [solved] XDM: Label for password input Reply with quote

Sometimes it helps to RTFM: Found this in man xdm (and no, I have no idea why I didn't look in there before :roll:):
man xdm wrote:
xlogin.Login.passwdPrompt
The string displayed to prompt for a password, when not using an
authentication system such as PAM that provides its own prompts.
The default is ``Password: ''

So the resource string was right, but PAM's setting is preferred. I haven't found a way yet to change PAM's setting (mainly because I haven't found where these settings are stored :D), but I guess I'll stick with the default value then.
Back to top
View user's profile Send private message
mimosinnet
l33t
l33t


Joined: 10 Aug 2006
Posts: 713
Location: Barcelona, Spain

PostPosted: Sat May 17, 2008 11:06 am    Post subject: Reply with quote

I have recently moved to xdm and I find it wonderful. I was having the same issue with the xlogin*passwdPrompt. Have you been able to solve it?

Also, do you know how can I choose the desktop manager / window manager from xdm?

This is a screenshot of my login screen, with conky and root-tail running.

Cheers!
Back to top
View user's profile Send private message
torf
n00b
n00b


Joined: 27 Apr 2004
Posts: 65
Location: Constance/Germany

PostPosted: Sun May 18, 2008 12:54 am    Post subject: Reply with quote

mimosinnet: I haven't looked further into changing the password label, but as it's apparently controlled by PAM you should look there if you need it changed. As on how to choose your WM from XDM I have no idea (I always use the same), but there are a lot of tutorials on this forum and the net to enhance XDM with all kind of stuff (WM choosers, shutdown buttons, etc.).
Back to top
View user's profile Send private message
mimosinnet
l33t
l33t


Joined: 10 Aug 2006
Posts: 713
Location: Barcelona, Spain

PostPosted: Mon May 19, 2008 11:24 pm    Post subject: Reply with quote

Thanks for your answer. I have looked around for a simple way to choose among window managers with xdm. In case you need it in the future, you have to add a line like:
Code:
<Key>F2: set-session-argument(fvwm) finish-field()\n\

in the xlogin*login.translations of the /etc/X11/xdm/Xresources. I have written the information in the Gentoo Wiki.

Cheers!
Back to top
View user's profile Send private message
rlmaers
n00b
n00b


Joined: 30 Jul 2012
Posts: 10
Location: Norway

PostPosted: Fri Mar 26, 2021 6:48 am    Post subject: Reply with quote

Sorry for bumping such an old thread, but it might be helpful for bypassers having the same problem.

I've looked through the xdm and pam source, and from what I can see there is no way to configure the password prompt provided by pam. So I ended up overriding the pam provided values with the ones from Xresources when xdm uses pam. The following patch can be simply put in /etc/portage/patches/x11-apps/xdm-1.1.12 and should be applied automatically upon re-emerging xdm.

Code:

--- a/greeter/greet.c   2019-03-02 23:06:13.000000000 +0100
+++ b/greeter/greet.c   2021-03-25 20:56:32.563163664 +0100
@@ -598,8 +598,8 @@
        SessionExit (d, code, FALSE);
    }
    if ((pam_error == PAM_SUCCESS) && (Verify (d, greet, verify))) {
-       SetPrompt (login, 1, "Login Successful", LOGIN_TEXT_INFO, False);
-       SetValue (login, 1, NULL);
+       //SetPrompt (login, 1, "Login Successful", LOGIN_TEXT_INFO, False);
+       //SetValue (login, 1, NULL);
        break;
    } else {
        /* Try to fill in username for failed login error log */
@@ -747,6 +747,21 @@
           pam_msg_styles[m->msg_style] : pam_msg_styles[0],
           m->msg_style, m->msg);
 
+   // Override PAM prompt values with values from Xresources
+   char *prompt_msg;
+   switch (promptId) {
+      case LOGIN_PROMPT_USERNAME:
+         SetPrompt(login, LOGIN_PROMPT_USERNAME, NULL, LOGIN_PROMPT_NOT_SHOWN, False);
+         prompt_msg = GetPrompt(login, LOGIN_PROMPT_USERNAME);
+         break;
+      case LOGIN_PROMPT_PASSWORD:
+         SetPrompt(login, LOGIN_PROMPT_PASSWORD, NULL, LOGIN_PROMPT_NOT_SHOWN, False);
+         prompt_msg = GetPrompt(login, LOGIN_PROMPT_PASSWORD);
+         break;
+      default:
+         prompt_msg = m->msg;
+   }
+
    switch (m->msg_style) {
      case PAM_ERROR_MSG:
          ErrorMessage(login, m->msg, True);
@@ -761,7 +776,8 @@
          pStyle = LOGIN_PROMPT_ECHO_ON;
          /* FALLTHROUGH */
           case PAM_PROMPT_ECHO_OFF:
-         SetPrompt (login, promptId, m->msg, pStyle, False);
+         //SetPrompt (login, promptId, m->msg, pStyle, False);
+         SetPrompt (login, promptId, prompt_msg, pStyle, False);
          SetValue (login, promptId, NULL);
          greetCode = Greet (d->d, d->greet);
          if (greetCode != 0) {
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 21715

PostPosted: Fri Mar 26, 2021 4:18 pm    Post subject: Reply with quote

Although it may be more convenient when developing a change, patches like this are often more readable if you do not retain a commented-out copy of the original, since the diff context will do that for you.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum