Public bug reported:
[ Impact ]
* Users may be unable to add an active directory user for login through
the gnome control center.
* The issue is actually a race condition between the task adding the
login
[ Test Plan ]
1. Set up an active directory domain (for example using Samba [0])
Example
-------
REALM: SRU.INTERNAL
DOMAIN: SRU
USER: TestUser
PASSWORD: TestPassword
-------
2. Add that activity directory domain host to the `/etc/hosts` file if necessary
Set your activity directory host as authoritative DNS for the AD domain
Example
---
cat <<EOF >/etc/systemd/resolved.conf
[Resolve]
DNS=<AD-SERVER-IP>
Domains=sru.internal
EOF
systemctl restart systemd-resolved
---
3. Install packages to enable joining the realm
---
DEBIAN_FRONTEND=noninteractive apt-get install -y \
krb5-user \
realmd \
sssd-tools
---
4. Configure domain to be the default realm in `/etc/krb5.conf`
---
/etc/krb5.conf
---
[libdefaults]
default_realm = SRU.INTERNAL
...
---
5. Open the gnome-control-center user settings with `gnome-control-
center system users`
6. Click `Add Enterprise Login` to open the Enterprise Login Dialog
7. Fill in the domain, user, and password for the user to add
-----
Domain: SRU.INTERNAL
User: TestUser
Password: TestPassword
-----
8. Click Add
Expected Behavior
-----------------
After a short delay, the dialog closes and the user is now added under 'Other
Users'
-----------------
Actual Behavior
----------------
A significant fraction of the time, the progress spinner just keeps going and
nothing happens.
----------------
[ Where problems could occur ]
* Because we are no longer regularly checking, the domain could become
invalid between entering the domain and clicking add, without feedback.
This would still be indicated by the add command failing.
[ Other Info ]
The issue is due to a race condition, which causes the add task to be
canceled before completing.
The enterprise dialog struct has a single field that it uses to track
task cancellation
---
panels/system/users/cc-enterprise-login-dialog.c:50
---
struct _CcEnterpriseLoginDialog
{
// <snip>
GCancellable *cancellable;
};
---
When the add button is clicked, a task is dispatched to permit login with the
specified user
which culminates in
---
panels/system/users/cc-enterprise-login-dialog.c:221
---
cc_realm_common_call_change_login_policy (common, "",
add, remove, options,
self->cancellable,
change_login_policy_cb,
g_object_ref (self));
---
Notice that this uses the `self->cancellable` field to track cancellation.
However, the callback to verify domain also uses this field
---
panels/system/users/cc-enterprise-login-dialog.c:560
---
static void
domain_validate (CcEnterpriseLoginDialog *self)
{
self->domain_timeout_id = 0;
/* This is needed to stop previous calls to avoid rewriting feedback. */
g_cancellable_cancel (self->cancellable);
g_object_unref (self->cancellable);
self->cancellable = g_cancellable_new ();
cc_realm_manager_discover (self->realm_manager,
gtk_editable_get_text (GTK_EDITABLE
(self->domain_row)),
self->cancellable,
realm_manager_discover_cb,
g_object_ref (self));
}
---
Importantly, this cancels the currently running task before spawning a
new one.
Now the big problem is that the domain entry changed callback registers
domain_validate to run every 600ms.
----
static void
on_domain_entry_changed_cb (CcEnterpriseLoginDialog *self)
{
// <snip>
// panels/system/users/cc-enterprise-login-dialog.c:596
self->domain_timeout_id = g_timeout_add (DOMAIN_CHECK_TIMEOUT,
(GSourceFunc)domain_validate, self);
}
--
The fix in this SRU, trivially backported from the upstream patch, is to
have domain_validate return G_REMOVE_SOURCE, so that it is not called
repeatedly.
[0]: https://ubuntu.com/server/docs/how-to/samba/provision-samba-ad-controller/
[1]: https://gitlab.gnome.org/GNOME/gnome-control-
center/-/commit/7a95adbff458a4fd53dd8acf598370172dee60ea
** Affects: gnome-control-center (Ubuntu)
Importance: Undecided
Status: New
** Affects: gnome-control-center (Ubuntu Noble)
Importance: Undecided
Assignee: Zachary Raines (raineszm)
Status: In Progress
** Also affects: gnome-control-center (Ubuntu Noble)
Importance: Undecided
Status: New
** Changed in: gnome-control-center (Ubuntu Noble)
Assignee: (unassigned) => Zachary Raines (raineszm)
** Changed in: gnome-control-center (Ubuntu Noble)
Status: New => In Progress
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2161027
Title:
[SRU] Add Enterprise Login dialog fails to complete
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/2161027/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs