Commit graph

10 commits

Author SHA1 Message Date
Pablo Correa Gómez
bb4acf75ef user-accounts: run-passwd: Redirect stderr to stdout in the child
The previous code was prone to race conditions if the child already
started writing to stdout before the dup2 call happened. This has
been detected in postmarketOS[1] and I also reproduced it in Alpine
Linux. Since passwd writes to stderr and linux-pam to stdout, the
redirection was needed. However, linux-pam was failing with
"Conversation error" since an fprintf(stdout, ...) call wasn't
able to write to an already-closed stdout.

This problem is fixed by setting the redirection in the child setup
function and ignoring the stderr pipe. It also fixes a leak, where
the stderr fd was simply ignored and never closed.

[1] https://gitlab.com/postmarketOS/pmaports/-/issues/1449
2022-06-20 01:33:36 +00:00
Robert Ancell
c690e921ca user-accounts: Use g_autoptr/g_autofree 2021-01-08 15:25:07 +13:00
Yuri Chornoivan
e7050ab6f4 Fix minor typos 2020-07-20 10:38:09 +03:00
Ondrej Holy
65d3b71d98 user-accounts: Fix password dialog hangs
On Fedora 31, the "Current Password: " prompt is printed by passwd,
when I enter my current password wrongly. It is not clear to me why
and I don't know how to debug the PAM stack, but it causes that the
checkmark for the old password field is not reliable and what is worse
it causes the dialog hangs when it is submitted. Let's add check for
the "urrent" keyword to fix this issue.

Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/issues/766
2019-11-12 12:26:29 +00:00
Chris Coulson
7cbccd3578 user-accounts: Fix password check when using LDAP
Usually, passwd exits with an error if the current password is incorrect,
however, when using LDAP, it askes for password again. It causes hangs as
the passwd helper assumes that the password is correct. Let's prevent this
hangs using additional check for "incorrect" keyword.

Based on a patch from https://launchpad.net/bugs/607357 made by Ryan Tandy.

https://bugzilla.gnome.org/show_bug.cgi?id=786530
2019-06-06 07:13:47 +00:00
Daniel Mustieles
2c5951819d Updated FSF's address 2014-01-29 11:27:38 +01:00
Lionel Landwerlin
07bdf84dab user-accounts: fix wrong user data pointer usage
https://bugzilla.gnome.org/show_bug.cgi?id=698279
2013-04-22 16:41:32 +01:00
Bastien Nocera
ae108c45f3 user-accounts: Stop crash when changing the password
Pass the correct user data to the passwd_change_password() callback,
so we don't try to manipulate NULL pointers in place of the password
dialogue.

https://bugzilla.redhat.com/show_bug.cgi?id=874725
2013-03-13 09:25:31 +01:00
Bastien Nocera
af8a644075 user-accounts: Fix login keyring password not getting updated
By passing the environment down to passwed rather than an empty one.
This means that passwd's PAM modules will be able to access the session
D-Bus, for the gnome-keyring PAM module to change the keyring password
for example.

https://bugzilla.gnome.org/show_bug.cgi?id=616703
2012-08-22 16:31:59 +01:00
William Jon McCann
bf5cb44016 Add user-accounts dialog
Copied from the accounts-dialog git module.
2010-10-30 18:04:15 -04:00