Hello community,
here is the log from the commit of package kdebase4-workspace.1887 for openSUSE:12.2:Update checked in at 2013-08-02 14:08:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:12.2:Update/kdebase4-workspace.1887 (Old)
and /work/SRC/openSUSE:12.2:Update/.kdebase4-workspace.1887.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kdebase4-workspace.1887"
Changes:
--------
New Changes file:
--- /dev/null 2013-07-23 23:44:04.804033756 +0200
+++ /work/SRC/openSUSE:12.2:Update/.kdebase4-workspace.1887.new/kdebase4-workspace.changes 2013-08-02 14:08:35.000000000 +0200
@@ -0,0 +1,2111 @@
+-------------------------------------------------------------------
+Wed Jul 24 19:41:57 UTC 2013 - hrvoje.senjan@gmail.com
+
+- Added kdm-kcheckpass-Check-for-NULL-return-from-crypt-3-an.patch,
+ (bnc#829857, CVE-2013-4132)
+- Added fix-pixmap-leak.patch
+ (kde#314919, bnc#817932, bnc#829857, CVE-2013-4133)
+ Fixes plasma systemtray memory leak with legacy icons
+
+-------------------------------------------------------------------
+Mon Feb 11 19:19:52 UTC 2013 - wbauer@tmo.at
+
+- changed plasma-kickoff-newly-collapsing.diff:
+ * sort entries by genericName if "Show applications by name"
+ is switched off (bnc#803179)
+
+-------------------------------------------------------------------
+Thu Feb 7 19:00:15 UTC 2013 - wbauer@tmo.at
+
+- changed plasma-kickoff-newly-collapsing.diff:
+ * add ":F" to the sortOrder list if it isn't included to make sure
+ collapsed entries are really shown (bnc#356553)
+
+-------------------------------------------------------------------
+Thu Jan 31 12:07:28 UTC 2013 - wbauer@tmo.at
+
+- changed plasma-kickoff-newly-collapsing.diff:
+ * in config dialog: connect added options to settingsModified()
+ slot so that "Apply" button gets activated when they are changed
+ by the user (bnc#801416)
+
+-------------------------------------------------------------------
+Thu Jan 24 10:01:12 UTC 2013 - ctrippe@opensuse.org
+
+- changed plasma-kickoff-newly-collapsing.diff:
+ * display program icon instead of submenu icon when using reduced
+ menu depth (bnc#641916)
+
+-------------------------------------------------------------------
+Tue Jan 22 15:28:59 UTC 2013 - wbauer@tmo.at
+
+- changed plasma-kickoff-newly-collapsing.diff:
+ * don't set name to null if it is equal to genericName or
+ genericName is empty. Fixes bnc#725829
+
+-------------------------------------------------------------------
+Wed Oct 3 19:14:38 UTC 2012 - ctrippe@opensuse.org
+
+- Support Grub2 submenus with patch "support_grub2_submenus.diff"
+ (kde#297209, bnc#783288)
+
+-------------------------------------------------------------------
+Mon Jul 30 16:54:23 UTC 2012 - dmueller@suse.com
+
+- update to 4.8.5
+ * see http://kde.org/announcements/changelogs/changelog4_8_4to4_8_5.php for details
+- refresh patches
+
+-------------------------------------------------------------------
+Mon Jul 30 02:48:47 UTC 2012 - mlin@suse.com
+
+- Apply to upstream to fix deletion of preferred launchers (bnc#757370, kde#278724)
+
+-------------------------------------------------------------------
+Sun Jul 1 20:26:42 UTC 2012 - dap.darkness@gmail.com
+
+- plasma-calendar recommends akonadi-runtime instead of kde4_akonadi_requires
+- No supplement of packageand(akonadi-runtime:kdebase4-workspace)
+
+-------------------------------------------------------------------
+Fri Jun 1 13:55:46 UTC 2012 - dmueller@suse.com
+
+- update to 4.8.4
+ * see http://kde.org/announcements/changelogs/changelog4_8_3to4_8_4.php for details
+
+-------------------------------------------------------------------
+Tue May 1 10:33:34 UTC 2012 - anixx@opensuse.org
+
+- remove "obsoletes" and "provides" for kdebase3-ksysguardd as I completely
+ separated the two and removed the conflict: both KDE3 and KDE4 versions
+ can be installed in parallel now
+
+-------------------------------------------------------------------
+Sun Apr 29 20:53:09 UTC 2012 - dmueller@suse.com
+
+- update to 4.8.3
+ * see http://kde.org/announcements/changelogs/changelog4_8_2to4_8_3.php for details
+
+-------------------------------------------------------------------
+Sat Apr 14 14:08:12 UTC 2012 - dmueller@suse.com
+
+- remove dependency on google-gadgets
+
+-------------------------------------------------------------------
+Tue Apr 10 19:01:23 UTC 2012 - ctrippe@opensuse.org
+
+- Require desktop-data-openSUSE as this is needed for the KDE menu
+ (bnc#754104)
+
+-------------------------------------------------------------------
+Mon Apr 2 20:24:34 UTC 2012 - wstephenson@suse.com
+
+- Add patch for kde#297272 - KWin does not repaint window
+ shadow regions after closing window
+
+-------------------------------------------------------------------
+Sat Mar 31 20:47:22 UTC 2012 - ctrippe@opensuse.org
+
+- Change the entry for sysinfo in kickoff to "My Computer" to make
+ it consistent with the actual window (bnc#626886)
+
+-------------------------------------------------------------------
+Sat Mar 31 08:05:31 UTC 2012 - wstephenson@suse.com
+
+- Add xz to BuildRequires
+- Remove kdepimlibs4 requirement from base package because this has
+ now been moved into the subpackages that have a real requirement.
+
+-------------------------------------------------------------------
+Fri Mar 30 01:15:41 CEST 2012 - dmueller@suse.de
+
+- update to 4.8.2
+ * see http://kde.org/announcements/changelogs/changelog4_8_1to4_8_2.php for details
+
+-------------------------------------------------------------------
+Thu Mar 29 06:54:15 UTC 2012 - wstephenson@suse.com
+
+- Stop installing redundant Network Management backends
+
+-------------------------------------------------------------------
+Tue Mar 20 20:16:03 UTC 2012 - tittiatcoke@gmail.com
+
+- Added patch to support GRUB2
+- Added patch to resolve reboot/shutdown issue when using systemd
+ and KDM
+
+- Added patch to have initial support within kdebase4-workspace for
+ shutdown/reboot through systemd. Not yet Activated !!
+
+- Included patch from Rober Milasan to set the correct default
+ homepage for the openSUSE branding
+
+-------------------------------------------------------------------
+Fri Mar 2 23:16:32 CET 2012 - dmueller@suse.de
+
+- update to 4.8.1
+ * see http://kde.org/announcements/changelogs/changelog4_8_0to4_8_1.php for details
+
+-------------------------------------------------------------------
+Mon Feb 27 20:46:29 CET 2012 - dmueller@suse.de
+
+- require the right version of kactivities4 to avoid crashes
+
+-------------------------------------------------------------------
+Wed Jan 18 20:57:57 CET 2012 - dmueller@suse.de
+
+- update to 4.8.0
+ * first stable release of KDE 4.8 (only critical fixes over 4.7.98)
+ * see http://kde.org/announcements/4.8/ for details
+
+
+-------------------------------------------------------------------
+Tue Jan 10 16:32:48 CET 2012 - dmueller@suse.de
+
+- update to 4.7.98
+ * RC2+ milestone release of KDE 4.8
+ * see http://kde.org/announcements/4.8/ for details
+
+
+-------------------------------------------------------------------
+Mon Dec 12 09:59:29 UTC 2011 - saschpe@suse.de
+
+- Use supplements packageand instead of recommends
+- Added split provides
+
+-------------------------------------------------------------------
+Wed Dec 7 14:18:37 UTC 2011 - saschpe@suse.de
+
+
+- New subpackages plasma-engine-akonadi and plasma-calendar:
+ * Removed %kde4_akonadi_requires from base package, otherwise
+ half of KDE depends on akonadi-runtime.
+ * Both are recommended by base package
+
+-------------------------------------------------------------------
+Fri Dec 2 01:59:41 CET 2011 - dmueller@suse.de
+
+- update to 4.7.4
+ * see http://kde.org/announcements/changelogs/changelog4_7_3to4_7_4.php for details
+
+-------------------------------------------------------------------
+Mon Nov 28 13:08:32 UTC 2011 - idoenmez@suse.de
+
+- Fix duplicated files
+
+-------------------------------------------------------------------
+Sat Nov 26 18:44:48 UTC 2011 - ctrippe@opensuse.org
++++ 1914 more lines (skipped)
++++ between /dev/null
++++ and /work/SRC/openSUSE:12.2:Update/.kdebase4-workspace.1887.new/kdebase4-workspace.changes
New Changes file:
python-kdebase4.changes: same change
New:
----
4_7_BRANCH.diff
baselibs.conf
disable-python-support.diff
dont-install-solid-netbackends.diff
fix-pixmap-leak.patch
kde-workspace-4.8.5.tar.xz
kde4-migrate.diff
kdebase4-workspace-rpmlintrc
kdebase4-workspace.changes
kdebase4-workspace.spec
kdm
kdm-all-users-nopass.diff
kdm-audit-log.diff
kdm-cope-with-new-grub.diff
kdm-dont-grab-mouse.diff
kdm-fix-generic-greeter.diff
kdm-fix-labelcolors.diff
kdm-kcheckpass-Check-for-NULL-return-from-crypt-3-an.patch
kdm-kdmconf.diff
kdm-long-xserver-timeout.diff
kdm-make_it_cool.diff
kdm-relaxed-auth.diff
kdm-remove-duplicated-sessions.diff
kdm-suspend-hal.diff
kdm-sysconfig-values.diff
kdm-wordbreak.diff
kdm_plymouth.patch
kdm_systemd_shutdown.patch
kwin-cubecap.png
kwin-suse.diff
opensuse-homepage.diff
pam-translate.diff
plasma-branding-defaults-applets.diff
plasma-dashboard-leave.diff
plasma-disable-networkmanager.diff
plasma-fix-delete-preferred-launchers.diff
plasma-kickoff-newly-collapsing.diff
plasma-notifications-kill-timer.diff
plasma-panel-resize-hint.diff
pre_checkin.sh
python-kdebase4.changes
python-kdebase4.spec
rcksysguardd
rotate-wacom-pointers.diff
same-pam-generic-classic.diff
startkde.diff
support_grub2_submenus.diff
sysconfig.displaymanager-kdm
systemsettings-desktop.diff
systemsettings-root-kcm.diff
titlebar_decor.png
workspace_systemd_initial_support.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ kdebase4-workspace.spec ++++++
++++ 670 lines (skipped)
++++++ python-kdebase4.spec ++++++
#
# spec file for package python-kdebase4
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: python-kdebase4
Version: 4.8.5
Release: 0
Summary: Python bindings for KDE 4 desktop shell
License: GPL-2.0+
Group: System/GUI/KDE
Url: http://www.kde.org/
Source0: kde-workspace-%{version}.tar.xz
BuildRequires: ConsoleKit-devel
BuildRequires: NetworkManager-devel
BuildRequires: bluez-devel
BuildRequires: libdbusmenu-qt-devel
BuildRequires: libkactivities-devel
BuildRequires: libkde4-devel >= %{version}
BuildRequires: libkdepimlibs4-devel
BuildRequires: libknotificationitem-devel
BuildRequires: libpolkit-qt-devel
BuildRequires: libqimageblitz-devel
BuildRequires: libsmbclient-devel
BuildRequires: libusb-devel
BuildRequires: python-kde4-devel
BuildRequires: pkgconfig(libxklavier)
%if %suse_version < 1130
BuildRequires: xz
%endif
Requires: python-kde4 = %{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%py_requires
%description
Python bindings for Plasma, the KDE 4 desktop shell. These bindings
allow Plasmoids written in Python
%prep
%setup -q -n kde-workspace-%{version}
%build
%cmake_kde4 -d build
cd plasma/generic/scriptengines/python
%make_jobs
%install
cd build/plasma/generic/scriptengines/python
%make_install
%kde_post_install
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root)
%doc COPYING README
%{py_sitedir}/PyKDE4
%{_kde4_appsdir}/plasma_scriptengine_python
%{_kde4_servicesdir}/plasma-*.desktop
%changelog
++++++ 4_7_BRANCH.diff ++++++
--- a/a/BRANCH_STATUS
+++ b/b/BRANCH_STATUS
@@ -0,0 +1,2 @@
+current HEAD: 313e0c7ed3f574dfc38bb6dfe8d94a0a20e6c934
+git diff v4.7.2..origin/KDE/4.7
diff --git a/doc/plasma-desktop/index.docbook b/doc/plasma-desktop/index.docbook
index 697ed9b..21b458a 100644
++++++ baselibs.conf ++++++
kdebase4-workspace-liboxygenstyle
++++++ disable-python-support.diff ++++++
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt.orig
+++ CMakeLists.txt
@@ -92,7 +92,6 @@ if(PYQT4_FOUND AND PYQT4_VERSION STRLESS
endif(PYQT4_FOUND AND PYQT4_VERSION STRLESS "040400")
macro_optional_find_package(PyKDE4)
-set(PythonSupport_FOUND TRUE)
#### End Python support ####
++++++ dont-install-solid-netbackends.diff ++++++
Index: kde-workspace-4.8.1/solid/CMakeLists.txt
===================================================================
--- kde-workspace-4.8.1.orig/solid/CMakeLists.txt
+++ kde-workspace-4.8.1/solid/CMakeLists.txt
@@ -13,7 +13,7 @@ set(HAVE_NETWORKMANAGER FALSE)
if(NETWORKMANAGER_FOUND)
if(${NETWORKMANAGER_VERSION} VERSION_GREATER "0.6.9999" AND
${NETWORKMANAGER_VERSION} VERSION_LESS "0.8.1001")
- message(STATUS "Will build networkmanager-0.7")
+ #message(STATUS "Will build networkmanager-0.7")
set(HAVE_NETWORKMANAGER TRUE)
add_subdirectory(networkmanager-0.7)
else()
@@ -21,7 +21,7 @@ if(NETWORKMANAGER_FOUND)
if (${NETWORKMANAGER_VERSION} VERSION_GREATER "0.8.999")
message(STATUS "Will build networkmanager_fake-0.9")
set(HAVE_NETWORKMANAGER TRUE)
- add_subdirectory(networkmanager_fake-0.9)
+ #add_subdirectory(networkmanager_fake-0.9)
endif ()
endif()
endif (NETWORKMANAGER_FOUND)
@@ -31,9 +31,9 @@ set(HAVE_MODEMMANAGER FALSE)
if("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
message(STATUS "Will build modemmanager-0.4")
set(HAVE_MODEMMANAGER TRUE)
- add_subdirectory(modemmanager-0.4)
+ #add_subdirectory(modemmanager-0.4)
endif("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
if(NOT WIN32)
- macro_optional_add_subdirectory(wicd)
+ #macro_optional_add_subdirectory(wicd)
endif(NOT WIN32)
++++++ fix-pixmap-leak.patch ++++++
commit ec8e405ca447ba5bc5a9f6a2a12e2fa90412a0d4
Author: Andreas Hartmetz
Date: Tue Jul 2 18:35:35 2013 +0200
Fix pixmap leak when the tray icon changes (e.g. when it's animated).
This could easily leak 4KB/second of X pixmap memory.
All the actual difference comes from the QPixmap::ExplicitlyShared
argument, the rest is making some wonky-looking but working code look
less wonky.
BUG: 314919
diff --git a/plasma/generic/applets/systemtray/protocols/fdo/x11embedcontainer.cpp b/plasma/generic/applets/systemtray/protocols/fdo/x11embedcontainer.cpp
index 1826512..a5bc826 100644
--- a/plasma/generic/applets/systemtray/protocols/fdo/x11embedcontainer.cpp
+++ b/plasma/generic/applets/systemtray/protocols/fdo/x11embedcontainer.cpp
@@ -194,8 +194,7 @@ void X11EmbedContainer::paintEvent(QPaintEvent *event)
// Taking a detour via a QPixmap is unfortunately the only way we can get
// the window contents into Qt's backing store.
- QPixmap pixmap(size());
- pixmap = toX11Pixmap(pixmap);
+ QPixmap pixmap = toX11Pixmap(QPixmap(size()));
pixmap.fill(Qt::transparent);
XRenderComposite(x11Info().display(), PictOpSrc, d->picture, None, pixmap.x11PictureHandle(),
0, 0, 0, 0, 0, 0, width(), height());
@@ -232,16 +231,18 @@ void X11EmbedContainer::setBackgroundPixmap(QPixmap background)
// NOTE: The alpha-channel is not preserved if it exists, but for X pixmaps it generally should not be needed anyway.
QPixmap X11EmbedContainer::toX11Pixmap(const QPixmap& pix)
{
- if(pix.handle() != 0) // X11 pixmap
+ if (pix.handle() != 0) // X11 pixmap
return pix;
+ QPixmap ret;
Pixmap xpix = XCreatePixmap(pix.x11Info().display(), RootWindow(pix.x11Info().display(), pix.x11Info().screen()),
pix.width(), pix.height(), QX11Info::appDepth());
- QPixmap wrk = QPixmap::fromX11Pixmap(xpix);
- QPainter paint(&wrk);
- paint.drawPixmap(0, 0, pix);
- paint.end();
- QPixmap ret = wrk.copy();
- wrk = QPixmap(); // reset, so that xpix can be freed (QPixmap does not own it)
+ {
+ QPixmap wrk = QPixmap::fromX11Pixmap(xpix, QPixmap::ExplicitlyShared);
+ QPainter paint(&wrk);
+ paint.drawPixmap(0, 0, pix);
+ paint.end();
+ ret = wrk.copy();
+ } // free resources so that xpix can be freed (QPixmap does not own it)
XFreePixmap(pix.x11Info().display(), xpix);
return ret;
}
++++++ kde4-migrate.diff ++++++
Index: startkde.cmake
===================================================================
--- startkde.cmake.orig
+++ startkde.cmake
@@ -64,6 +64,11 @@ fi
kdehome=$HOME/@KDE_DEFAULT_HOME@
test -n "$KDEHOME" && kdehome=`echo "$KDEHOME"|sed "s,^~/,$HOME/,"`
+# first, migrate settings from kde3, if available
+if test -x /usr/bin/kde4-migrate; then
+ /usr/bin/kde4-migrate || true
+fi
+
# see kstartupconfig source for usage
mkdir -m 700 -p $kdehome
mkdir -m 700 -p $kdehome/share
++++++ kdebase4-workspace-rpmlintrc ++++++
addFilter("untranslated-desktop-file .*/usr/share/wallpapers/.*")
++++++ kdm ++++++
kdm_start_proc() {
splashcopy 0 6
return 0
}
kdm_vars() {
KDM4_BIN=/usr/bin/kdm
KDM_BIN=/opt/kde3/bin/kdm
case "${DISPLAYMANAGER##*/}" in
kdm3)
export KDEROOTHOME=/root/.kdm
DISPLAYMANAGER=$KDM_BIN
STARTPROC=kdm_start_proc
;;
kdm|kde|KDM|KDE)
export KDEROOTHOME=/root/.kdm
DISPLAYMANAGER=$KDM_BIN
if [ ! -r "$DISPLAYMANAGER" ]; then
DISPLAYMANAGER=$KDM4_BIN
fi
STARTPROC=kdm_start_proc
;;
kdm4)
export KDEROOTHOME=/root/.kdm
DISPLAYMANAGER=$KDM4_BIN
STARTPROC=kdm_start_proc
;;
*) return 1 ;;
esac
return 0
}
++++++ kdm-all-users-nopass.diff ++++++
Index: kdm/backend/client.c
===================================================================
--- kdm/backend/client.c.orig
+++ kdm/backend/client.c
@@ -462,6 +462,9 @@ isNoPassAllowed(struct passwd *pw)
if (cursource != PWSRC_MANUAL)
return True;
+ if (td->noPassAllUsers)
+ return True;
+
#if defined(USE_PAM) || defined(_AIX)
/* Give nss_ldap, etc. a chance to normalize (uppercase) the name. */
if (!(pw = getpwnam(un)) ||
Index: kdm/config.def
===================================================================
--- kdm/config.def.orig
+++ kdm/config.def
@@ -1895,6 +1895,15 @@ Description:
(and any other user with UID = 0).
<emphasis>Never</emphasis> list <systemitem class="username">root</systemitem>.
+Key: NoPassAllUsers
+Type: bool
+Default: false
+User: core
+Instance: #:0/true
+Comment: &
+Description:
+ All users can login without password
+
Key: AutoLoginEnable
Type: bool
Default: false
++++++ kdm-audit-log.diff ++++++
Index: cmake/modules/FindAudit.cmake
===================================================================
--- /dev/null
+++ cmake/modules/FindAudit.cmake
@@ -0,0 +1,12 @@
+FIND_LIBRARY(AUDIT_LIBRARIES NAMES audit)
+FIND_PATH(AUDIT_INCLUDE_DIR libaudit.h)
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Audit DEFAULT_MSG AUDIT_INCLUDE_DIR AUDIT_LIBRARIES )
+MACRO_LOG_FEATURE(AUDIT_FOUND "audit" "Audit Logging for kdm" "http://people.redhat.com/sgrubb/audit/" FALSE)
+
+MARK_AS_ADVANCED(AUDIT_INCLUDE_DIR AUDIT_LIBRARIES)
+
+if ( AUDIT_LIBRARIES AND AUDIT_INCLUDE_DIR )
+ set(HAVE_LIBAUDIT 1)
+endif ( AUDIT_LIBRARIES AND AUDIT_INCLUDE_DIR )
Index: kdm/backend/client.c
===================================================================
--- kdm/backend/client.c.orig
+++ kdm/backend/client.c
@@ -88,6 +88,14 @@ extern int loginsuccess( const char *Use
#endif
#include
+#define AU_FAILED 0
+#define AU_SUCCESS 1
+#ifdef HAVE_LIBAUDIT
+#include
+#else
+#define log_to_audit_system(l,h,d,s) do { ; } while (0)
+#endif
+
/*
* Session data, mostly what struct verify_info was for
*/
@@ -337,6 +345,56 @@ getPAMXauthData( const char *xauth_file
}
# endif
+ /**
+ * log_to_audit_system:
+ * @login: Name of user
+ * @hostname: Name of host machine
+ * @tty: Name of display
+ * @success: 1 for success, 0 for failure
+ *
+ * Logs the success or failure of the login attempt with the linux kernel
+ * audit system. The intent is to capture failed events where the user
+ * fails authentication or otherwise is not permitted to login. There are
+ * many other places where pam could potentially fail and cause login to
+ * fail, but these are system failures rather than the signs of an account
+ * being hacked.
+ *
+ * Returns nothing.
+ */
+
+#ifdef HAVE_LIBAUDIT
+static void
+log_to_audit_system (const char *loginname,
+ const char *hostname,
+ const char *tty,
+ int success)
+{
+ struct passwd *pw;
+ char buf[64];
+ int audit_fd;
+
+ audit_fd = audit_open();
+ if (loginname)
+ pw = getpwnam(loginname);
+ else {
+ loginname = "unknown";
+ pw = NULL;
+ }
+ Debug("log_to_audit %p %s\n", pw, loginname);
+
+ if (pw) {
+ snprintf(buf, sizeof(buf), "uid=%d", pw->pw_uid);
+ audit_log_user_message(audit_fd, AUDIT_USER_LOGIN,
+ buf, hostname, NULL, tty, (int)success);
+ } else {
+ snprintf(buf, sizeof(buf), "acct=%s", loginname);
+ audit_log_user_message(audit_fd, AUDIT_USER_LOGIN,
+ buf, hostname, NULL, tty, (int)success);
+ }
+ close(audit_fd);
+}
+#endif
+
static int
doPAMAuth( const char *psrv, struct pam_data *pdata )
{
@@ -422,6 +480,8 @@ doPAMAuth( const char *psrv, struct pam_
gSendStr( curuser );
}
if (pretc != PAM_SUCCESS) {
+ /* Log the failed login attempt */
+ log_to_audit_system (curuser, td->remoteHost, td->name, AU_FAILED);
switch (pretc) {
case PAM_USER_UNKNOWN:
case PAM_AUTH_ERR:
@@ -765,6 +825,8 @@ verify( GConvFunc gconv, int rootok )
if (!p->pw_uid) {
if (!rootok && !td->allowRootLogin)
V_RET_FAIL( "Root logins are not allowed" );
+ /* Log the failed login attempt */
+ log_to_audit_system (curuser, td->remoteHost, td->name, AU_FAILED);
wipeStr( curpass );
curpass = 0;
return True; /* don't deny root to log in */
@@ -805,6 +867,8 @@ verify( GConvFunc gconv, int rootok )
}
if (pretc == PAM_SUCCESS)
break;
+ /* Log the failed login attempt */
+ log_to_audit_system (curuser, td->remoteHost, td->name, AU_FAILED);
/* effectively there is only PAM_AUTHTOK_ERR */
gSendInt( V_FAIL );
}
@@ -891,6 +955,8 @@ verify( GConvFunc gconv, int rootok )
displayStr( V_MSG_ERR,
"Your account has expired;"
" please contact your system administrator" );
+ /* Log the failed login attempt */
+ log_to_audit_system (curuser, td->remoteHost, td->name, AU_FAILED);
gSendInt( V_FAIL );
LC_RET0;
} else if (tim > (expir - warntime) && !quietlog) {
@@ -917,6 +983,8 @@ verify( GConvFunc gconv, int rootok )
displayStr( V_MSG_ERR,
"Your account has expired;"
" please contact your system administrator" );
+ /* Log the failed login attempt */
+ log_to_audit_system (curuser, td->remoteHost, td->name, AU_FAILED);
gSendInt( V_FAIL );
LC_RET0;
}
@@ -968,6 +1036,8 @@ verify( GConvFunc gconv, int rootok )
}
displayStr( V_MSG_ERR,
"Logins are not allowed at the moment.\nTry again later" );
+ /* Log the failed login attempt */
+ log_to_audit_system (curuser, td->remoteHost, td->name, AU_FAILED);
gSendInt( V_FAIL );
LC_RET0;
}
@@ -977,6 +1047,8 @@ verify( GConvFunc gconv, int rootok )
if (!auth_timeok( lc, time( 0 ) )) {
displayStr( V_MSG_ERR,
"You are not allowed to login at the moment" );
+ /* Log the failed login attempt */
+ log_to_audit_system (curuser, td->remoteHost, td->name, AU_FAILED);
gSendInt( V_FAIL );
LC_RET0;
}
@@ -988,6 +1060,8 @@ verify( GConvFunc gconv, int rootok )
debug( "shell not in /etc/shells\n" );
endusershell();
V_RET_FAIL( "Your login shell is not listed in /etc/shells" );
+ /* Log the failed login attempt */
+ log_to_audit_system (curuser, td->remoteHost, td->name, AU_FAILED);
}
if (!strcmp( s, p->pw_shell )) {
endusershell();
@@ -1514,6 +1588,9 @@ startClient( volatile int *pid )
# define D_LOGIN_SETGROUP 0
#endif /* USE_PAM */
+ /* Login succeeded */
+ log_to_audit_system (curuser, td->remoteHost, td->name, AU_SUCCESS);
+
removeAuth = True;
chownCtrl( &td->ctrl, curuid );
ctltalk.pipe = &ctlpipe;
Index: kdm/ConfigureChecks.cmake
===================================================================
--- kdm/ConfigureChecks.cmake.orig
+++ kdm/ConfigureChecks.cmake
@@ -231,4 +231,6 @@ if (NOT LIBEXEC_INSTALL_DIR STREQUAL "${
endif (NOT inip)
endif (NOT LIBEXEC_INSTALL_DIR STREQUAL "${BIN_INSTALL_DIR}")
+find_package(Audit)
+
configure_file(config-kdm.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kdm.h)
++++++ kdm-cope-with-new-grub.diff ++++++
Index: kdm/backend/bootman.c
===================================================================
--- kdm/backend/bootman.c.orig
+++ kdm/backend/bootman.c
@@ -134,31 +134,10 @@ setGrub(const char *opt, SdRec *sdr)
static void
commitGrub(void)
{
- if (sdRec.bmstamp != mTime(GRUB_MENU) &&
- setGrub(sdRec.osname, &sdRec) != BO_OK)
- return;
+ char buffer[PATH_MAX];
- if (grubSetDefault) {
- /* The grub-set-default command must be used, which is
- * not so good because there is no way of setting an
- * entry for the next boot only. */
- char index[16];
- const char *args[] = { grubSetDefault, index, 0 };
- sprintf(index, "%d", sdRec.osindex);
- runAndWait((char **)args, environ);
- } else {
- /* The grub shell can be used with `savedefault'.
- * That requires a (widely distributed) patch to grub, e.g.
- * grub-0.97-once.patch. It won't work with a vanilla grub.*/
- FILE *f;
- int pid;
- static const char *args[] = { 0, "--batch", "--no-floppy", 0 };
- args[0] = grub;
- if ((f = pOpen((char **)args, 'w', &pid))) {
- fprintf(f, "savedefault --default=%d --once\n", sdRec.osindex);
- pClose(f, &pid);
- }
- }
+ snprintf(buffer, PATH_MAX, "/usr/sbin/grubonce %d", sdRec.osindex);
+ system(buffer);
}
static char *grubReboot;
++++++ kdm-dont-grab-mouse.diff ++++++
Index: kdm/kfrontend/kdm_greet.c
===================================================================
--- kdm/kfrontend/kdm_greet.c.orig 2010-07-06 08:54:31.000000000 +0200
+++ kdm/kfrontend/kdm_greet.c 2010-11-21 20:47:03.694718280 +0100
@@ -458,7 +458,6 @@ secureInputs(Display *dpy)
{
debug("secureInputs %s\n", dname);
secureKeyboard(dpy);
- securePointer(dpy);
XSetInputFocus(dpy, None, None, CurrentTime);
debug("secureInputs %s done\n", dname);
}
@@ -469,7 +468,6 @@ unsecureInputs(Display *dpy)
debug("unsecureInputs %s\n", dname);
XSetInputFocus(dpy, PointerRoot, PointerRoot, CurrentTime);
XUngrabKeyboard(dpy, CurrentTime);
- XUngrabPointer(dpy, CurrentTime);
XSync(dpy, False);
}
++++++ kdm-fix-generic-greeter.diff ++++++
Index: kdm/kfrontend/kgreeter.cpp
===================================================================
--- kdm/kfrontend/kgreeter.cpp.orig
+++ kdm/kfrontend/kgreeter.cpp
@@ -976,8 +976,6 @@ KThemedGreeter::KThemedGreeter(KdmThemer
timed_label = themer->findNode("timed-label");
KdmItem *itm;
- if ((itm = themer->findNode("pam-message"))) // done via msgboxes
- itm->setVisible(false);
if ((itm = themer->findNode("language_button"))) // not implemented yet
itm->setVisible(false);
Index: kdm/kfrontend/themes/greeter.dtd
===================================================================
--- kdm/kfrontend/themes/greeter.dtd.orig
+++ kdm/kfrontend/themes/greeter.dtd
@@ -19,9 +19,9 @@ Items with these IDs get special treatme
caps-lock-warning | xauth-warning | pam-error | timed-label |
login_button | session_button | system_button
Items with these IDs might get special treatment by conversation plugins:
- talker | domain-entry | user-entry | pw-entry
+ talker | domain-entry | user-entry | pw-entry | pam-message | pam-prompt | user-pw-entry
Items with these IDs are always hidden:
- pam-message | language_button
+ language_button
-->
<!ATTLIST item
Index: kdm/kfrontend/themes/oxygen-air/oxygen-air.xml
===================================================================
--- kdm/kfrontend/themes/oxygen-air/oxygen-air.xml.orig
+++ kdm/kfrontend/themes/oxygen-air/oxygen-air.xml
@@ -26,7 +26,7 @@
<stock type="welcome-label"/>
</item>
- <item type="rect" id="user-field">
+ <item type="rect" id="talker">
<pos anchor="c" x="50%" y="43%" width="400" height="144"/>
<box orientation="vertical" spacing="0" homogeneous="true">
@@ -34,6 +34,7 @@
<pos anchor="c" x="50%" y="60%" height="box" width="box"/>
<box orientation="horizontal" spacing="10">
<item type="pixmap">
+ <show type="!plugin-specific-generic"/>
<normal file="user-entry.png"/>
</item>
<item type="entry" id="user-entry">
@@ -47,12 +48,31 @@
<pos anchor="c" x="50%" y="40%" height="box" width="box"/>
<box orientation="horizontal" spacing="10">
<item type="pixmap">
+ <show type="!plugin-specific-generic"/>
<normal file="pw-entry.png"/>
</item>
<item type="entry" id="pw-entry">
+ <show type="!plugin-specific-generic"/>
<pos width="157" height="30"/>
<style frame="true"/>
</item>
+ <!-- these need repositioning for KDE 4.6 -->
+ <item type="label" id="pam-message">
+ <show type="plugin-specific-generic"/>
+ <pos anchor="n" x="50%" y="60%" width="90%" height="30%"/>
+ <text> </text>
+ </item>
+
+ <item type="label" id="pam-prompt">
+ <show type="plugin-specific-generic"/>
+ <pos anchor="n" x="50%" y="30%" width="90%" height="22"/>
+ <text> </text>
+ </item>
+
+ <item type="entry" id="user-pw-entry">
+ <show type="plugin-specific-generic"/>
+ <pos anchor="c" x="50%" y="30%" width="90%" height="22"/>
+ </item>
</box>
</item>
Index: libs/kdm/kgreet_generic.cpp
===================================================================
--- libs/kdm/kgreet_generic.cpp.orig
+++ libs/kdm/kgreet_generic.cpp
@@ -41,24 +41,14 @@ extern KDE_EXPORT KGreeterPluginInfo kgr
static int echoMode;
-class KDMPasswordEdit : public KLineEdit {
-public:
- KDMPasswordEdit(QWidget *parent = 0) : KLineEdit(parent)
- {
- if (::echoMode == -1)
- setPasswordMode(true);
- else
- setEchoMode(::echoMode ? Password : NoEcho);
- setContextMenuPolicy(Qt::NoContextMenu);
- }
-};
-
KGenericGreeter::KGenericGreeter(KGreeterPluginHandler *_handler,
QWidget *parent,
const QString &_fixedEntity,
Function _func, Context _ctx) :
QObject(),
KGreeterPlugin(_handler),
+ m_label( 0 ),
+ m_messageLabel( 0 ),
m_lineEdit(0),
fixedUser(_fixedEntity),
func(_func),
@@ -66,22 +56,56 @@ KGenericGreeter::KGenericGreeter(KGreete
exp(-1),
running(false)
{
- m_parentWidget = new QWidget(parent);
- m_parentWidget->setObjectName("talker");
- // XXX set some minimal size
- widgetList << m_parentWidget;
- m_grid = new QGridLayout(m_parentWidget);
- m_grid->setMargin(0);
+ QGridLayout *grid = 0;
+ if (!_handler->gplugHasNode( "pam-prompt" ) ||
+ !_handler->gplugHasNode( "user-pw-entry" ) ||
+ !_handler->gplugHasNode( "pam-message" )) {
+ parent = new QWidget( parent );
+ parent->setObjectName( "talker" );
+ widgetList << parent;
+ grid = new QGridLayout( parent );
+ grid->setMargin( 0 );
+ }
if (ctx == ExUnlock || ctx == ExChangeTok)
fixedUser = KUser().loginName();
+
+ m_label = new QLabel( parent );
+ if( grid ) {
+ m_label->setMinimumWidth(
+ m_label->fontMetrics().width( "A username" ) );
+ grid->addWidget( m_label, 0, 0 );
+ } else {
+ m_label->setObjectName( "pam-prompt" );
+ widgetList << m_label;
+
+ m_lineEdit = new KLineEdit( parent );
+ m_label->setBuddy( m_lineEdit );
+ if( grid ) {
+ m_lineEdit->setMinimumWidth(
+ m_lineEdit->fontMetrics().width( "This is a long password" ) );
+ grid->addWidget( m_lineEdit, 0, 1 );
+ } else {
+ m_lineEdit->setObjectName( "user-pw-entry" );
+ widgetList << m_lineEdit;
+ }
+ m_messageLabel = new QLabel( parent );
+ if( grid ) {
+ m_messageLabel->setMinimumWidth(
+ m_messageLabel->fontMetrics().width( "Information text" ) );
+ grid->addWidget( m_messageLabel, 1, 0 );
+ } else {
+ m_messageLabel->setObjectName( "pam-message" );
+ widgetList << m_messageLabel;
+ }
+ }
}
// virtual
KGenericGreeter::~KGenericGreeter()
{
abort();
- delete m_parentWidget;
+ qDeleteAll( widgetList );
}
void // virtual
@@ -127,8 +151,7 @@ KGenericGreeter::setEnabled(bool enable)
{
// assert(func == Authenticate && ctx == Shutdown);
// XXX this is likely to bear some bogosity
- foreach (QWidget *w, m_children)
- w->setEnabled(enable);
+ m_lineEdit->setEnabled( enable );
if (enable && m_lineEdit)
m_lineEdit->setFocus();
}
@@ -143,9 +166,7 @@ KGenericGreeter::textMessage(const char
revive();
QString qtext = QString::fromUtf8(text);
m_infoMsgs.append(qtext);
- QLabel *label = new QLabel(qtext, m_parentWidget);
- m_grid->addWidget(label, m_line++, 0, 1, 2);
- m_children.append(label);
+ m_messageLabel->setText( m_infoMsgs.join( "\n" ));
return true;
}
@@ -169,15 +190,20 @@ KGenericGreeter::textPrompt(const char *
revive();
else
m_infoMsgs.clear();
-
- QLabel *label = new QLabel(QString::fromUtf8(prompt).trimmed());
- m_grid->addWidget(label, m_line, 0);
- m_children.append(label);
+ m_children.append(m_label);
m_echo = echo;
+
+ m_label->setText( QString::fromUtf8( prompt ).trimmed());
+ m_lineEdit->setContextMenuPolicy( Qt::NoContextMenu );
+ m_lineEdit->setCompletionObject( 0 );
+ m_lineEdit->disconnect( this );
+ m_lineEdit->clear();
+ m_lineEdit->setPasswordMode( false );
+ m_lineEdit->setEchoMode( QLineEdit::Normal );
if (echo) {
- m_lineEdit = new KLineEdit;
- m_lineEdit->setContextMenuPolicy(Qt::NoContextMenu);
if (!exp) {
+ if (m_label->text().isEmpty())
+ m_label->setText( i18n("&Username:"));
if (!m_users.isEmpty()) {
KCompletion *userNamesCompletion = new KCompletion;
userNamesCompletion->setItems(m_users);
@@ -188,20 +214,18 @@ KGenericGreeter::textPrompt(const char *
if (!curUser.isEmpty()) {
m_lineEdit->setText(curUser);
m_lineEdit->selectAll();
- connect(m_lineEdit, SIGNAL(selectionChanged()), SLOT(slotChanged()));
}
connect(m_lineEdit, SIGNAL(editingFinished()), SLOT(slotLoginLostFocus()));
}
connect(m_lineEdit, SIGNAL(editingFinished()), SLOT(slotChanged()));
connect(m_lineEdit, SIGNAL(textChanged(QString)), SLOT(slotChanged()));
} else {
- m_lineEdit = new KDMPasswordEdit;
+ if (::echoMode == -1)
+ m_lineEdit->setPasswordMode( true );
+ else
+ m_lineEdit->setEchoMode( ::echoMode ? QLineEdit::Password : QLineEdit::NoEcho );
+ connect( m_lineEdit, SIGNAL(editingFinished()), SLOT(slotChanged()) );
}
- m_lineEdit->setMinimumWidth(
- m_lineEdit->fontMetrics().width("This is a long password"));
- m_grid->addWidget(m_lineEdit, m_line, 1);
- m_children.append(m_lineEdit);
- m_lineEdit->show();
m_lineEdit->setFocus();
}
@@ -236,7 +260,6 @@ KGenericGreeter::next()
if (m_lineEdit) {
m_lineEdit->setEnabled(false);
QString text = m_lineEdit->text();
- m_lineEdit = 0;
handler->gplugReturnText(text.toLocal8Bit(),
!m_echo ?
KGreeterPluginHandler::IsSecret :
@@ -273,8 +296,7 @@ KGenericGreeter::failed()
revive();
handler->gplugMsgBox(QMessageBox::Information, text);
} else {
- foreach (QWidget *w, m_children)
- w->setEnabled(false);
+ m_lineEdit->setEnabled( false );
}
exp = -1;
running = false;
@@ -284,12 +306,9 @@ void // virtual
KGenericGreeter::revive()
{
// assert(!running);
- foreach (QWidget *w, m_children)
- w->deleteLater();
- m_children.clear();
m_infoMsgs.clear();
- m_lineEdit = 0;
- m_line = 0;
+ m_lineEdit->clear();
+ m_lineEdit->setEnabled( true );
}
void // virtual
Index: libs/kdm/kgreet_generic.h
===================================================================
--- libs/kdm/kgreet_generic.h.orig
+++ libs/kdm/kgreet_generic.h
@@ -33,7 +33,6 @@ Foundation, Inc., 51 Franklin Street, Fi
#include <QObject>
-class QGridLayout;
class QWidget;
class KLineEdit;
@@ -68,11 +67,11 @@ class KGenericGreeter : public QObject,
void slotChanged();
private:
- QGridLayout *m_grid;
QList m_children;
+ QLabel *m_label;
+ QLabel *m_messageLabel;
KLineEdit *m_lineEdit;
- QWidget *m_parentWidget;
- QList<QString> m_infoMsgs;
+ QStringList m_infoMsgs;
QString fixedUser, curUser;
QStringList m_users;
Function func;
++++++ kdm-fix-labelcolors.diff ++++++
Subject: Fix broken KDM layout with fingerprint support
From: Lubos Lunak
Patch-upstream: yes
Bug: bnc#533189
Relates: kdm-fix-generic-greeter.diff, same-pam-generic-classic.diff
Index: kde-workspace-4.8.5/kdm/kfrontend/themer/kdmlabel.h
===================================================================
--- kde-workspace-4.8.5.orig/kdm/kfrontend/themer/kdmlabel.h
+++ kde-workspace-4.8.5/kdm/kfrontend/themer/kdmlabel.h
@@ -61,6 +61,8 @@ protected:
virtual void doPlugActions(bool plug);
+ virtual void updatePalette( QWidget *w );
+
virtual void setWidget(QWidget *widget);
struct LabelStruct {
Index: kde-workspace-4.8.5/kdm/kfrontend/themer/kdmitem.h
===================================================================
--- kde-workspace-4.8.5.orig/kdm/kfrontend/themer/kdmitem.h
+++ kde-workspace-4.8.5/kdm/kfrontend/themer/kdmitem.h
@@ -199,7 +199,7 @@ protected:
bool eventFilter(QObject *o, QEvent *e);
void setWidgetAttribs(QWidget *);
- void updatePalette(QWidget *w);
+ virtual void updatePalette(QWidget *w);
void updateThisVisible();
Index: kde-workspace-4.8.5/kdm/kfrontend/themer/kdmlabel.cpp
===================================================================
--- kde-workspace-4.8.5.orig/kdm/kfrontend/themer/kdmlabel.cpp
+++ kde-workspace-4.8.5/kdm/kfrontend/themer/kdmlabel.cpp
@@ -221,6 +221,8 @@ KdmLabel::statusChanged(bool descend)
if ((state == Sprelight && !label.prelight.present) ||
(state == Sactive && !label.active.present))
return;
+ if( myWidget )
+ updatePalette( myWidget );
updateWidgetAttribs();
needUpdate();
}
@@ -362,4 +364,19 @@ KdmLabel::updateWidgetAttribs()
myWidget->setPalette(p);
}
+void
+KdmLabel::updatePalette( QWidget *w )
+{
+ struct LabelStruct::LabelClass *l = &label.normal;
+ if (state == Sactive && label.active.present)
+ l = &label.active;
+ else if (state == Sprelight && label.prelight.present)
+ l = &label.prelight;
+ w->setFont( l->font.font );
+ QPalette p = w->palette();
+ p.setColor( QPalette::WindowText, l->color );
+ w->setPalette( p );
+ KdmItem::updatePalette( w );
+}
+
#include "kdmlabel.moc"
++++++ kdm-kcheckpass-Check-for-NULL-return-from-crypt-3-an.patch ++++++
From 45b7f137fbc0b942fd2c9b4e8d8c1f0293e64ba7 Mon Sep 17 00:00:00 2001
From: Michael Pyne
Date: Sat, 29 Jun 2013 16:13:20 -0400
Subject: [PATCH 02/10] kdm, kcheckpass: Check for NULL return from crypt(3)
and friends.
Potential issue noted and fixed by Mancha .
Patch reviewed by myself and ossi. Backported to 4.10 by myself.
REVIEW:111261
FIXED-IN:4.10.5
---
kcheckpass/checkpass_etcpasswd.c | 3 ++-
kcheckpass/checkpass_osfc2passwd.c | 3 ++-
kcheckpass/checkpass_shadow.c | 2 +-
kdm/backend/client.c | 7 +++++--
4 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/kcheckpass/checkpass_etcpasswd.c b/kcheckpass/checkpass_etcpasswd.c
index 1dbe06f..e261b7c 100644
--- a/kcheckpass/checkpass_etcpasswd.c
+++ b/kcheckpass/checkpass_etcpasswd.c
@@ -35,6 +35,7 @@ AuthReturn Authenticate(const char *method,
{
struct passwd *pw;
char *passwd;
+ char *crpt_passwd;
if (strcmp(method, "classic"))
return AuthError;
@@ -49,7 +50,7 @@ AuthReturn Authenticate(const char *method,
if (!(passwd = conv(ConvGetHidden, 0)))
return AuthAbort;
- if (!strcmp(pw->pw_passwd, crypt(passwd, pw->pw_passwd))) {
+ if ((crpt_passwd = crypt(passwd, pw->pw_passwd)) && !strcmp(pw->pw_passwd, crpt_passwd)) {
dispose(passwd);
return AuthOk; /* Success */
}
diff --git a/kcheckpass/checkpass_osfc2passwd.c b/kcheckpass/checkpass_osfc2passwd.c
index 9a074f9..d181233 100644
--- a/kcheckpass/checkpass_osfc2passwd.c
+++ b/kcheckpass/checkpass_osfc2passwd.c
@@ -38,6 +38,7 @@ AuthReturn Authenticate(const char *method,
const char *login, char *(*conv) (ConvRequest, const char *))
{
char *passwd;
+ char *crpt_passwd;
char c2passwd[256];
if (strcmp(method, "classic"))
@@ -52,7 +53,7 @@ AuthReturn Authenticate(const char *method,
if (!(passwd = conv(ConvGetHidden, 0)))
return AuthAbort;
- if (!strcmp(c2passwd, osf1c2crypt(passwd, c2passwd))) {
+ if ((crpt_passwd = osf1c2crypt(passwd, c2passwd)) && !strcmp(c2passwd, crpt_passwd)) {
dispose(passwd);
return AuthOk; /* Success */
}
diff --git a/kcheckpass/checkpass_shadow.c b/kcheckpass/checkpass_shadow.c
index ec3a4e0..c0f6913 100644
--- a/kcheckpass/checkpass_shadow.c
+++ b/kcheckpass/checkpass_shadow.c
@@ -69,7 +69,7 @@ AuthReturn Authenticate(const char *method,
crpt_passwd = crypt(typed_in_password, password);
#endif
- if (!strcmp(password, crpt_passwd )) {
+ if (crpt_passwd && !strcmp(password, crpt_passwd )) {
dispose(typed_in_password);
return AuthOk; /* Success */
}
diff --git a/kdm/backend/client.c b/kdm/backend/client.c
index bdff6da..26bb0b4 100644
--- a/kdm/backend/client.c
+++ b/kdm/backend/client.c
@@ -540,6 +540,9 @@ verify(GConvFunc gconv, int rootok)
# if defined(HAVE_STRUCT_PASSWD_PW_EXPIRE) || defined(USESHADOW)
int tim, expir, warntime, quietlog;
# endif
+# if !defined(ultrix) && !defined(__ultrix__) && (defined(HAVE_PW_ENCRYPT) || defined(HAVE_CRYPT))
+ char *crpt_passwd;
+# endif
#endif
debug("verify ...\n");
@@ -752,9 +755,9 @@ verify(GConvFunc gconv, int rootok)
# if defined(ultrix) || defined(__ultrix__)
if (authenticate_user(p, curpass, 0) < 0)
# elif defined(HAVE_PW_ENCRYPT)
- if (strcmp(pw_encrypt(curpass, p->pw_passwd), p->pw_passwd))
+ if (!(crpt_passwd = pw_encrypt(curpass, p->pw_passwd)) || strcmp(crpt_passwd, p->pw_passwd))
# elif defined(HAVE_CRYPT)
- if (strcmp(crypt(curpass, p->pw_passwd), p->pw_passwd))
+ if (!(crpt_passwd = crypt(curpass, p->pw_passwd)) || strcmp(crpt_passwd, p->pw_passwd))
# else
if (strcmp(curpass, p->pw_passwd))
# endif
--
1.8.3.1
++++++ kdm-kdmconf.diff ++++++
Index: kdm/kfrontend/genkdmconf.c
===================================================================
--- kdm/kfrontend/genkdmconf.c.orig
+++ kdm/kfrontend/genkdmconf.c
@@ -1049,6 +1049,26 @@ copyFile(Entry *ce, int mode, int (*proc
}
static void
+cleanupFile( const char *tname, int mode )
+{
+ char *nname;
+ File file, file2;
+ char bn[PATH_MAX + 4];
+
+ ASPrintf( &nname, "%s/%s", newdir, tname );
+ sprintf( bn, "%s.bak", nname );
+
+ if (readFile( &file, nname ) && readFile( &file2, bn )) {
+ if ((file.eof - file.buf == file2.eof - file2.buf) && !strncmp( file.buf, file2.buf, file.eof - file.buf )) {
+ unlink( nname );
+ rename( bn, nname );
+ chmod( nname, mode );
+ }
+ }
+ free( nname );
+}
+
+static void
doLinkFile(const char *name)
{
File file;
@@ -1087,9 +1107,10 @@ writeFile(const char *tname, int mode, c
fputs_(cont, f);
fclose_(f);
addedFile(tname);
+ if (!no_backup)
+ cleanupFile(tname + sizeof(KDMCONF), mode);
}
-
static void
handleBgCfg(Entry *ce, Section *cs)
{
@@ -3179,9 +3200,6 @@ int main(int argc, char **argv)
memcmp(oldkde + olen - sizeof(SHR_CONF) + 1,
SHR_CONF, sizeof(SHR_CONF)))
{
- fprintf(stderr,
- "Warning: --old-kde does not end with " SHR_CONF ". "
- "Might wreak havoc.\n");
oldkdepfx = oldkde;
} else
ASPrintf((char **)&oldkdepfx,
@@ -3293,6 +3311,8 @@ int main(int argc, char **argv)
f = createFile("kdmrc", kdmrcmode);
writeKdmrc(f);
fclose_(f);
+ if (!no_backup)
+ cleanupFile( "kdmrc", kdmrcmode );
f = createFile("README", 0644);
fprintf_(f,
@@ -3341,6 +3361,8 @@ int main(int argc, char **argv)
"\nTry 'genkdmconf --help' if you want to generate another configuration.\n"
"\nYou may delete this README.\n");
fclose_(f);
+ if (!no_backup)
+ cleanupFile( "README", 0644 );
return 0;
}
++++++ kdm-long-xserver-timeout.diff ++++++
Subject: Increase the time KDM waits for X to start up
From: Lubos Lunak
Patch-upstream: no
Bug: bnc#462478
See the bugreport. In short, some drivers suck.
Index: kdm/config.def
===================================================================
--- kdm/config.def.orig
+++ kdm/config.def
@@ -1364,7 +1364,7 @@ Description:
Key: ServerTimeout
Type: int
-Default: 30
+Default: 60
User: core
Instance: #:*/
Comment:
++++++ kdm-make_it_cool.diff ++++++
--- kdm/kfrontend/kgreeter.cpp 2011-08-18 18:54:29.000000000 +0200
+++ kdm/kfrontend/kgreeter.cpp 2011-08-19 09:37:02.384127904 +0200
@@ -68,20 +68,20 @@
class UserListView : public QListWidget {
public:
- UserListView(QWidget *parent = 0)
+ UserListView( bool _themed, QWidget *parent = 0)
: QListWidget(parent)
, cachedSizeHint(-1, 0)
+ , themed (_themed)
{
setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Ignored);
setUniformItemSizes(true);
setVerticalScrollMode(ScrollPerPixel);
setIconSize(QSize(48, 48));
- setAlternatingRowColors(true);
+ setAlternatingRowColors(!themed);
}
mutable QSize cachedSizeHint;
- protected:
virtual QSize sizeHint() const
{
if (!cachedSizeHint.isValid()) {
@@ -149,6 +149,7 @@
private:
bool m_suppressClick;
+ bool themed;
};
class UserListViewItem : public QListWidgetItem {
@@ -185,7 +186,7 @@
"PrevUser");
if (_userList) {
- userView = new UserListView(this);
+ userView = new UserListView(framed, this);
connect(userView, SIGNAL(itemClicked(QListWidgetItem*)),
SLOT(slotUserClicked(QListWidgetItem*)));
connect(userView, SIGNAL(itemDoubleClicked(QListWidgetItem*)),
@@ -193,8 +194,6 @@
}
if (_userCompletion)
userList = new QStringList;
- if (userView || userList)
- insertUsers();
sessMenu = new QMenu(this);
connect(sessMenu, SIGNAL(triggered(QAction*)),
@@ -365,8 +364,11 @@
}
}
+#include
+#include
+
void
-KGreeter::insertUsers()
+KGreeter::insertUsers( int limit_users )
{
struct passwd *ps;
@@ -392,6 +394,9 @@
if (_showUsers == SHOW_ALL) {
UserList noUsers(_noUsers);
QSet<QString> dupes;
+ QStringList toinsert;
+
+ int count = 0;
for (setpwent(); (ps = getpwent()) != 0;) {
if (*ps->pw_dir && *ps->pw_shell &&
(ps->pw_uid >= (unsigned)_lowUserId ||
@@ -403,10 +408,55 @@
QString username(QFile::decodeName(ps->pw_name));
if (!dupes.contains(username)) {
dupes.insert(username);
- insertUser(default_pix, username, ps);
+ toinsert.append( username );
+
+ if ( limit_users >= 0 && ++count > limit_users )
+ break;
+
+ }
+ }
+ }
+ if ( limit_users >= 0 && ++count > limit_users ) {
+ utmpname( _PATH_WTMP );
+ setutxent();
+ toinsert = QStringList();
+ dupes.clear();
+
+ for ( count = 0; count < limit_users; ) {
+ struct utmpx * ent = getutxent();
+ if ( !ent )
+ break;
+ struct passwd *ps = getpwnam( ent->ut_user );
+ if (ps && *ps->pw_dir && *ps->pw_shell &&
+ (ps->pw_uid >= (unsigned)_lowUserId ||
+ !ps->pw_uid && _showRoot) &&
+ ( ps->pw_uid <= (unsigned)_highUserId ) &&
+ !noUsers.hasUser( ps->pw_name ) &&
+ !noUsers.hasGroup( ps->pw_gid ))
+ {
+ QString username( QFile::decodeName( ent->ut_user ) );
+ if (!dupes.contains( username )) {
+ dupes.insert( username );
+ toinsert.append( username );
+ count++;
+ }
}
+
+
}
+ endutxent();
}
+
+ for ( QStringList::ConstIterator it = toinsert.begin();
+ it != toinsert.end(); ++it )
+ {
+ // pretty stupid to do another lookup round, but the number is limited
+ // and caching struct passwd is pretty ugly
+ struct passwd *ps = getpwnam( QFile::encodeName( *it ) );
+ if ( ps )
+ insertUser( default_pix, *it, ps );
+ }
+
} else {
UserList users(_users);
if (users.hasGroups()) {
@@ -783,6 +833,9 @@
break; }
}
+ if (userView || userList)
+ insertUsers();
+
if (userView) {
if (clock)
inner_box->addWidget(clock, 0, Qt::AlignCenter);
@@ -895,6 +948,7 @@
setMouseTracking(true);
adjustGeometry();
+ themer->setTypeVisible( "userlist", true );
themer->setWidget(this);
@@ -983,6 +1037,13 @@
completeMenu();
#endif
+ if (userView || userList)
+ {
+ insertUsers(7);
+ themer->setTypeVisible( "userlist", true );
+ } else
+ themer->setTypeVisible( "userlist", false );
+
if ((system_button = themer->findNode("system_button"))) {
if (optMenu)
addAction(optMenu->menuAction());
@@ -1021,6 +1082,8 @@
inherited::pluginSetup();
if (userView && verify->entitiesLocal() && verify->entityPresettable() && userlist_node) {
+ userView->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
+ userView->setMaximumHeight( userView->sizeHint().height() );
userlist_node->setWidget(userView);
userlist_rect->setVisible(true);
} else {
--- kdm/kfrontend/kgreeter.h 2011-08-18 18:54:29.000000000 +0200
+++ kdm/kfrontend/kgreeter.h 2011-08-19 09:36:00.097124913 +0200
@@ -70,7 +70,7 @@
protected:
void insertUser(const QImage &, const QString &, struct passwd *);
- void insertUsers();
+ void insertUsers(int limit_users = -1);
void putSession(const QString &, const QString &, bool, const char *);
void insertSessions();
virtual void pluginSetup();
--- kdm/kfrontend/themer/kdmitem.cpp 2011-08-18 18:54:29.000000000 +0200
+++ kdm/kfrontend/themer/kdmitem.cpp 2011-08-19 09:36:00.098124907 +0200
@@ -65,7 +65,6 @@
!modes.split(",", QString::SkipEmptyParts).contains("console"))))
{
m_visible = false;
- return;
}
m_showType = sel.attribute("type");
@@ -78,7 +77,6 @@
themer()->typeVisible(m_showType) == m_showTypeInvert)
{
m_visible = false;
- return;
}
}
--- kdm/kfrontend/themer/kdmlist.cpp 2011-08-18 18:54:29.000000000 +0200
+++ kdm/kfrontend/themer/kdmlist.cpp 2011-08-19 09:36:00.098124907 +0200
@@ -29,8 +29,6 @@
: KdmItem(parent, node)
{
itemType = "list";
- if (!isVisible())
- return;
// Read RECT TAGS
QDomNodeList childList = node.childNodes();
--- kdm/kfrontend/themer/kdmthemer.cpp 2011-08-18 18:54:29.000000000 +0200
+++ kdm/kfrontend/themer/kdmthemer.cpp 2011-08-19 09:38:00.360130704 +0200
@@ -223,10 +223,6 @@
} else {
continue;
}
- if (!newItem->isVisible()) {
- delete newItem;
- continue;
- }
connect(newItem, SIGNAL(needUpdate(int,int,int,int)),
SLOT(update(int,int,int,int)));
connect(newItem, SIGNAL(needPlacement()),
++++++ kdm-relaxed-auth.diff ++++++
Index: kdm/backend/auth.c
===================================================================
--- kdm/backend/auth.c.orig 2010-07-06 08:54:30.000000000 +0200
+++ kdm/backend/auth.c 2010-11-21 20:47:03.478727336 +0100
@@ -610,6 +610,7 @@ defineLocal(FILE *file, Xauth *auth, int
writeAddr(FamilyLocal, strlen(name.nodename), (CARD8 *)name.nodename,
file, auth, ok);
#endif
+ setenv("XAUTHLOCALHOSTNAME", name.nodename, 1);
/*
* For HP-UX, HP's Xlib expects a fully-qualified domain name, which
@@ -1277,6 +1278,9 @@ setUserAuthorization(struct display *d)
userEnviron = setEnv(userEnviron, "XAUTHORITY", envname);
systemEnviron = setEnv(systemEnviron, "XAUTHORITY", envname);
}
+ name = getenv("XAUTHLOCALHOSTNAME");
+ if (name)
+ userEnviron = setEnv( userEnviron, "XAUTHLOCALHOSTNAME", name);
/* a chown() used to be here, but this code runs as user anyway */
}
debug("done setUserAuthorization\n");
++++++ kdm-remove-duplicated-sessions.diff ++++++
Index: kdm/kfrontend/sessions/CMakeLists.txt
===================================================================
--- kdm/kfrontend/sessions/CMakeLists.txt.orig 2010-11-05 11:47:45.000000000 +0100
+++ kdm/kfrontend/sessions/CMakeLists.txt 2010-11-21 20:47:03.551842096 +0100
@@ -12,19 +12,14 @@ install(FILES
amaterus.desktop
amiwm.desktop
asclassic.desktop
- blackbox.desktop
cde.desktop
ctwm.desktop
cwwm.desktop
e16.desktop
- enlightenment.desktop
evilwm.desktop
fluxbox.desktop
flwm.desktop
- fvwm.desktop
- fvwm95.desktop
golem.desktop
- icewm.desktop
ion.desktop
larswm.desktop
lwm.desktop
@@ -47,9 +42,6 @@ install(FILES
w9wm.desktop
waimea.desktop
wm2.desktop
- wmaker.desktop
- xfce.desktop
- xfce4.desktop
DESTINATION ${DATA_INSTALL_DIR}/kdm/sessions
)
++++++ kdm-suspend-hal.diff ++++++
Index: kdm/backend/ctrl.c
===================================================================
--- kdm/backend/ctrl.c.orig
+++ kdm/backend/ctrl.c
@@ -500,6 +500,10 @@ processCtrl(const char *string, int len,
Reply("nuke\t");
}
}
+ if (d->allowSuspend != SHUT_NONE) {
+ Reply( "suspend\t" );
+ }
+
if ((d->displayType & d_location) == dLocal &&
anyReserveDisplays())
{
Index: kdm/backend/greet.h
===================================================================
--- kdm/backend/greet.h.orig
+++ kdm/backend/greet.h
@@ -152,6 +152,7 @@ from the copyright holder.
# define SHUT_REBOOT 1 /* how */
# define SHUT_HALT 2
# define SHUT_CONSOLE -1 /* pseudo-code */
+# define SHUT_SUSPEND -2 /* pseudo-code */
# define SHUT_SCHEDULE 0 /* when; config only */
# define SHUT_TRYNOW 1
# define SHUT_FORCENOW 2
Index: kdm/config.def
===================================================================
--- kdm/config.def.orig
+++ kdm/config.def
@@ -1799,6 +1799,19 @@ Description:
Who is allowed to shut down the system. This applies both to the
greeter and to the command sockets.
+Key: AllowSuspend
+Type: enum
+ None/SHUT_NONE: no <guilabel>Suspend...</guilabel> menu entry is shown at all
+ Root/SHUT_ROOT: the <systemitem class="username">root</systemitem> password must be entered to suspend
+ All/SHUT_ALL: everybody can suspend the machine
+Default: Root
+User: greeter
+User: core
+Instance: #:0/All
+Comment: &
+Description:
+ If the user should have an option to suspend the system if configured to (also in the desktop)
+
Key: AllowSdForceNow
Type: enum
None: no forced shutdown is allowed at all
Index: kdm/kfrontend/CMakeLists.txt
===================================================================
--- kdm/kfrontend/CMakeLists.txt.orig
+++ kdm/kfrontend/CMakeLists.txt
@@ -4,10 +4,14 @@ add_subdirectory( themes )
add_subdirectory( pics )
add_subdirectory( sessions )
+INCLUDE(UsePkgConfig)
+PKG_CHECK_MODULES(LAZY lazy)
+
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/../kcm/background
${KDEBASE_WORKSPACE_SOURCE_DIR}/libs/kdm
${QIMAGEBLITZ_INCLUDES}
+ ${LAZY_INCLUDE_DIRS}
)
set(kdmthemer_SRCS
@@ -70,7 +74,7 @@ endif (WITH_KDM_XCONSOLE)
macro_add_file_dependencies(kdmconfig.h ${confci})
kde4_add_executable(kdm_greet ${kdm_greet_SRCS})
-target_link_libraries(kdm_greet ${KDE4_KDEUI_LIBS} ${QT_QTXML_LIBRARY} ${X11_X11_LIB} ${POSIX4_LIBRARIES})
+target_link_libraries(kdm_greet ${KDE4_KDEUI_LIBS} ${QT_QTXML_LIBRARY} ${X11_X11_LIB} ${POSIX4_LIBRARIES} lazy)
if (X11_XTest_FOUND)
target_link_libraries(kdm_greet ${X11_XTest_LIB})
endif (X11_XTest_FOUND)
Index: kdm/kfrontend/kdmshutdown.cpp
===================================================================
--- kdm/kfrontend/kdmshutdown.cpp.orig
+++ kdm/kfrontend/kdmshutdown.cpp
@@ -22,6 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fi
*/
+#include
#include "kdmshutdown.h"
#include "kdm_greet.h"
#include "utils.h"
@@ -33,6 +34,7 @@ Foundation, Inc., 51 Franklin Street, Fi
#include
#include <KStandardGuiItem>
#include
+#include
#include <QAction>
#include <QApplication>
@@ -55,6 +57,10 @@ Foundation, Inc., 51 Franklin Street, Fi
int KDMShutdownBase::curPlugin = -1;
PluginList KDMShutdownBase::pluginList;
+#define DBUS_HAL_INTERFACE "org.freedesktop.Hal"
+#define DBUS_HAL_SYSTEM_POWER_INTERFACE "org.freedesktop.Hal.Device.SystemPowerManagement"
+#define HAL_UDI_COMPUTER "/org/freedesktop/Hal/devices/computer"
+
KDMShutdownBase::KDMShutdownBase(int _uid, QWidget *_parent)
: inherited(_parent)
, box(new QVBoxLayout(this))
@@ -65,6 +71,7 @@ KDMShutdownBase::KDMShutdownBase(int _ui
, doesNuke(false)
, mayOk(true)
, maySched(false)
+ , willSuspend(false)
, rootlab(0)
, verify(0)
, needRoot(-1)
@@ -85,6 +92,7 @@ KDMShutdownBase::complete(QWidget *prevW
if (uid &&
((willShut && _allowShutdown == SHUT_ROOT) ||
+ ( willSuspend && _allowSuspend == SHUT_ROOT ) ||
(mayNuke && _allowNuke == SHUT_ROOT)))
{
rootlab = new QLabel(i18n("Root authorization required."), this);
@@ -171,6 +179,7 @@ KDMShutdownBase::updateNeedRoot()
{
int nNeedRoot = uid &&
(((willShut && _allowShutdown == SHUT_ROOT) ||
+ ( willSuspend && _allowSuspend == SHUT_ROOT ) ||
(_allowNuke == SHUT_ROOT && doesNuke)));
if (verify && nNeedRoot != needRoot) {
if (needRoot == 1)
@@ -488,6 +497,63 @@ KDMSlimShutdown::KDMSlimShutdown(QWidget
buttonlay->addWidget(btnReboot);
connect(btnReboot, SIGNAL(clicked()), SLOT(slotReboot()));
+ if ( _allowSuspend != SHUT_NONE )
+ {
+ int supported = -1;
+ liblazy_hal_get_property_bool(HAL_UDI_COMPUTER, "power_management.can_suspend", &supported);
+ if (supported == 1)
+ suspend_ram = true;
+ else
+ suspend_ram = false;
+
+ liblazy_hal_get_property_bool(HAL_UDI_COMPUTER, "power_management.can_standby", &supported);
+ if (supported == 1)
+ standby = true;
+ else
+ standby = false;
+ liblazy_hal_get_property_bool(HAL_UDI_COMPUTER, "power_management.can_hibernate", &supported);
+ if (supported == 1)
+ suspend_disk = true;
+ else
+ suspend_disk = false;
+
+ /* if (liblazy_polkit_is_user_allowed_by_uid(0, "hal-power-hibernate", NULL) != 1)
+ suspend_disk = false;
+ if (liblazy_polkit_is_user_allowed_by_uid(0, "hal-power-suspend", NULL) != 1)
+ suspend_ram = false;
+ if (liblazy_polkit_is_user_allowed_by_uid(0, "hal-power-standby", NULL) != 1)
+ standby = false;
+ */
+ int sum = standby + suspend_ram + suspend_disk;
+ if ( sum ) {
+ buttonlay->addSpacing( KDialog::spacingHint() );
+
+ KPushButton *btnSuspend;
+ if (sum > 1) {
+ btnSuspend = new KDMDelayedPushButton( KGuiItem( i18n("&Suspend Computer"), "media-playback-pause"), this );
+ QMenu *suspends = new QMenu(this);
+ if (suspend_disk)
+ qa_suspend_disk = suspends->addAction(i18n("Suspend to Disk"));
+ else
+ qa_suspend_disk = 0;
+ if (suspend_ram)
+ qa_suspend_ram = suspends->addAction(i18n("Suspend to RAM"));
+ else
+ qa_suspend_ram = 0;
+ if (standby)
+ qa_standby = suspends->addAction(i18n("Standby"));
+ else
+ qa_standby = 0;
+ connect(suspends, SIGNAL(triggered( QAction* )), SLOT(slotSuspend(QAction*)));
+ static_cast(btnSuspend)->setDelayedMenu(suspends);
+ } else {
+ btnSuspend = new KPushButton( KGuiItem( i18n("&Suspend Computer"), "media-playback-pause"), this );
+ }
+ buttonlay->addWidget( btnSuspend );
+ connect(btnSuspend, SIGNAL(clicked()), SLOT(slotSuspend()));
+ }
+ }
+
int dummy, cur;
if (getBootOptions(&targetList, &dummy, &cur)) {
QMenu *targets = new QMenu(this);
@@ -523,6 +589,65 @@ KDMSlimShutdown::KDMSlimShutdown(QWidget
buttonlay->addSpacing(KDialog::spacingHint());
}
+void KDMSlimShutdown::slotSuspend()
+{
+ if (suspend_disk)
+ slotSuspend( qa_suspend_disk );
+ else if (suspend_ram)
+ slotSuspend( qa_suspend_ram );
+ else if ( standby )
+ slotSuspend( qa_standby );
+ else
+ reject();
+}
+
+void KDMSlimShutdown::slotSuspend(QAction * id)
+{
+ reject();
+ // dpySpec *sess = fetchSessions( lstRemote | lstTTY );
+ // it would be nice to show the sessions to suspend, but it
+ // would require string changes (coolo)
+ QList<DpySpec> sess;
+ kDebug() << "slotSuspend" << _allowSuspend;
+ if (!sess.isEmpty() || _allowSuspend == SHUT_ROOT)
+ {
+ int ret = KDMConfShutdown( -1, sess, SHUT_SUSPEND, 0 ).exec();
+ if ( !ret )
+ return;
+ }
+
+ int error = 0;
+ int wake = 0;
+ DBusMessage *reply;
+
+ if (suspend_disk && id == qa_suspend_disk) {
+ error = liblazy_dbus_system_send_method_call(DBUS_HAL_INTERFACE,
+ HAL_UDI_COMPUTER,
+ DBUS_HAL_SYSTEM_POWER_INTERFACE,
+ "Hibernate",
+ &reply,
+ DBUS_TYPE_INVALID);
+ } else if (suspend_ram && id == qa_suspend_ram)
+ error = liblazy_dbus_system_send_method_call(DBUS_HAL_INTERFACE,
+ HAL_UDI_COMPUTER,
+ DBUS_HAL_SYSTEM_POWER_INTERFACE,
+ "Suspend",
+ &reply,
+ DBUS_TYPE_INT32,
+ &wake,
+ DBUS_TYPE_INVALID);
+ else if (standby && id == qa_standby )
+ error = liblazy_dbus_system_send_method_call(DBUS_HAL_INTERFACE,
+ HAL_UDI_COMPUTER,
+ DBUS_HAL_SYSTEM_POWER_INTERFACE,
+ "Standby",
+ &reply,
+ DBUS_TYPE_INVALID);
+ else {
+ return;
+ }
+}
+
void
KDMSlimShutdown::slotSched()
{
Index: kdm/kfrontend/kdmshutdown.h
===================================================================
--- kdm/kfrontend/kdmshutdown.h.orig
+++ kdm/kfrontend/kdmshutdown.h
@@ -67,7 +67,7 @@ class KDMShutdownBase : public FDialog,
#else
static const bool willShut = true;
#endif
- bool mayNuke, doesNuke, mayOk, maySched;
+ bool mayNuke, doesNuke, mayOk, maySched, willSuspend;
private Q_SLOTS:
void slotSched();
@@ -118,7 +118,6 @@ class KDMShutdown : public KDMShutdownBa
QComboBox *targets;
int oldTarget;
int sch_st, sch_to;
-
};
class KDMRadioButton : public QRadioButton {
@@ -161,11 +160,15 @@ class KDMSlimShutdown : public FDialog {
void slotReboot();
void slotReboot(QAction *);
void slotSched();
+ void slotSuspend();
+ void slotSuspend(QAction *);
private:
bool checkShutdown(int type, const QString &os);
QStringList targetList;
+ bool suspend_disk, suspend_ram, standby;
+ QAction *qa_suspend_disk, *qa_suspend_ram, *qa_standby;
};
class KDMConfShutdown : public KDMShutdownBase {
++++++ kdm-sysconfig-values.diff ++++++
++++ 777 lines (skipped)
++++++ kdm-wordbreak.diff ++++++
Index: kdm/kfrontend/kfdialog.cpp
===================================================================
--- kdm/kfrontend/kfdialog.cpp.orig 2010-08-05 18:55:46.000000000 +0200
+++ kdm/kfrontend/kfdialog.cpp 2010-11-21 20:47:03.524842955 +0100
@@ -28,6 +28,7 @@ Foundation, Inc., 51 Franklin Street, Fi
#include <KGuiItem>
#include <KPushButton>
+#include <KGlobalSettings>
#include <QApplication>
#include <QDesktopWidget>
@@ -172,6 +173,9 @@ KFMsgBox::KFMsgBox(QWidget *parent, QMes
QLabel *label1 = new QLabel(this);
label1->setPixmap(QMessageBox::standardIcon(type));
QLabel *label2 = new QLabel(text, this);
+ QRect d = KGlobalSettings::desktopGeometry(this);
+ if ( label2->fontMetrics().size( 0, text).width() > d.width() * 3 / 5)
+ label2->setWordWrap( true );
KPushButton *button = new KPushButton(KStandardGuiItem::ok(), this);
button->setDefault(true);
button->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred));
++++++ kdm_plymouth.patch ++++++
--- kdm/backend/dm.c 2011-09-06 16:09:17.000000000 +0200
+++ kdm/backend/dm.c 2011-09-07 16:23:59.017135854 +0200
@@ -1347,6 +1347,81 @@
return activeVTs;
}
+static int
+get_active_vt (void)
+{
+ int console_fd;
+ struct vt_stat console_state = { 0 };
+ console_fd = open ("/dev/tty0", O_RDONLY | O_NOCTTY);
+ if (console_fd < 0) {
+ goto out;
+ }
+ if (ioctl (console_fd, VT_GETSTATE, &console_state) < 0) {
+ goto out;
+ }
+out:
+ if (console_fd >= 0) {
+ close (console_fd);
+ }
+ return console_state.v_active;
+}
+
+static int
+plymouth_is_running (void)
+{
+ int status;
+ status = system ("/bin/plymouth --ping");
+
+ return WIFEXITED (status) && WEXITSTATUS (status) == 0;
+}
+
+static int
+plymouth_has_active_vt (void)
+{
+ int status;
+ status = system ("/bin/plymouth --has-active-vt");
+
+ return WIFEXITED (status) && WEXITSTATUS (status) == 0;
+}
+
+static int
+plymouth_prepare_for_transition (void)
+{
+ int status;
+ status = system ("/bin/plymouth deactivate");
+
+ return WIFEXITED (status) && WEXITSTATUS (status) == 0;
+}
+
+int
+plymouth_quit_with_transition (void)
+{
+ int status;
+ status = system ("/bin/plymouth quit --retain-splash");
+
+ return WIFEXITED (status) && WEXITSTATUS (status) == 0;
+}
+
+static int
+plymouth_quit_without_transition (void)
+{
+ int status;
+ status = system ("/bin/plymouth quit");
+
+ return WIFEXITED (status) && WEXITSTATUS (status) == 0;
+}
+
+static int
+triggered_to_force_display_on_active_vt (void)
+{
+ int should_force_display_on_active_vt;
+ should_force_display_on_active_vt=open("/var/spool/gdm/force-display-on-active-vt", O_RDONLY);
+ if ( should_force_display_on_active_vt >= 0 )
+ close(should_force_display_on_active_vt);
+ unlink("/var/spool/gdm/force-display-on-active-vt");
+ return should_force_display_on_active_vt;
+}
+
static void
allocateVT(struct display *d)
{
@@ -1356,6 +1431,43 @@
if ((d->displayType & d_location) == dLocal &&
d->status == notRunning && !d->serverVT && d->reqSrvVT >= 0)
{
+ /* check for plymouth using newer methods */
+ d->plymouth_is_running = plymouth_is_running ();
+ if (d->plymouth_is_running) {
+ /* call plymouth deactivate */
+ plymouth_prepare_for_transition ();
+ if (plymouth_has_active_vt ()) {
+ /* plymouth was displaying a splash screen and has
+ * terminated leaving it on screen
+ */
+ int vt;
+ vt = get_active_vt ();
+ if (vt > 0) {
+ /* start the X server on the active vt */
+ d->serverVT = vt;
+ return;
+ }
+ }
+ else {
+ /* plymouth might have been running but did not display
+ * a splash screen.
+ */
+
+ /* call plymouth quit and start the X server as usual */
+ d->plymouth_is_running = !plymouth_quit_without_transition ();
+ }
+
+ /* fallback to old/deprecated method */
+ } else if ( triggered_to_force_display_on_active_vt() >= 0 ) {
+ int vt;
+ vt = get_active_vt();
+ if (vt > 0) {
+ d->serverVT = vt;
+ return;
+ }
+ }
+
+
if (d->reqSrvVT && d->reqSrvVT < 16) {
d->serverVT = d->reqSrvVT;
} else {
--- kdm/backend/dm.h 2011-09-06 16:09:17.000000000 +0200
+++ kdm/backend/dm.h 2011-09-07 16:23:59.018135847 +0200
@@ -304,6 +304,8 @@
int authNum; /* number of authorizations */
char *authFile; /* file to store authorization in */
char *greeterAuthFile; /* file to store authorization for greeter in */
+
+ int plymouth_is_running; /* Plymouth's status */
};
#define d_location 1
@@ -428,6 +430,8 @@
void forEachDisplay(void (*f)(struct display *));
#ifdef HAVE_VTS
void forEachDisplayRev(void (*f)(struct display *));
+/* function for plymouth */
+int plymouth_quit_with_transition (void);
#endif
void removeDisplay(struct display *old);
struct display
--- kdm/backend/server.c 2011-09-06 16:09:17.000000000 +0200
+++ kdm/backend/server.c 2011-09-07 16:23:59.018135847 +0200
@@ -137,6 +137,11 @@
struct display *d = startingServer;
d->serverStatus = ignore;
serverTimeout = TO_INF;
+ if (d->plymouth_is_running) {
+ debug( "Quitting Plymouth with transition\n" );
+ d->plymouth_is_running = !plymouth_quit_with_transition ();
+ debug ("Is Plymouth still running? %s\n", d->plymouth_is_running ? "yes" : "no");
+ }
debug("X server ready, starting session\n");
startDisplayP2(d);
}
++++++ kdm_systemd_shutdown.patch ++++++
per https://bugzilla.redhat.com/show_bug.cgi?id=796969#c23
The process that executes kdm/backend/session.c:manageSession() is the leader
process of the logind session.
manageSession() calls:
blockTerm();
clientExited();
unblockTerm();
where clientExited() ends the PAM session.
With the current systemd-logind, ending the PAM session will cause the leader
process to be delivered SIGHUP and SIGTERM. The process will die and the
remainder of manageSession() will not be executed.
Interestingly, at the end of the function there's a call to sessionExit(),
which calls clientExited() again.
Removing the three lines quoted above makes reboot from KDE work again. I
haven't noticed any bad effects.
diff -up kde-workspace-4.8.0/kdm/backend/session.c.bz796969 kde-workspace-4.8.0/kdm/backend/session.c
--- kde-workspace-4.8.0/kdm/backend/session.c.bz796969 2012-01-18 14:08:40.000000000 -0600
+++ kde-workspace-4.8.0/kdm/backend/session.c 2012-02-28 07:17:16.270219932 -0600
@@ -662,9 +662,9 @@ manageSession(void)
sessionExit(EX_AL_RESERVER_DPY);
}
- blockTerm();
- clientExited();
- unblockTerm();
+ /* blockTerm(); */
+ /* clientExited(); */
+ /* unblockTerm(); */
gSet(&mstrtalk);
gSendInt(D_UnUser);
++++++ kwin-suse.diff ++++++
--- kwin/clients/oxygen/oxygenclient.cpp
+++ kwin/clients/oxygen/oxygenclient.cpp
@@ -59,6 +59,9 @@
#include "oxygenbutton.h"
#include "oxygen.h"
+#define logourl "/usr/share/kde4/apps/kwin/titlebar_decor.png"
+#define logooffset 5
+
namespace Oxygen
{
@@ -93,6 +96,7 @@
, helper_(*globalHelper)
{
qAddPostRoutine(oxkwincleanupBefore);
+ logo.load(logourl);
}
OxygenClient::~OxygenClient()
@@ -327,7 +331,7 @@
const int titleWidth = frame.width() -
titleEdgeLeft - layoutMetric(LM_TitleEdgeRight) -
buttonsLeftWidth() - buttonsRightWidth() -
- marginLeft - marginRight;
+ marginLeft - marginRight - logo.width() - logooffset;
// draw shadow
@@ -364,6 +368,12 @@
painter.drawText(titleLeft, titleTop-1, titleWidth, titleHeight, // -1 is to go into top resizearea
OxygenFactory::titleAlignment() | Qt::AlignVCenter, caption());
+ if (isActive()) {
+ QFontMetrics fm(options()->font(isActive(), false));
+ painter.drawImage(titleEdgeLeft + layoutMetric(LM_TitleEdgeRight) + buttonsLeftWidth()
+ + qMin(fm.width(caption()), titleWidth) + logooffset, titleTop, logo);
+ }
+
painter.setRenderHint(QPainter::Antialiasing);
// Draw dividing line
@@ -389,7 +399,7 @@
}
if (align & Qt::AlignLeft) {
- int left = titleLeft + QFontMetrics(options()->font(isActive(), false)).width(caption()) + 4;
+ int left = titleLeft + QFontMetrics(options()->font(isActive(), false)).width(caption()) + 4 + logo.width() + logooffset;
int right = titleLeft + titleWidth;
if (left < right)
drawStripes(&painter, palette, left, right, titleTop+6);
--- kwin/clients/oxygen/oxygenclient.h
+++ kwin/clients/oxygen/oxygenclient.h
@@ -68,6 +68,7 @@
bool isMaximized() const;
bool colorCacheInvalid_;
QColor cachedTitlebarTextColor_;
+ QImage logo;
TileSet *shadowTiles(const QColor& color, const QColor& glow, qreal size, bool active);
++++++ opensuse-homepage.diff ++++++
diff -ur kde-workspace-4.8.1.orig/plasma/desktop/applets/kickoff/ui/brandingbutton.cpp kde-workspace-4.8.1/plasma/desktop/applets/kickoff/ui/brandingbutton.cpp
--- kde-workspace-4.8.1.orig/plasma/desktop/applets/kickoff/ui/brandingbutton.cpp 2012-03-20 15:15:39.645598514 +0100
+++ kde-workspace-4.8.1/plasma/desktop/applets/kickoff/ui/brandingbutton.cpp 2012-03-20 15:17:03.369606255 +0100
@@ -68,7 +68,9 @@
void BrandingButton::openHomepage()
{
- new KRun(Plasma::Theme::defaultTheme()->homepage(), topLevelWidget(), false, false);
+ KUrl suseurl;
+ suseurl = "http://www.opensuse.org";
+ new KRun(suseurl, topLevelWidget(), false, false);
}
void BrandingButton::paintEvent(QPaintEvent *event)
++++++ pam-translate.diff ++++++
Index: libs/kdm/kgreet_generic.cpp
===================================================================
--- libs/kdm/kgreet_generic.cpp.orig 2010-07-06 08:54:28.000000000 +0200
+++ libs/kdm/kgreet_generic.cpp 2010-11-21 20:47:03.809718230 +0100
@@ -141,7 +141,9 @@ KGenericGreeter::textMessage(const char
if (m_infoMsgs.isEmpty())
revive();
- QString qtext = QString::fromUtf8(text);
+ // PAM does not translate these
+ //(void) I18N_NOOP("");
+ QString qtext = i18n( text );
m_infoMsgs.append(qtext);
QLabel *label = new QLabel(qtext, m_parentWidget);
m_grid->addWidget(label, m_line++, 0, 1, 2);
@@ -169,7 +171,10 @@ KGenericGreeter::textPrompt(const char *
else
m_infoMsgs.clear();
- QLabel *label = new QLabel(QString::fromUtf8(prompt).trimmed());
+ // PAM does not translate these
+ ( void ) I18N_NOOP( "Password: " );
+ ( void ) I18N_NOOP( "Password or swipe finger: " );
+ QLabel *label = new QLabel(i18n( prompt ).trimmed());
m_grid->addWidget(label, m_line, 0);
m_children.append(label);
m_echo = echo;
++++++ plasma-branding-defaults-applets.diff ++++++
Index: plasma/desktop/applets/kickoff/applet/applet.cpp
===================================================================
--- plasma/desktop/applets/kickoff/applet/applet.cpp.orig
+++ plasma/desktop/applets/kickoff/applet/applet.cpp
@@ -27,6 +27,7 @@
#include
#include
#include
+#include <QFile>
// KDE
#include <KAuthorized>
@@ -191,7 +192,10 @@ void LauncherApplet::toolTipAboutToShow(
void LauncherApplet::configChanged()
{
KConfigGroup cg = config();
- setPopupIcon(cg.readEntry("icon", "start-here-kde"));
+ if (QFile::exists("/usr/share/icons/oxygen/scalable/places/start-here-branding.svg"))
+ setPopupIcon(cg.readEntry("icon", "start-here-branding"));
+ else
+ setPopupIcon(cg.readEntry("icon", "start-here-kde"));
constraintsEvent(Plasma::ImmutableConstraint);
if (d->launcher) {
@@ -210,7 +214,12 @@ void LauncherApplet::configAccepted()
d->createLauncher();
KConfigGroup cg = config();
- const QString oldIcon = cg.readEntry("icon", "start-here-kde");
+ QString oldIcon;
+ if (QFile::exists("/usr/share/icons/oxygen/scalable/places/start-here-branding.svg"))
+ oldIcon = cg.readEntry("icon", "start-here-branding");
+ else
+ oldIcon = cg.readEntry("icon", "start-here-kde");
+
if (!iconname.isEmpty() && iconname != oldIcon) {
cg.writeEntry("icon", iconname);
Index: plasma/desktop/applets/kickoff/core/favoritesmodel.cpp
===================================================================
--- plasma/desktop/applets/kickoff/core/favoritesmodel.cpp.orig
+++ plasma/desktop/applets/kickoff/core/favoritesmodel.cpp
@@ -167,6 +167,11 @@ FavoritesModel::~FavoritesModel()
void FavoritesModel::add(const QString& url)
{
+ KService::Ptr service = KService::serviceByStorageId(url);
+ if (!service) {
+ return;
+ }
+
Private::globalFavoriteList << url;
Private::globalFavoriteSet << url;
Index: plasma/desktop/applets/kickoff/core/models.cpp
===================================================================
--- plasma/desktop/applets/kickoff/core/models.cpp.orig
+++ plasma/desktop/applets/kickoff/core/models.cpp
@@ -177,7 +177,19 @@ QStringList Kickoff::systemApplicationLi
{
KConfigGroup appsGroup = componentData().config()->group("SystemApplications");
QStringList apps;
- apps << "systemsettings";
+
+ if (QFile::exists("/usr/share/applications/YaST.desktop"))
+ apps << "YaST.desktop";
+
+ if (QFile::exists("/usr/share/applications/package-manager.desktop"))
+ apps << "package-manager.desktop";
+
+ if (KService::serviceByStorageId("YaST2/live-installer.desktop"))
+ apps << "YaST2/live-installer.desktop";
+
+ if (QFile::exists("/usr/share/kde4/services/sysinfo.protocol"))
+ apps << "/usr/share/kde4/services/sysinfo.protocol";
+
apps = appsGroup.readEntry("DesktopFiles", apps);
return apps;
}
Index: plasma/desktop/applets/kickoff/core/systemmodel.cpp
===================================================================
--- plasma/desktop/applets/kickoff/core/systemmodel.cpp.orig
+++ plasma/desktop/applets/kickoff/core/systemmodel.cpp
@@ -71,7 +71,7 @@ public:
connect(placesModel, SIGNAL(rowsRemoved(QModelIndex,int,int)),
q, SLOT(sourceRowsRemoved(QModelIndex,int,int)));
- topLevelSections << i18n("Applications")
+ topLevelSections << i18n("Administration")
<< i18n("Places")
<< i18n("Removable Storage")
<< i18n("Storage");
@@ -217,19 +217,33 @@ QVariant SystemModel::data(const QModelI
}
KService::Ptr service = d->appsList[index.row()];
-
- switch (role) {
- case Qt::DisplayRole:
- return service->name();
- case Qt::DecorationRole:
- return KIcon(service->icon());
- case SubTitleRole:
- return service->genericName();
- case UrlRole:
- return service->entryPath();
- default:
- return QVariant();
- }
+ if (service->name()=="sysinfo") {
+ switch(role) {
+ case Qt::DisplayRole:
+ return i18n("My Computer");
+ case Qt::DecorationRole:
+ return KIcon("hwinfo");
+ case SubTitleRole:
+ return "sysinfo:/";
+ case UrlRole:
+ return "sysinfo:/";
+ default:
+ return QVariant();
+ }
+ } else {
+ switch (role) {
+ case Qt::DisplayRole:
+ return service->name();
+ case Qt::DecorationRole:
+ return KIcon(service->icon());
+ case SubTitleRole:
+ return service->genericName();
+ case UrlRole:
+ return service->entryPath();
+ default:
+ return QVariant();
+ }
+ }
}
if (role == UrlRole && !d->placesModel->isHidden(mapToSource(index))) {
Index: plasma/desktop/applets/kickoff/simpleapplet/simpleapplet.cpp
===================================================================
--- plasma/desktop/applets/kickoff/simpleapplet/simpleapplet.cpp.orig
+++ plasma/desktop/applets/kickoff/simpleapplet/simpleapplet.cpp
@@ -36,6 +36,7 @@
#include
#include
#include
+#include <QFile>
// KDE Libs
#include <KActionCollection>
@@ -305,7 +306,10 @@ MenuLauncherApplet::MenuLauncherApplet(Q
d->viewtypes << "RunCommand";
}
d->viewtypes << "Leave";
- d->iconname = "start-here-kde";
+ if (QFile::exists("/usr/share/icons/oxygen/scalable/places/start-here-branding.svg"))
+ d->iconname = "start-here-branding";
+ else
+ d->iconname = "start-here-kde";
}
}
d->formattype = NameDescription;
++++++ plasma-dashboard-leave.diff ++++++
Index: plasma/desktop/shell/dashboardview.cpp
===================================================================
--- plasma/desktop/shell/dashboardview.cpp.orig
+++ plasma/desktop/shell/dashboardview.cpp
@@ -225,6 +225,15 @@ bool DashboardView::eventFilter(QObject
widgetExplorer->setPos(0, containment()->geometry().height() - widgetExplorer->geometry().height());
}
+ if (watched != (QObject*)m_widgetExplorer.data()) {
+ if (event->type() == QEvent::MouseButtonPress) {
+ QMouseEvent *me = static_cast(event);
+ if (me->button() == Qt::LeftButton) {
+ hideView();
+ }
+ }
+ }
+
return false;
}
++++++ plasma-disable-networkmanager.diff ++++++
commit dda8f95f9d810cf3f14f7be410bb612b1c6c0744
Author: Stephan Kulow
Date: Thu Oct 13 15:36:58 2011 +0200
openSUSE has NetworkManager installed on all installations, but doesn't
necessarly run it. While checking for some dbus interface might be
the better solution, it's also the more fragile one because NM might
still startup or be down just the second we check the default applets.
So simply make it possible to disable it on KDE start depending on sysconfig
and if the system changes, the user is expected to reconfigure plasma too
Index: kde-workspace-4.8.5/plasma/generic/applets/systemtray/ui/applet.cpp
===================================================================
--- kde-workspace-4.8.5.orig/plasma/generic/applets/systemtray/ui/applet.cpp
+++ kde-workspace-4.8.5/plasma/generic/applets/systemtray/ui/applet.cpp
@@ -706,7 +706,7 @@ void Applet::checkDefaultApplets()
QStringList applets = s_manager->applets(this);
- if (!applets.contains("org.kde.networkmanagement")) {
+ if (!applets.contains("org.kde.networkmanagement") && !getenv("KDE_NETWORKMANAGER_DISABLED")) {
s_manager->addApplet("org.kde.networkmanagement", this);
}
++++++ plasma-fix-delete-preferred-launchers.diff ++++++
commit f8eb85a87846e49b10dae8170695533262011ae1
Author: Gregor Tätzner
Date: Thu Jul 26 14:32:38 2012 +0200
Fix deletion of preferred application launchers
In default panel config the host of that magic preferred app url is used
as the key. So lets use that key to delete the launchers, too.
BUG: 278724
FIXED-IN: 4.9.1
REVIEW: 105374
diff --git a/libs/taskmanager/groupmanager.cpp b/libs/taskmanager/groupmanager.cpp
index 5ca0159..45c15a9 100644
--- a/libs/taskmanager/groupmanager.cpp
+++ b/libs/taskmanager/groupmanager.cpp
@@ -1070,8 +1070,16 @@ void GroupManagerPrivate::unsaveLauncher(LauncherItem *launcher)
return;
}
- if (cg.hasKey(launcher->name())) {
- cg.deleteEntry(launcher->name());
+ QString launcherKey;
+
+ if (launcher->launcherUrl().protocol() == "preferred")
+ // in default config the host of the preferred application url is used as key
+ launcherKey = launcher->launcherUrl().host();
+ else
+ launcherKey = launcher->name();
+
+ if (cg.hasKey(launcherKey)) {
+ cg.deleteEntry(launcherKey);
emit q->configChanged();
}
}
@@ -1127,7 +1135,7 @@ int GroupManagerPrivate::launcherIndex(const KUrl &url)
foreach (const LauncherItem * item, launchers) {
if (item->launcherUrl() == url) {
return index;
- }
+ }
++index;
}
++++++ plasma-kickoff-newly-collapsing.diff ++++++
++++ 779 lines (skipped)
++++++ plasma-notifications-kill-timer.diff ++++++
Index: kdebase-workspace-4.5.80/plasma/generic/dataengines/notifications/notificationsengine.cpp
===================================================================
--- kdebase-workspace-4.5.80.orig/plasma/generic/dataengines/notifications/notificationsengine.cpp 2010-11-11 15:41:03.000000000 +0100
+++ kdebase-workspace-4.5.80/plasma/generic/dataengines/notifications/notificationsengine.cpp 2010-11-21 20:47:03.824759539 +0100
@@ -217,6 +217,7 @@ void NotificationsEngine::timerEvent(QTi
killTimer(event->timerId());
m_sourceTimers.remove(source);
m_timeouts.remove(event->timerId());
+ killTimer(event->timerId());
removeSource(source);
emit NotificationClosed(source.split(" ").last().toInt(), 1);
return;
++++++ plasma-panel-resize-hint.diff ++++++
Index: plasma/desktop/shell/panelcontroller.cpp
===================================================================
--- plasma/desktop/shell/panelcontroller.cpp.orig
+++ plasma/desktop/shell/panelcontroller.cpp
@@ -663,6 +663,8 @@ void PanelController::mouseMoveFilter(QM
newX = qMin(newX, screenGeom.left() + screenGeom.width()/3);
move(newX, pos().y());
resizeFrameHeight(geometry().left() - screenGeom.left());
+ m_sizeTool->setText(i18n("Width: %1", geometry().left() - screenGeom.left()));
+
break;
}
case Plasma::RightEdge: {
@@ -671,6 +673,8 @@ void PanelController::mouseMoveFilter(QM
newX = qMax(newX, screenGeom.left() + 2*(screenGeom.width()/3) - width());
move(newX, pos().y());
resizeFrameHeight(screenGeom.right() - geometry().right());
+ m_sizeTool->setText(i18n("Width: %1", screenGeom.right() - geometry().right()));
+
break;
}
case Plasma::TopEdge: {
@@ -679,6 +683,9 @@ void PanelController::mouseMoveFilter(QM
newY = qMin(newY, screenGeom.top() + screenGeom.height()/3);
move(pos().x(), newY);
resizeFrameHeight(geometry().top() - screenGeom.top());
+ m_sizeTool->setText(i18n("Height: %1", geometry().top() - screenGeom.top()));
+
+
break;
}
case Plasma::BottomEdge:
@@ -688,6 +695,8 @@ void PanelController::mouseMoveFilter(QM
newY = qMax(newY, screenGeom.top() + 2*(screenGeom.height()/3) - height());
move(pos().x(), newY);
resizeFrameHeight(screenGeom.bottom() - geometry().bottom());
+ m_sizeTool->setText(i18n("Height: %1", screenGeom.bottom() - geometry().bottom()));
+
break;
}
}
++++++ pre_checkin.sh ++++++
#!/bin/bash
# This script is called automatically during autobuild checkin.
version=$(grep '^Version:.*' kdebase4-workspace.spec)
for change in python-kdebase4; do
cp -f kdebase4-workspace.changes $change.changes
sed -i -e "s,Version:.*,$version," ${change}.spec
done
++++++ rcksysguardd ++++++
#!/bin/sh
# Copyright (c) 1995-2009 SuSE Linux AG, Nuernberg, Germany.
# All rights reserved.
#
# Author:
#
# /etc/init.d/ksysguardd
#
# and it's symbolic link
#
# /usr/sbin/rcksysguardd
#
### BEGIN INIT INFO
# Provides: ksysguardd
# Required-Start: $remote_fs $syslog
# Should-Start:
# Required-Stop: $remote_fs $syslog
# Should-Stop:
# Default-Start: 2 3 5
# Default-Stop: 0 1 6
# Description: Start KDE ksysguard daemon to allow system monitoring
# Short-Description: KDE ksysguard daemon
### END INIT INFO
# Check for missing binaries (stale symlinks should not happen)
KSYSGUARDD_BIN=/usr/bin/ksysguardd
test -x $KSYSGUARDD_BIN || { echo "$KSYSGUARDD_BIN not installed";
if [ "$1" = "stop" ]; then exit 0;
else exit 5; fi; }
# Shell functions sourced from /etc/rc.status:
# rc_check check and set local and overall rc status
# rc_status check and set local and overall rc status
# rc_status -v ditto but be verbose in local rc status
# rc_status -v -r ditto and clear the local rc status
# rc_status -s display "skipped" and exit with status 3
# rc_status -u display "unused" and exit with status 3
# rc_failed set local and overall rc status to failed
# rc_failed <num> set local and overall rc status to <num>
# rc_reset clear local rc status (overall remains)
# rc_exit exit appropriate to overall rc status
# rc_active checks whether a service is activated by symlinks
# rc_splash arg sets the boot splash screen to arg (if active)
. /etc/rc.status
# First reset status of this service
rc_reset
# Return values acc. to LSB for all commands but status:
# 0 - success
# 1 - generic or unspecified error
# 2 - invalid or excess argument(s)
# 3 - unimplemented feature (e.g. "reload")
# 4 - user had insufficient privileges
# 5 - program is not installed
# 6 - program is not configured
# 7 - program is not running
# 8--199 - reserved (8--99 LSB, 100--149 distrib, 150--199 appl)
#
# Note that starting an already running service, stopping
# or restarting a not-running service as well as the restart
# with force-reload (in case signaling is not supported) are
# considered a success.
case "$1" in
start)
echo -n "Starting KDE ksysguard daemon (ksysguardd)"
startproc $KSYSGUARDD_BIN -d
rc_status -v
;;
stop)
echo -n "Shutting down KDE ksysguard daemon (ksysguardd)"
killproc -TERM $KSYSGUARDD_BIN
rc_status -v
;;
try-restart)
$0 status >/dev/null && $0 restart
rc_status
;;
restart)
$0 stop
$0 start
rc_status
;;
force-reload)
echo -n "Reload KDE ksysguard daemon (ksysguardd)"
$0 stop && $0 start
rc_status
;;
reload)
echo -n "Reload KDE ksysguard daemon (ksysguardd)"
rc_failed 3
rc_status -v
;;
status)
echo -n "Checking for KDE ksysguard daemon (ksysguardd): "
checkproc $KSYSGUARDD_BIN
rc_status -v
;;
probe)
## Optional: Probe for the necessity of a reload,
## give out the argument which is required for a reload.
test /etc/ksysguarddrc -nt $KSYSGUARDD_PIDFILE && echo reload
;;
*)
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
exit 1
;;
esac
rc_exit
++++++ rotate-wacom-pointers.diff ++++++
Index: kcontrol/randr/randrscreen.cpp
===================================================================
--- kcontrol/randr/randrscreen.cpp.orig
+++ kcontrol/randr/randrscreen.cpp
@@ -543,6 +543,8 @@ bool RandRScreen::applyProposed(bool con
if (succeed && confirm)
succeed = RandR::confirm(r);
+ RandR::rotateWacom( m_unifiedRotation );
+
// if we succeeded applying and the user confirmed the changes,
// just return from here
if (succeed)
Index: kcontrol/randr/randr.h
===================================================================
--- kcontrol/randr/randr.h.orig
+++ kcontrol/randr/randr.h
@@ -104,6 +104,7 @@ public:
static bool confirm(const QRect &rect = QRect());
static SizeList sortSizes(const SizeList &sizes);
+ static void rotateWacom( int rotation );
};
#endif
Index: kcontrol/randr/legacyrandrscreen.cpp
===================================================================
--- kcontrol/randr/legacyrandrscreen.cpp.orig
+++ kcontrol/randr/legacyrandrscreen.cpp
@@ -104,6 +104,7 @@ bool LegacyRandRScreen::applyProposed()
m_currentSize = m_proposedSize;
m_currentRotation = m_proposedRotation;
m_currentRefreshRate = m_proposedRefreshRate;
+ RandR::rotateWacom( m_currentRotation );
return true;
}
Index: kcontrol/randr/randrcrtc.cpp
===================================================================
--- kcontrol/randr/randrcrtc.cpp.orig
+++ kcontrol/randr/randrcrtc.cpp
@@ -317,6 +317,7 @@ bool RandRCrtc::applyProposed()
m_currentRect = m_proposedRect;
m_currentRate = mode.refreshRate();
emit crtcChanged(m_id, RandR::ChangeMode);
+ RandR::rotateWacom( m_currentRotation );
ret = true;
}
else
Index: kcontrol/randr/randr.cpp
===================================================================
--- kcontrol/randr/randr.cpp.orig
+++ kcontrol/randr/randr.cpp
@@ -19,6 +19,8 @@
#include "randr.h"
#include <KIconLoader>
+#include
+#include
bool RandR::has_1_2 = false;
bool RandR::has_1_3 = false;
@@ -179,5 +181,40 @@ SizeList RandR::sortSizes(const SizeList
return sorted;
}
+void RandR::rotateWacom( int rotation )
+{
+ // search wacom utility and set orientation for available wacom pointers
+ QString xsetwacom = KStandardDirs::findExe("xsetwacom");
+ if (!xsetwacom.isEmpty()) {
+ QProcess proc;
+ proc.start( "xsetwacom", QStringList() << "list" );
+ if (!proc.waitForStarted() || !proc.waitForFinished()) {
+ kError("Could not ask xsetwacom for available pointers.");
+ return;
+ } else {
+ while( !proc.atEnd()) {
+ QString line = QString::fromLocal8Bit( proc.readLine());
+ QString pointer = line.split( ' ' ).first();
+ QStringList args;
+ args << "set" << pointer << "Rotate";
+ switch (rotation) {
+ case RR_Rotate_90:
+ args << "CW";
+ break;
+ case RR_Rotate_180:
+ args << "HALF";
+ break;
+ case RR_Rotate_270:
+ args << "CCW";
+ break;
+ default:
+ args << "NONE";
+ }
+ if( QProcess::execute( "xsetwacom", args ) != 0 )
+ kError("Could not set orientation for wacom pointers.");
+ }
+ }
+ }
+}
++++++ same-pam-generic-classic.diff ++++++
Subject: Use same pam config with generic plugin, to be used with fingerprint auth
From: dmueller@suse.de
Patch-upstream: no
Index: kcheckpass/checkpass_pam.c
===================================================================
--- kcheckpass/checkpass_pam.c.orig
+++ kcheckpass/checkpass_pam.c
@@ -140,12 +140,14 @@ AuthReturn Authenticate(const char *call
openlog("kcheckpass", LOG_PID, LOG_AUTH);
PAM_data.conv = conv;
- if (strcmp(method, "classic")) {
- sprintf(pservb, "%.31s-%.31s", caller, method);
- pam_service = pservb;
- } else {
+ if (strcmp(method, "classic") == 0) {
/* PAM_data.classic = 1; */
pam_service = caller;
+ } else if (strcmp(method, "generic") == 0) {
+ pam_service = caller;
+ } else {
+ sprintf(pservb, "%.31s-%.31s", caller, method);
+ pam_service = pservb;
}
pam_error = pam_start(pam_service, user, &PAM_conversation, &pamh);
if (pam_error != PAM_SUCCESS)
Index: kdm/backend/client.c
===================================================================
--- kdm/backend/client.c.orig
+++ kdm/backend/client.c
@@ -540,7 +540,8 @@ verify(GConvFunc gconv, int rootok)
#ifdef USE_PAM
pnopass = False;
- if (!strcmp(curtype, "classic")) {
+ pdata.usecur = False;
+ if (!strcmp(curtype, "classic") || !strcmp(curtype, "generic")) {
if (!gconv(GCONV_USER, 0))
return False;
if (isNoPassAllowed(curuser)) {
@@ -555,11 +556,11 @@ verify(GConvFunc gconv, int rootok)
} else {
psrv = PAMService;
}
- pdata.usecur = True;
+ if (!strcmp(curtype, "classic"))
+ pdata.usecur = True;
} else {
sprintf(psrvb, "%.31s-%.31s", PAMService, curtype);
psrv = psrvb;
- pdata.usecur = False;
}
pdata.gconv = gconv;
if (!doPAMAuth(psrv, &pdata))
Index: libs/kdm/kgreet_generic.cpp
===================================================================
--- libs/kdm/kgreet_generic.cpp.orig
+++ libs/kdm/kgreet_generic.cpp
@@ -156,6 +156,7 @@ KGenericGreeter::textPrompt(const char *
exp =
exp >= 0 ||
func != Authenticate ||
+ !echo ||
!(kgreeterplugin_info.flags & KGreeterPluginInfo::Presettable);
if (!exp && !fixedUser.isEmpty()) {
@@ -325,8 +326,7 @@ static bool init(const QString &,
echoMode = getConf(ctx, "EchoMode", QVariant(-1)).toInt();
// Fielded entities are not supported per se.
// This implies that the first field is the presettable entity, if any.
- if (getConf(ctx, "generic.Presettable", QVariant(false)).toBool())
- kgreeterplugin_info.flags |= KGreeterPluginInfo::Presettable;
+ kgreeterplugin_info.flags |= KGreeterPluginInfo::Presettable;
KGlobal::locale()->insertCatalog("kgreet_generic");
return true;
}
++++++ startkde.diff ++++++
Index: startkde.cmake
===================================================================
--- startkde.cmake.orig
+++ startkde.cmake
@@ -68,6 +68,9 @@ test -n "$KDEHOME" && kdehome=`echo "$KD
mkdir -m 700 -p $kdehome
mkdir -m 700 -p $kdehome/share
mkdir -m 700 -p $kdehome/share/config
+if test -e /etc/kde4/share/config/startupconfigkeys ; then
+cp /etc/kde4/share/config/startupconfigkeys $kdehome/share/config/startupconfigkeys
+else
cat >$kdehome/share/config/startupconfigkeys <
Date: Tue Aug 7 21:01:18 2012 +0300
Add support for GRUB2 submenus.
Properly parse the 'submenu' directive in GRUB's configuration file
and provide the user with an appropriate menu interface when choosing
which entry to reboot into.
Limitations: Internally we make use of the " >> " separator (hardcoded
in both kdm and ksmserver). An occurence of the separator in a menu
title (be it menuentry or submenu) will baffle our parser. Moreover,
we only support multi-line statements: one-liners, although supported
by GRUB, will fail to be parsed. Lastly, only up to 5 nesting levels
are supported. The above limits are more than enough for all but a
handful of cases.
BUG: 297209
CCBUG: 297209
REVIEW: 105563
Index: kde-workspace-4.8.5/kdm/backend/bootman.c
===================================================================
--- kde-workspace-4.8.5.orig/kdm/backend/bootman.c
+++ kde-workspace-4.8.5/kdm/backend/bootman.c
@@ -43,6 +43,8 @@ from the copyright holder.
#include
#include
+#define SEP " >> "
+
static int
getNull(char ***opts ATTR_UNUSED, int *def ATTR_UNUSED, int *cur ATTR_UNUSED)
{
@@ -123,7 +125,7 @@ setGrub(const char *opt, SdRec *sdr)
fclose(f);
sdr->osindex = i;
sdr->bmstamp = mTime(GRUB_MENU);
- return BO_OK;
+ return strDup(&sdr->osname, opt) ? BO_OK : BO_IO;
}
i++;
}
@@ -140,16 +142,79 @@ commitGrub(void)
system(buffer);
}
+#define GRUB2_MAX_MENU_LEVEL 5
+
static char *grubReboot;
static const char *grubConfig;
static int
+parseGrubTitle(char *title)
+{
+ int len;
+ char *ptr = title;
+
+ if (!title)
+ return -1;
+
+ if (*ptr == '\'') {
+ for (len = 0, ptr++; *ptr && *ptr != '\''; ptr++)
+ title[len++] = *ptr;
+ } else if (*ptr == '"') {
+ for (len = 0, ptr++; *ptr && *ptr != '"'; ptr++) {
+ if (*ptr == '\\') {
+ switch (*(++ptr)) {
+ case 0:
+ return -1; /* Unexpected end */
+ case '$':
+ case '"':
+ case '\\':
+ break;
+ default:
+ title[len++] = '\\';
+ break;
+ }
+ }
+ title[len++] = *ptr;
+ }
+ } else {
+ for (len = 0; *ptr && !isspace(*ptr); ptr++) {
+ if (*ptr == '\\' && !*(++ptr))
+ return -1; /* Unexpected end */
+ title[len++] = *ptr;
+ }
+ }
+
+ return *ptr ? len : -1;
+}
+
+static int
+buildBootList(char ***opts, char *title, int menuLvl, int *menus)
+{
+ int len;
+
+ if ((len = parseGrubTitle(title)) < 0)
+ return -1;
+
+ if (menuLvl > 0) {
+ char **strp;
+ title[len] = '\0';
+ *opts = extStrArr(*opts, &strp);
+ strApp(strp, (*opts)[menus[menuLvl - 1]], SEP, title, (char *)0);
+ } else {
+ *opts = addStrArr(*opts, title, len);
+ }
+
+ return 0;
+}
+
+static int
getGrub2OrBurg(char ***opts, int *def, int *cur, const char *grubRebootExec)
{
FILE *f;
char *ptr, *linp;
- int len, ret = BO_NOMAN, i;
+ int len, ret = BO_NOMAN, menuLvl = 0, inEntry = 0;
char line[1000];
+ int menus[GRUB2_MAX_MENU_LEVEL];
if (!grubReboot && !(grubReboot = locate(grubRebootExec)))
return BO_NOMAN;
@@ -162,38 +227,33 @@ getGrub2OrBurg(char ***opts, int *def, i
return errno == ENOENT ? BO_NOMAN : BO_IO;
while ((len = fGets(line, sizeof(line), f)) != -1) {
for (linp = line; isspace(*linp); linp++, len--);
+ for (; isspace(*(linp + len - 1)); len--);
if ((ptr = match(linp, &len, "set", 3)) && !memcmp(ptr, "default=\"${saved_entry}\"", 24)) {
ret = BO_OK;
} else if ((ptr = match(linp, &len, "menuentry", 9))) {
- linp = ptr;
- if (*linp == '\'') {
- for (i = 0, linp++; *linp && *linp != '\''; linp++)
- ptr[i++] = *linp;
- } else if (*linp == '"') {
- for (i = 0, linp++; *linp && *linp != '"'; linp++) {
- if (*linp == '\\') {
- switch (*(++linp)) {
- case 0:
- return BO_IO; /* Unexpected end */
- case '$':
- case '"':
- case '\\':
- break;
- default:
- ptr[i++] = '\\';
- break;
- }
- }
- ptr[i++] = *linp;
+ if (menuLvl <= GRUB2_MAX_MENU_LEVEL) {
+ if (buildBootList(opts, ptr, menuLvl, menus) < 0) {
+ ret = BO_IO;
+ break;
}
- } else {
- for (i = 0; *linp && !isspace(*linp); linp++) {
- if (*linp == '\\' && !*(++linp))
- return BO_IO; /* Unexpected end */
- ptr[i++] = *linp;
+ }
+ inEntry = 1;
+ } else if ((ptr = match(linp, &len, "submenu", 7))) {
+ if (menuLvl < GRUB2_MAX_MENU_LEVEL) {
+ menus[menuLvl] = arrLen(*opts);
+ if (buildBootList(opts, ptr, menuLvl, menus) < 0) {
+ ret = BO_IO;
+ break;
}
+ } else {
+ logWarn("Only " stringify(GRUB2_MAX_MENU_LEVEL) " nesting levels are supported in Grub2 menus.\n");
}
- *opts = addStrArr(*opts, ptr, i);
+ menuLvl++;
+ } else if (linp[len - 1] == '}') {
+ if (inEntry)
+ inEntry = 0;
+ else if (menuLvl > 0)
+ menuLvl--;
}
}
fclose(f);
@@ -224,10 +284,9 @@ setGrub2(const char *opt, SdRec *sdr)
return ret;
for (i = 0; opts[i]; i++) {
if (!strcmp(opts[i], opt)) {
- sdr->osindex = i;
sdr->bmstamp = mTime(grubConfig);
freeStrArr(opts);
- return BO_OK;
+ return (sdr->osname = replaceInString(opt, SEP, ">")) ? BO_OK : BO_IO;
}
}
freeStrArr(opts);
@@ -242,9 +301,7 @@ commitGrub2(void)
return;
if (grubReboot) {
- char index[16];
- const char *args[] = { grubReboot, index, 0 };
- sprintf(index, "%d", sdRec.osindex);
+ const char *args[] = { grubReboot, sdRec.osname, 0 };
runAndWait((char **)args, environ);
}
}
@@ -312,7 +369,7 @@ getLilo(char ***opts, int *def, int *cur
}
static int
-setLilo(const char *opt, SdRec *sdr ATTR_UNUSED)
+setLilo(const char *opt, SdRec *sdr)
{
char **opts;
int def, cur, ret, i;
@@ -330,7 +387,7 @@ setLilo(const char *opt, SdRec *sdr ATTR
}
oke:
freeStrArr(opts);
- return BO_OK;
+ return strDup(&sdr->osname, opt) ? BO_OK : BO_IO;
}
static void
@@ -364,17 +421,9 @@ getBootOptions(char ***opts, int *def, i
int
setBootOption(const char *opt, SdRec *sdr)
{
- int ret;
-
free(sdr->osname);
sdr->osname = 0;
- if (opt) {
- if ((ret = bootOpts[bootManager].set(opt, sdr)) != BO_OK)
- return ret;
- if (!strDup(&sdr->osname, opt))
- return BO_IO; /* BO_NOMEM */
- }
- return BO_OK;
+ return opt ? bootOpts[bootManager].set(opt, sdr) : BO_OK;
}
void
Index: kde-workspace-4.8.5/kdm/backend/ctrl.c
===================================================================
--- kde-workspace-4.8.5.orig/kdm/backend/ctrl.c
+++ kde-workspace-4.8.5/kdm/backend/ctrl.c
@@ -316,22 +316,6 @@ unQuote(const char *str)
}
static void
-strCatL(char **bp, const char *str, int max)
-{
- int dnl = strnlen(str, max);
- memcpy(*bp, str, dnl);
- *bp += dnl;
-}
-
-static void
-strCat(char **bp, const char *str)
-{
- int dnl = strlen(str);
- memcpy(*bp, str, dnl);
- *bp += dnl;
-}
-
-static void
sdCat(char **bp, SdRec *sdr)
{
int delta = nowMonotonic ? time(0) - now : 0;
Index: kde-workspace-4.8.5/kdm/backend/dm.h
===================================================================
--- kde-workspace-4.8.5.orig/kdm/backend/dm.h
+++ kde-workspace-4.8.5/kdm/backend/dm.h
@@ -570,12 +570,15 @@ void *Calloc(size_t nmemb, size_t size);
void *Malloc(size_t size);
void *Realloc(void *ptr, size_t size);
void wipeStr(char *str);
+void strCat(char **bp, const char *str);
+void strCatL(char **bp, const char *str, int max);
int strCmp(const char *s1, const char *s2);
#ifndef HAVE_STRNLEN
int strnlen(const char *s, int max);
#endif
int strNDup(char **dst, const char *src, int len);
int strDup(char **dst, const char *src);
+char *replaceInString(const char *str, const char *before, const char *after);
int arrLen(char **arr);
void freeStrArr(char **arr);
char **initStrArr(char **arr);
@@ -584,6 +587,7 @@ char **xCopyStrArr(int rn, char **arr);
int reStrN(char **dst, const char *src, int len);
int reStr(char **dst, const char *src);
int strApp(char **dst, ...);
+char **extStrArr(char **arr, char ***strp);
char **addStrArr(char **arr, const char *str, int len);
char **parseArgs(char **argv, const char *string);
/* End note */
Index: kde-workspace-4.8.5/kdm/backend/util.c
===================================================================
--- kde-workspace-4.8.5.orig/kdm/backend/util.c
+++ kde-workspace-4.8.5/kdm/backend/util.c
@@ -83,6 +83,22 @@ Realloc(void *ptr, size_t size)
return ret;
}
+void
+strCatL(char **bp, const char *str, int max)
+{
+ int dnl = strnlen(str, max);
+ memcpy(*bp, str, dnl);
+ *bp += dnl;
+}
+
+void
+strCat(char **bp, const char *str)
+{
+ int dnl = strlen(str);
+ memcpy(*bp, str, dnl);
+ *bp += dnl;
+}
+
int
strCmp(const char *s1, const char *s2)
{
@@ -168,6 +184,29 @@ strDup(char **dst, const char *src)
return strNDup(dst, src, -1);
}
+char *
+replaceInString(const char *str, const char *before, const char *after)
+{
+ int len;
+ size_t beforeLen = strlen(before), afterLen = strlen(after);
+ char *buf, *ret;
+ const char *ptr;
+
+ for (ptr = str, len = 0; (ptr = strstr(ptr, before)); len++)
+ ptr += beforeLen;
+ len = strlen(str) + (afterLen - beforeLen) * len;
+
+ if (!(buf = ret = Malloc(len + 1)))
+ return 0;
+
+ for (ptr = str; (str = strstr(str, before)); str += beforeLen, ptr = str) {
+ strCatL(&buf, ptr, str - ptr);
+ strCatL(&buf, after, afterLen);
+ }
+ strcpy(buf, ptr);
+ return ret;
+}
+
/* append any number of strings to dst */
int
strApp(char **dst, ...)
@@ -296,7 +335,7 @@ arrLen(char **arr)
return nu;
}
-static char **
+char **
extStrArr(char **arr, char ***strp)
{
char **rarr;
Index: kde-workspace-4.8.5/ksmserver/shutdowndlg.cpp
===================================================================
--- kde-workspace-4.8.5.orig/ksmserver/shutdowndlg.cpp
+++ kde-workspace-4.8.5/ksmserver/shutdowndlg.cpp
@@ -33,6 +33,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE
#include <QLabel>
#include <QPainter>
#include <QMenu>
+#include <QStack>
#include <QTimer>
#include <QTimeLine>
#include <QPaintEvent>
@@ -465,6 +466,7 @@ KSMShutdownDlg::KSMShutdownDlg( QWidget*
m_btnReboot->setFocus();
int def, cur;
+ QString sep = " >> ";
if ( KDisplayManager().bootOptions( rebootOptions, def, cur ) ) {
if ( cur == -1 )
cur = def;
@@ -474,17 +476,27 @@ KSMShutdownDlg::KSMShutdownDlg( QWidget*
connect( rebootActionGroup, SIGNAL(triggered(QAction*)), SLOT(slotReboot(QAction*)) );
m_btnReboot->setPopupMenu( rebootMenu );
- int index = 0;
- for (QStringList::ConstIterator it = rebootOptions.constBegin(); it != rebootOptions.constEnd(); ++it, ++index) {
- QString label = (*it);
- label=label.replace('&',"&&");
- QAction* action = new QAction(label, rebootActionGroup);
- action->setData(index);
- if (index == cur) {
- action->setText( label + i18nc("default option in boot loader", " (default)") );
+ QStack menuStack;
+ menuStack.push(rebootMenu);
+ for (int i = 0; i < rebootOptions.size(); i++) {
+ int n = rebootOptions.at(i).lastIndexOf(sep);
+ QString label = rebootOptions.at(i).mid(n < 0 ? 0 : n + sep.length());
+ label.replace('&', "&&");
+ if (i == cur)
+ label += i18nc("default option in boot loader", " (default)");
+ while (menuStack.size() > 1 && !rebootOptions.at(i).startsWith(menuStack.top()->menuAction()->data().toString() + sep))
+ menuStack.pop();
+ QAction *action;
+ if (i < rebootOptions.size() - 1 && rebootOptions.at(i + 1).startsWith(rebootOptions.at(i) + sep)) { //submenu
+ QMenu *menu = menuStack.top()->addMenu(label);
+ menuStack.push(menu);
+ action = menu->menuAction();
+ } else { //menuentry
+ action = menuStack.top()->addAction(label);
+ rebootActionGroup->addAction(action);
}
+ action->setData(rebootOptions.at(i));
}
- rebootMenu->addActions(rebootActionGroup->actions());
}
}
}
@@ -649,9 +661,7 @@ void KSMShutdownDlg::slotReboot()
void KSMShutdownDlg::slotReboot(QAction* action)
{
- int opt = action->data().toInt();
- if (int(rebootOptions.size()) > opt)
- m_bootOption = rebootOptions[opt];
+ m_bootOption = action->data().toString();
m_shutdownType = KWorkSpace::ShutdownTypeReboot;
accept();
}
++++++ sysconfig.displaymanager-kdm ++++++
## Path: Desktop/Display manager
## Description: settings to generate a proper displaymanager config
## Config: kdm3
## Type: string
## Default:
#
# space separated list of users for which icons should be shown in KDM
# if empty, then take system defaults
#
KDM_USERS=""
## Type: string
## Default:
#
# Special greeting words in kdm
#
KDM_GREETSTRING=""
## Type: string
## Default:
#
# Defines extra Server Arguments given to the kdm display manager when
# starting a local display. Useful to override e.g. the -dpi setting.
#
DISPLAYMANAGER_KDM_LOCALARGS=""
## Type: string
## Default: SUSE
#
# Define the theme to be used by kdm. If empty, the traditional login
# window is used (which lacks some features)
#
DISPLAYMANAGER_KDM_THEME="oxygen-air"
## Type: yesno
## Default: yes
#
# Allow local access of the user root to your display manager. Note
# that root can never login if DISPLAYMANAGER_SHUTDOWN is "auto" and
# System/Security/Permissions/PERMISSION_SECURITY is "paranoid".
# This settings currently works only with KDM.
#
DISPLAYMANAGER_ROOT_LOGIN_LOCAL="yes"
++++++ systemsettings-desktop.diff ++++++
Index: systemsettings/app/systemsettings.desktop
===================================================================
--- systemsettings/app/systemsettings.desktop.orig
+++ systemsettings/app/systemsettings.desktop
@@ -6,7 +6,7 @@ X-DocPath=systemsettings/index.html
X-KDE-StartupNotify=true
OnlyShowIn=KDE;
-GenericName=System Settings
+GenericName=Configure Desktop
GenericName[ar]=إعدادات النظام
GenericName[ast]=Preferencies del sistema
GenericName[be@latin]=Systemnyja nałady
@@ -88,7 +88,7 @@ GenericName[x-test]=xxSystem Settingsxx
GenericName[zh_CN]=系统设置
GenericName[zh_TW]=系統設定
-Name=System Settings
+Name=Configure Desktop
Name[ar]=إعدادات النظام
Name[ast]=Preferencies del sistema
Name[be]=Сістэмныя настаўленні
@@ -175,4 +175,4 @@ Name[zh_CN]=系统设置
Name[zh_TW]=系統設定
X-DBUS-StartupType=Unique
-Categories=Qt;KDE;Settings;
+Categories=Qt;KDE;Settings;X-SuSE-core;Qt;Core;
Index: systemsettings/app/kdesystemsettings.desktop
===================================================================
--- systemsettings/app/kdesystemsettings.desktop.orig
+++ systemsettings/app/kdesystemsettings.desktop
@@ -91,4 +91,4 @@ Name[zh_CN]=KDE 系统设置
Name[zh_TW]=KDE 系統設定
X-DBUS-StartupType=Unique
-Categories=Qt;KDE;Settings;
+Categories=Qt;KDE;Settings;X-SuSE-core;Qt;Core;
++++++ systemsettings-root-kcm.diff ++++++
Index: systemsettings/core/ModuleView.cpp
===================================================================
--- systemsettings/core/ModuleView.cpp.orig
+++ systemsettings/core/ModuleView.cpp
@@ -41,6 +41,7 @@
#include <KStandardGuiItem>
#include <KDialogButtonBox>
#include
+#include <KStandardDirs>
#include "MenuItem.h"
@@ -129,6 +130,40 @@ void ModuleView::loadModule( MenuItem *m
return;
}
+ if ( menuItem->needsRootPrivs() )
+ {
+ QString kdesu = KStandardDirs::findExe( "kdesu" );
+ //kDebug() << "kdesu path:" << kdesu;
+
+ QString cmd = menuItem->service()->exec().trimmed();
+
+ /* Prepare the process to run the kcmshell */
+ if ( cmd.left(5) == "kdesu" )
+ {
+ cmd = cmd.remove(0,5).trimmed();
+
+ /* Remove all kdesu switches */
+ while ( cmd.length() > 1 && cmd[ 0 ] == '-' )
+ cmd = cmd.remove( 0, cmd.indexOf( ' ' ) ).trimmed();
+ }
+
+ if ( cmd.left(9) == "kcmshell4" )
+ cmd = cmd.remove(0,9).trimmed();
+
+ QStringList args;
+ if ( cmd.startsWith('/' ) )
+ // call eg "/sbin/yast2"
+ args << "-i" << QString( menuItem->service()->icon() ) << "-c" << cmd;
+ else
+ args << "-i" << QString( menuItem->service()->icon() ) << "-c" << QString( "%1 %2 --lang %3" ).arg( KStandardDirs::locate("exe", "kcmshell4") ).arg( cmd ).arg( KGlobal::locale()->language() );
+
+ kDebug() << "Starting root module: " << args;
+ QProcess::startDetached( kdesu, args );
+
+ return;
+ }
+
+
QList modules;
if ( menuItem->children().empty() ) {
modules << &menuItem->item();
Index: systemsettings/core/MenuItem.cpp
===================================================================
--- systemsettings/core/MenuItem.cpp.orig
+++ systemsettings/core/MenuItem.cpp
@@ -43,6 +43,7 @@ public:
int weight;
KService::Ptr service;
KCModuleInfo item;
+ bool needsRootPrivs;
};
MenuItem::MenuItem( bool isMenu, MenuItem * itsParent )
@@ -50,6 +51,7 @@ MenuItem::MenuItem( bool isMenu, MenuIte
{
d->parent = itsParent;
d->menu = isMenu;
+ d->needsRootPrivs = false;
if ( d->parent ) {
d->parent->children().append( this );
@@ -123,12 +125,18 @@ bool MenuItem::menu() const
return d->menu;
}
+bool MenuItem::needsRootPrivs() const
+{
+ return d->needsRootPrivs;
+}
+
void MenuItem::setService( const KService::Ptr& service )
{
d->service = service;
d->category = service->property("X-KDE-System-Settings-Category").toString();
d->name = service->name();
d->item = KCModuleInfo( service );
+ d->needsRootPrivs = service->property("X-KDE-RootOnly", QVariant::Bool ).toBool();
const QVariant itemWeight = service->property( "X-KDE-Weight", QVariant::Int );
if( itemWeight.isValid() ) {
d->weight = itemWeight.toInt();
Index: systemsettings/core/MenuItem.h
===================================================================
--- systemsettings/core/MenuItem.h.orig
+++ systemsettings/core/MenuItem.h
@@ -155,6 +155,8 @@ public:
*/
void setService( const KService::Ptr& service );
+ bool needsRootPrivs() const;
+
private:
class Private;
Private *const d;
++++++ workspace_systemd_initial_support.patch ++++++
diff -ur kde-workspace-4.8.0/libs/kworkspace/CMakeLists.txt kde-workspace-4.8.0-systemd-shutdown/libs/kworkspace/CMakeLists.txt
--- kde-workspace-4.8.0/libs/kworkspace/CMakeLists.txt 2012-01-18 21:08:42.000000000 +0100
+++ kde-workspace-4.8.0-systemd-shutdown/libs/kworkspace/CMakeLists.txt 2012-03-01 07:19:09.000000000 +0100
@@ -36,6 +36,11 @@
endif(SOPRANO_PLUGIN_RAPTORPARSER_FOUND AND SHAREDDESKTOPONTOLOGIES_ROOT_DIR)
+option(KWORKSPACE_USE_SYSTEMD "Use systemd instead of ConsoleKit in libkworkspace" OFF)
+if (KWORKSPACE_USE_SYSTEMD)
+ add_definitions(-DKWORKSPACE_USE_SYSTEMD=1)
+endif (KWORKSPACE_USE_SYSTEMD)
+
set(ksmserver_xml ${KDEBASE_WORKSPACE_SOURCE_DIR}/ksmserver/org.kde.KSMServerInterface.xml)
qt4_add_dbus_interface( kworkspace_LIB_SRCS ${ksmserver_xml} ksmserver_interface )
diff -ur kde-workspace-4.8.0/libs/kworkspace/kdisplaymanager.cpp kde-workspace-4.8.0-systemd-shutdown/libs/kworkspace/kdisplaymanager.cpp
--- kde-workspace-4.8.0/libs/kworkspace/kdisplaymanager.cpp 2012-01-18 21:08:42.000000000 +0100
+++ kde-workspace-4.8.0-systemd-shutdown/libs/kworkspace/kdisplaymanager.cpp 2012-03-14 04:19:46.000000000 +0100
@@ -40,6 +40,91 @@
#include
#include
+#ifdef KWORKSPACE_USE_SYSTEMD
+struct NamedDBusObjectPath
+{
+ QString name;
+ QDBusObjectPath path;
+};
+Q_DECLARE_METATYPE(NamedDBusObjectPath)
+Q_DECLARE_METATYPE(QList<NamedDBusObjectPath>)
+
+// Marshall the NamedDBusObjectPath data into a D-Bus argument
+QDBusArgument &operator<<(QDBusArgument &argument, const NamedDBusObjectPath &namedPath)
+{
+ argument.beginStructure();
+ argument << namedPath.name << namedPath.path;
+ argument.endStructure();
+ return argument;
+}
+
+// Retrieve the NamedDBusObjectPath data from the D-Bus argument
+const QDBusArgument &operator>>(const QDBusArgument &argument, NamedDBusObjectPath &namedPath)
+{
+ argument.beginStructure();
+ argument >> namedPath.name >> namedPath.path;
+ argument.endStructure();
+ return argument;
+}
+
+struct NumberedDBusObjectPath
+{
+ uint num;
+ QDBusObjectPath path;
+};
+Q_DECLARE_METATYPE(NumberedDBusObjectPath)
+
+// Marshall the NumberedDBusObjectPath data into a D-Bus argument
+QDBusArgument &operator<<(QDBusArgument &argument, const NumberedDBusObjectPath &numberedPath)
+{
+ argument.beginStructure();
+ argument << numberedPath.num << numberedPath.path;
+ argument.endStructure();
+ return argument;
+}
+
+// Retrieve the NumberedDBusObjectPath data from the D-Bus argument
+const QDBusArgument &operator>>(const QDBusArgument &argument, NumberedDBusObjectPath &numberedPath)
+{
+ argument.beginStructure();
+ argument >> numberedPath.num >> numberedPath.path;
+ argument.endStructure();
+ return argument;
+}
+
+class SystemdManager : public QDBusInterface
+{
+public:
+ SystemdManager() :
+ QDBusInterface(
+ QLatin1String("org.freedesktop.login1"),
+ QLatin1String("/org/freedesktop/login1"),
+ QLatin1String("org.freedesktop.login1.Manager"),
+ QDBusConnection::systemBus()) {}
+};
+
+class SystemdSeat : public QDBusInterface
+{
+public:
+ SystemdSeat(const QDBusObjectPath &path) :
+ QDBusInterface(
+ QLatin1String("org.freedesktop.login1"),
+ path.path(),
+ QLatin1String("org.freedesktop.login1.Seat"),
+ QDBusConnection::systemBus()) {}
+};
+
+class SystemdSession : public QDBusInterface
+{
+public:
+ SystemdSession(const QDBusObjectPath &path) :
+ QDBusInterface(
+ QLatin1String("org.freedesktop.login1"),
+ path.path(),
+ QLatin1String("org.freedesktop.login1.Session"),
+ QDBusConnection::systemBus()) {}
+};
+#else
class CKManager : public QDBusInterface
{
public:
@@ -68,10 +153,11 @@
CKSession(const QDBusObjectPath &path) :
QDBusInterface(
QLatin1String("org.freedesktop.ConsoleKit"),
- path.path(),
+ path.path(),
QLatin1String("org.freedesktop.ConsoleKit.Session"),
QDBusConnection::systemBus()) {}
};
+#endif
class GDMFactory : public QDBusInterface
{
@@ -131,6 +217,11 @@
}
switch (DMType) {
default:
+#ifdef KWORKSPACE_USE_SYSTEMD
+ qDBusRegisterMetaType<NamedDBusObjectPath>();
+ qDBusRegisterMetaType();
+ qDBusRegisterMetaType<NumberedDBusObjectPath>();
+#endif
return;
case NewKDM:
case OldGDM:
@@ -242,6 +333,23 @@
static bool getCurrentSeat(QDBusObjectPath *currentSession, QDBusObjectPath *currentSeat)
{
+#ifdef KWORKSPACE_USE_SYSTEMD
+ SystemdManager man;
+ QDBusReply<QDBusObjectPath> r = man.call(QLatin1String("GetSessionByPID"), (uint) QCoreApplication::applicationPid());
+ if (r.isValid()) {
+ SystemdSession sess(r.value());
+ if (sess.isValid()) {
+ QVariant p = sess.property("Seat");
+ if (p.canConvert<NamedDBusObjectPath>()) {
+ NamedDBusObjectPath namedPath = p.value<NamedDBusObjectPath>();
+ if (currentSession)
+ *currentSession = r.value();
+ *currentSeat = namedPath.path;
+ return true;
+ }
+ }
+ }
+#else
CKManager man;
QDBusReply<QDBusObjectPath> r = man.call(QLatin1String("GetCurrentSession"));
if (r.isValid()) {
@@ -256,11 +364,28 @@
}
}
}
+#endif
return false;
}
static QList<QDBusObjectPath> getSessionsForSeat(const QDBusObjectPath &path)
{
+#ifdef KWORKSPACE_USE_SYSTEMD
+ SystemdSeat seat(path);
+ if (seat.isValid()) {
+ QVariant p = seat.property("Sessions");
+ if (p.canConvert()) {
+ QList<NamedDBusObjectPath> r = p.value();
+ QList<QDBusObjectPath> result;
+ foreach (const NamedDBusObjectPath &namedPath, r)
+ result.append(namedPath.path);
+ // This will contain only local sessions:
+ // - this is only ever called when isSwitchable() is true => local seat
+ // - remote logins into the machine are assigned to other seats
+ return result;
+ }
+ }
+#else
CKSeat seat(path);
if (seat.isValid()) {
QDBusReply r = seat.call(QLatin1String("GetSessions"));
@@ -271,9 +396,18 @@
return r.value();
}
}
+#endif
return QList<QDBusObjectPath>();
}
+#ifdef KWORKSPACE_USE_SYSTEMD
+static void getSessionLocation(SystemdSession &lsess, SessEnt &se)
+{
+ se.tty = (lsess.property("Type").toString() != QLatin1String("x11"));
+ se.display = lsess.property(se.tty ? "TTY" : "Display").toString();
+ se.vt = lsess.property("VTNr").toInt();
+}
+#else
static void getSessionLocation(CKSession &lsess, SessEnt &se)
{
QString tty;
@@ -291,14 +425,20 @@
}
se.vt = tty.mid(strlen("/dev/tty")).toInt();
}
+#endif
#ifndef KDM_NO_SHUTDOWN
bool
KDisplayManager::canShutdown()
{
if (DMType == NewGDM || DMType == NoDM || DMType == LightDM) {
+#ifdef KWORKSPACE_USE_SYSTEMD
+ QDBusReply<QString> canPowerOff = SystemdManager().call(QLatin1String("CanPowerOff"));
+ return (canPowerOff.isValid() && canPowerOff.value() != QLatin1String("no"));
+#else
QDBusReply<bool> canStop = CKManager().call(QLatin1String("CanStop"));
return (canStop.isValid() && canStop.value());
+#endif
}
if (DMType == OldKDM)
@@ -329,9 +469,21 @@
return;
if (DMType == NewGDM || DMType == NoDM || DMType == LightDM) {
+#ifdef KWORKSPACE_USE_SYSTEMD
+ // systemd supports only 2 modes:
+ // * interactive = true: brings up a PolicyKit prompt if other sessions are active
+ // * interactive = false: rejects the shutdown if other sessions are active
+ // There are no schedule or force modes.
+ // We try to map our 4 shutdown modes in the sanest way.
+ bool interactive = (shutdownMode == KWorkSpace::ShutdownModeInteractive
+ || shutdownMode == KWorkSpace::ShutdownModeForceNow);
+ SystemdManager().call(QLatin1String(
+ shutdownType == KWorkSpace::ShutdownTypeReboot ? "Reboot" : "PowerOff"), interactive);
+#else
// FIXME: entirely ignoring shutdownMode
CKManager().call(QLatin1String(
shutdownType == KWorkSpace::ShutdownTypeReboot ? "Restart" : "Stop"));
+#endif
return;
}
@@ -406,12 +558,18 @@
if (DMType == NewGDM || DMType == LightDM) {
QDBusObjectPath currentSeat;
if (getCurrentSeat(0, ¤tSeat)) {
+#ifdef KWORKSPACE_USE_SYSTEMD
+ SystemdSeat seat(currentSeat);
+ if (seat.isValid())
+ return seat.property("CanMultiSession").toBool();
+#else
CKSeat seat(currentSeat);
if (seat.isValid()) {
QDBusReply<bool> r = seat.call(QLatin1String("CanActivateSessions"));
if (r.isValid())
return r.value();
}
+#endif
}
return false;
}
@@ -469,6 +627,21 @@
QDBusObjectPath currentSession, currentSeat;
if (getCurrentSeat(¤tSession, ¤tSeat)) {
foreach (const QDBusObjectPath &sp, getSessionsForSeat(currentSeat)) {
+#ifdef KWORKSPACE_USE_SYSTEMD
+ SystemdSession lsess(sp);
+ if (lsess.isValid()) {
+ SessEnt se;
+ getSessionLocation(lsess, se);
+ if (lsess.property("Class").toString() != QLatin1String("greeter")) {
+ QVariant p = lsess.property("User");
+ NumberedDBusObjectPath numberedPath = p.value<NumberedDBusObjectPath>();
+ se.user = KUser(K_UID(numberedPath.num)).loginName();
+ se.session = "<unknown>";
+ }
+ se.self = (sp == currentSession);
+ list.append(se);
+ }
+#else
CKSession lsess(sp);
if (lsess.isValid()) {
SessEnt se;
@@ -484,6 +657,7 @@
se.self = (sp == currentSession);
list.append(se);
}
+#endif
}
return true;
}
@@ -567,6 +741,21 @@
QDBusObjectPath currentSeat;
if (getCurrentSeat(0, ¤tSeat)) {
foreach (const QDBusObjectPath &sp, getSessionsForSeat(currentSeat)) {
+#ifdef KWORKSPACE_USE_SYSTEMD
+ SystemdSession lsess(sp);
+ if (lsess.isValid()) {
+ SessEnt se;
+ getSessionLocation(lsess, se);
+ if (se.vt == vt) {
+#if 0
+ if (se.tty) // FIXME: Does systemd ignore these like ConsoleKit does?
+ return false;
+#endif
+ lsess.call(QLatin1String("Activate"));
+ return true;
+ }
+ }
+#else
CKSession lsess(sp);
if (lsess.isValid()) {
SessEnt se;
@@ -578,6 +767,7 @@
return true;
}
}
+#endif
}
}
return false;
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org