You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.6 KiB
45 lines
1.6 KiB
From c637727c958286659e9905993fca276a63f6f6d5 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?D=C4=81vis?= <davispuh@gmail.com>
|
|
Date: Thu, 24 Sep 2015 02:52:46 +0300
|
|
Subject: [PATCH 11/11] Don't cast QByteArray to (char *)
|
|
|
|
They're obsolete members [1] and caused #489.
|
|
|
|
[1] http://doc.qt.io/qt-5/qbytearray-obsolete.html
|
|
---
|
|
CMakeLists.txt | 2 +-
|
|
src/helper/UserSession.cpp | 4 ++--
|
|
2 files changed, 3 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
index 0f10f92..c2192a0 100644
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -33,7 +33,7 @@ option(BUILD_MAN_PAGES "Build man pages" OFF)
|
|
option(ENABLE_JOURNALD "Enable logging to journald" ON)
|
|
|
|
# Definitions
|
|
-add_definitions(-Wall -std=c++11 -DQT_NO_CAST_FROM_ASCII)
|
|
+add_definitions(-Wall -std=c++11 -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_FROM_BYTEARRAY)
|
|
|
|
# Default build type
|
|
if(NOT CMAKE_BUILD_TYPE)
|
|
diff --git a/src/helper/UserSession.cpp b/src/helper/UserSession.cpp
|
|
index 68c87d1..0f3d7ff 100644
|
|
--- a/src/helper/UserSession.cpp
|
|
+++ b/src/helper/UserSession.cpp
|
|
@@ -110,8 +110,8 @@ namespace SDDM {
|
|
}
|
|
}
|
|
|
|
- const char *username = qobject_cast<HelperApp*>(parent())->user().toLocal8Bit();
|
|
- struct passwd *pw = getpwnam(username);
|
|
+ const QByteArray username = qobject_cast<HelperApp*>(parent())->user().toLocal8Bit();
|
|
+ struct passwd *pw = getpwnam(username.constData());
|
|
if (setgid(pw->pw_gid) != 0) {
|
|
qCritical() << "setgid(" << pw->pw_gid << ") failed for user: " << username;
|
|
exit(Auth::HELPER_OTHER_ERROR);
|
|
--
|
|
1.9.3
|
|
|