Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 150553 Details for
Bug 233210
Error parsing PAM i18n string
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Add 'Authenticating as "root"' messages
usermode-announce-user.patch (text/plain), 5.22 KB, created by
Miloslav Trmač
on 2007-03-21 04:35:57 UTC
(
hide
)
Description:
Add 'Authenticating as "root"' messages
Filename:
MIME Type:
Creator:
Miloslav Trmač
Created:
2007-03-21 04:35:57 UTC
Size:
5.22 KB
patch
obsolete
>? build >Index: ChangeLog >=================================================================== >RCS file: /usr/local/CVS/usermode/ChangeLog,v >retrieving revision 1.36 >diff -u -r1.36 ChangeLog >--- ChangeLog 19 Mar 2007 22:03:16 -0000 1.36 >+++ ChangeLog 21 Mar 2007 04:27:34 -0000 >@@ -1,3 +1,12 @@ >+2007-03-21 Miloslav Trmac <mitr@redhat.com> >+ >+ * userhelper.c (converse_console, converse_pipe): Don't replace >+ /.*password.*/i by "Password for %s". >+ (converse_console): Tell the user what user he should authenticate as. >+ * userhelper-wrap.c (userhelper_parse_childout): Don't initialize >+ resp->user from guessed data, always keep the UH_USER value. Tell the >+ user what user he should authenticate as. >+ > 2007-03-19 Miloslav Trmac <mitr@redhat.com> > > * configure.in: Release 1.91. >Index: userhelper-wrap.c >=================================================================== >RCS file: /usr/local/CVS/usermode/userhelper-wrap.c,v >retrieving revision 1.77 >diff -u -r1.77 userhelper-wrap.c >--- userhelper-wrap.c 16 Mar 2007 23:45:14 -0000 1.77 >+++ userhelper-wrap.c 21 Mar 2007 04:27:34 -0000 >@@ -426,21 +426,16 @@ > char *prompt; > int prompt_type; > static struct response *resp = NULL; >- struct passwd *pwd; > > if (resp == NULL) { > /* Allocate the response structure. */ > resp = g_malloc0(sizeof(struct response)); > >- /* Figure out who the invoking user is. */ >- pwd = getpwuid(getuid()); >- if (pwd == NULL) { >- pwd = getpwuid(0); >- } >- resp->user = pwd ? g_strdup(pwd->pw_name) : g_strdup("root"); >- > /* Create a table to hold the entry fields and labels. */ > resp->table = gtk_table_new(2, 1, FALSE); >+ /* First row may be is used for the "Authenticating as \"%s\"" >+ label */ >+ resp->rows = 1; > } > > /* Now process items from the child. */ >@@ -578,11 +573,8 @@ > break; > /* User name. Read it and save it for later. */ > case UH_USER: >- if ((strstr(prompt, "<user>") == NULL) && >- (strstr(prompt, "<none>") == NULL)) { >- g_free(resp->user); >- resp->user = g_strdup(prompt); >- } >+ g_free(resp->user); >+ resp->user = g_strdup(prompt); > #ifdef DEBUG_USERHELPER > g_print("User is \"%s\".\n", resp->user); > #endif >@@ -784,11 +776,21 @@ > DATADIR "/pixmaps/password.png", > NULL); > >- /* If we're asking questions, change the dialog's icon. */ >+ /* If we're asking questions, change the dialog's icon... */ > if (resp->responses > 0) { > image = (GTK_MESSAGE_DIALOG(resp->dialog))->image; > gtk_image_set_from_file(GTK_IMAGE(image), > DATADIR "/pixmaps/keyring.png"); >+ /* ... and tell the user which user's passwords to >+ * enter */ >+ if (resp->user != NULL) { >+ text = g_strdup_printf(_("Authenticating as \"%s\""), >+ resp->user); >+ label = gtk_label_new(text); >+ g_free(text); >+ gtk_table_attach(GTK_TABLE(resp->table), label, >+ 0, 2, 0, 1, 0, 0, PAD, PAD); >+ } > } > > /* Pack the table into the dialog box. */ >Index: userhelper.c >=================================================================== >RCS file: /usr/local/CVS/usermode/userhelper.c,v >retrieving revision 1.149 >diff -u -r1.149 userhelper.c >--- userhelper.c 17 Mar 2007 03:30:11 -0000 1.149 >+++ userhelper.c 21 Mar 2007 04:27:34 -0000 >@@ -561,31 +561,15 @@ > UH_ECHO_ON_PROMPT, msg[count]->msg); > expected_responses++; > break; >- case PAM_PROMPT_ECHO_OFF: { >- char *noecho_message; >- >- /* If the prompt is for the user's password, >- * indicate the user's name if we can. >- * Otherwise, just output the prompt as-is. */ >- if ((strncasecmp(msg[count]->msg, >- "password", >- 8) == 0)) { >- noecho_message = >- g_strdup_printf(_("Password for %s"), >- user); >- } else { >- noecho_message = g_strdup(msg[count]->msg); >- } >+ case PAM_PROMPT_ECHO_OFF: > #ifdef DEBUG_USERHELPER >- g_print("userhelper (cp): sending prompt (no echo) =" >- " \"%s\".\n", noecho_message); >+ g_print("userhelper (cp): sending prompt (no " >+ "echo) = \"%s\".\n", msg[count]->msg); > #endif > fprintf(data->output, "%d %s\n", >- UH_ECHO_OFF_PROMPT, noecho_message); >- g_free(noecho_message); >+ UH_ECHO_OFF_PROMPT, msg[count]->msg); > expected_responses++; > break; >- } > case PAM_TEXT_INFO: > /* Text information strings are output > * verbatim. */ >@@ -837,6 +821,11 @@ > fflush(stdout); > g_free(text); > } >+ if (user != NULL && strlen(user) != 0) { >+ fprintf(stdout, _("Authenticating as \"%s\""), user); >+ putchar('\n'); >+ fflush(stdout); >+ } > banner++; > } > >@@ -844,24 +833,15 @@ > for (i = 0; i < num_msg; i++) { > messages[i] = g_malloc(sizeof(*(messages[i]))); > *(messages[i]) = *(msg[i]); >- if (msg[i]->msg != NULL) { >- if ((strncasecmp(msg[i]->msg, "password", 8) == 0)) { >- messages[i]->msg = >- g_strdup_printf(_("Password for %s: "), >- user); >- } else { >- messages[i]->msg = g_strdup(_(msg[i]->msg)); >- } >- } >+ if (msg[i]->msg != NULL) >+ messages[i]->msg = _(msg[i]->msg); > } > >- ret = misc_conv(num_msg, (const struct pam_message**)messages, >+ ret = misc_conv(num_msg, (const struct pam_message **)messages, > resp, appdata_ptr); > >- for (i = 0; i < num_msg; i++) { >- g_free((char*)messages[i]->msg); >+ for (i = 0; i < num_msg; i++) > g_free(messages[i]); >- } > g_free(messages); > > return ret;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 233210
: 150553