Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.0
sddm
0004-UserModel-fix-filtering-out-duplicate-user...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0004-UserModel-fix-filtering-out-duplicate-users-998.patch of Package sddm
From 126a722a4a36cb4cc6d17714ff4b18b6657493e4 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov <dmitry.torokhov@gmail.com> Date: Wed, 21 Mar 2018 14:24:39 -0700 Subject: [PATCH 4/6] UserModel: fix filtering out duplicate users (#998) std::unique() is "interesting": it modifies the container, rearranging elements in it, but does not reduce the size of the container, so there are invalid elements at the end that have to be erased explicitly. --- src/greeter/UserModel.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/greeter/UserModel.cpp b/src/greeter/UserModel.cpp index daf93c5..57f236d 100644 --- a/src/greeter/UserModel.cpp +++ b/src/greeter/UserModel.cpp @@ -102,7 +102,8 @@ namespace SDDM { std::sort(d->users.begin(), d->users.end(), [&](const UserPtr &u1, const UserPtr &u2) { return u1->name < u2->name; }); // Remove duplicates in case we have several sources specified // in nsswitch.conf(5). - std::unique(d->users.begin(), d->users.end(), [&](const UserPtr &u1, const UserPtr &u2) { return u1->name == u2->name; }); + auto newEnd = std::unique(d->users.begin(), d->users.end(), [&](const UserPtr &u1, const UserPtr &u2) { return u1->name == u2->name; }); + d->users.erase(newEnd, d->users.end()); bool avatarsEnabled = mainConfig.Theme.EnableAvatars.get(); if (avatarsEnabled && mainConfig.Theme.EnableAvatars.isDefault()) { -- 2.16.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor