Accepting request 502814 from home:mimi_vx:branches:X11:windowmanagers

- update to 2.9
- refresh i3lock-2.5-use-unix2_chkpwd.diff
* Removed obsolete inactivity timeout
* Set font face
* Automatically unlock (without having to press <Enter>) one attempt which was
   entered while authenticating
* Stop leaking the image_path dup
* Displaying locking message when grabbing the pointer/keyboard
* Display error message when locking failed
* Add Enter on C-m
* Change input slices to be exactly pi/3 in size instead of slightly more
* Fix covering of composited notifications using the XComposite extension
* Remove last traces of DPMS

OBS-URL: https://build.opensuse.org/request/show/502814
OBS-URL: https://build.opensuse.org/package/show/X11:windowmanagers/i3lock?expand=0&rev=18
This commit is contained in:
Ondřej Súkup 2017-06-10 16:03:58 +00:00 committed by Git OBS Bridge
parent 35747f7601
commit 1a8be36349
5 changed files with 91 additions and 75 deletions

View File

@ -3,39 +3,42 @@ Date: Sat Feb 15 14:20:27 2014 +0100
add the option to use unix2_chkpwd instead of needing setgid shadow
Index: i3lock-2.8/Makefile
Index: i3lock-2.9/Makefile
===================================================================
--- i3lock-2.8.orig/Makefile
+++ i3lock-2.8/Makefile
@@ -14,7 +14,11 @@ CFLAGS += -Wall
CPPFLAGS += -D_GNU_SOURCE
CFLAGS += $(shell $(PKG_CONFIG) --cflags cairo xcb-dpms xcb-xinerama xcb-atom xcb-image xcb-xkb xkbcommon xkbcommon-x11)
LIBS += $(shell $(PKG_CONFIG) --libs cairo xcb-dpms xcb-xinerama xcb-atom xcb-image xcb-xkb xkbcommon xkbcommon-x11)
+ifeq ($(USE_UNIX2_CHKPWD),1)
+CFLAGS += -DUSE_UNIX2_CHKPWD=1
+else
LIBS += -lpam
+endif
LIBS += -lev
--- i3lock-2.9.orig/Makefile
+++ i3lock-2.9/Makefile
@@ -21,9 +21,13 @@ LIBS += -lev
LIBS += -lm
Index: i3lock-2.8/i3lock.c
# OpenBSD lacks PAM, use bsd_auth(3) instead.
+ifeq ($(USE_UNIX2_CHKPWD),)
++CFLAGS += -DUSE_UNIX2_CHKPWD=1
+else
ifneq ($(UNAME),OpenBSD)
LIBS += -lpam
endif
+endif
FILES:=$(wildcard *.c)
FILES:=$(FILES:.c=.o)
Index: i3lock-2.9/i3lock.c
===================================================================
--- i3lock-2.8.orig/i3lock.c
+++ i3lock-2.8/i3lock.c
@@ -18,7 +18,9 @@
#include <xcb/xkb.h>
#include <err.h>
#include <assert.h>
--- i3lock-2.9.orig/i3lock.c
+++ i3lock-2.9/i3lock.c
@@ -21,8 +21,10 @@
#ifdef __OpenBSD__
#include <bsd_auth.h>
#else
+#ifndef USE_UNIX2_CHKPWD
#include <security/pam_appl.h>
#endif
+#endif
#include <getopt.h>
#include <string.h>
#include <ev.h>
@@ -29,6 +31,13 @@
#include <cairo.h>
#include <cairo/cairo-xcb.h>
@@ -36,6 +38,13 @@
#include <strings.h> /* explicit_bzero(3) */
#endif
+#ifdef USE_UNIX2_CHKPWD
+#include <sys/types.h>
@ -47,20 +50,21 @@ Index: i3lock-2.8/i3lock.c
#include "i3lock.h"
#include "xcb.h"
#include "cursors.h"
@@ -49,7 +58,9 @@ int inactivity_timeout = 30;
uint32_t last_resolution[2];
@@ -57,8 +66,10 @@ uint32_t last_resolution[2];
xcb_window_t win;
static xcb_cursor_t cursor;
#ifndef __OpenBSD__
+#ifndef USE_UNIX2_CHKPWD
static pam_handle_t *pam_handle;
#endif
+#endif
int input_position = 0;
/* Holds the password you enter (in UTF-8). */
static char password[512];
@@ -235,6 +246,62 @@ static void input_done(void) {
unlock_state = STATE_STARTED;
redraw_screen();
@@ -243,6 +254,62 @@ static void clear_auth_wrong(EV_P_ ev_ti
if (retry_verification) {
retry_verification = false;
finish_input();
+#ifdef USE_UNIX2_CHKPWD
+ struct passwd *pw;
+
@ -117,57 +121,59 @@ Index: i3lock-2.8/i3lock.c
+ auth_failed:
+ endpwent();
+#else
if (pam_authenticate(pam_handle, 0) == PAM_SUCCESS) {
DEBUG("successfully authenticated\n");
clear_password_memory();
@@ -248,7 +315,7 @@ static void input_done(void) {
exit(0);
}
}
@@ -256,7 +323,7 @@ static void clear_input(void) {
clear_password_memory();
password[input_position] = '\0';
}
-
+#endif
if (debug_mode)
fprintf(stderr, "Authentication failure\n");
@@ -579,6 +646,7 @@ void handle_screen_resize(void) {
redraw_screen();
static void discard_passwd_cb(EV_P_ ev_timer *w, int revents) {
clear_input();
STOP_TIMER(discard_passwd_timeout);
@@ -592,6 +659,7 @@ static void process_xkb_event(xcb_generi
}
}
+#ifndef USE_UNIX2_CHKPWD
/*
* Callback function for PAM. We only react on password request callbacks.
*
@@ -609,6 +677,7 @@ static int conv_callback(int num_msg, co
return 0;
* Called when the properties on the root window change, e.g. when the screen
* resolution changes. If so we update the window to cover the whole screen
@@ -625,6 +693,7 @@ void handle_screen_resize(void) {
xinerama_query_screens();
redraw_screen();
}
+#endif
#ifndef __OpenBSD__
/*
* This callback is only a dummy, see xcb_prepare_cb and xcb_check_cb.
@@ -764,8 +833,10 @@ int main(int argc, char *argv[]) {
struct passwd *pw;
@@ -814,9 +883,11 @@ int main(int argc, char *argv[]) {
char *username;
char *image_path = NULL;
#ifndef __OpenBSD__
+#ifndef USE_UNIX2_CHKPWD
int ret;
struct pam_conv conv = {conv_callback, NULL};
#endif
+#endif
int curs_choice = CURS_NONE;
int o;
int optind = 0;
@@ -862,12 +933,14 @@ int main(int argc, char *argv[]) {
* the unlock indicator upon keypresses. */
@@ -911,6 +982,7 @@ int main(int argc, char *argv[]) {
srand(time(NULL));
#ifndef __OpenBSD__
+#ifndef USE_UNIX2_CHKPWD
/* Initialize PAM */
if ((ret = pam_start("i3lock", username, &conv, &pam_handle)) != PAM_SUCCESS)
errx(EXIT_FAILURE, "PAM: %s", pam_strerror(pam_handle, ret));
@@ -918,6 +990,7 @@ int main(int argc, char *argv[]) {
if ((ret = pam_set_item(pam_handle, PAM_TTY, getenv("DISPLAY"))) != PAM_SUCCESS)
errx(EXIT_FAILURE, "PAM: %s", pam_strerror(pam_handle, ret));
#endif
+#endif
/* Using mlock() as non-super-user seems only possible in Linux. Users of other
* operating systems should use encrypted swap/no swap (or remove the ifdef and
/* Using mlock() as non-super-user seems only possible in Linux.
* Users of other operating systems should use encrypted swap/no swap

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:028fc0f74df10826514d5a4ed38f6895935d1f5d47ca9fcffc64b076aaf6e2f4
size 19884

3
i3lock-2.9.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8ada0af0f8c03551ba4af138b80d4c853d8c1a88b1c96bddb85c9fcfad2da84d
size 21103

View File

@ -1,3 +1,20 @@
-------------------------------------------------------------------
Sat Jun 10 13:34:49 UTC 2017 - mimi.vx@gmail.com
- update to 2.9
- refresh i3lock-2.5-use-unix2_chkpwd.diff
* Removed obsolete inactivity timeout
* Set font face
* Automatically unlock (without having to press <Enter>) one attempt which was
entered while authenticating
* Stop leaking the image_path dup
* Displaying locking message when grabbing the pointer/keyboard
* Display error message when locking failed
* Add Enter on C-m
* Change input slices to be exactly pi/3 in size instead of slightly more
* Fix covering of composited notifications using the XComposite extension
* Remove last traces of DPMS
-------------------------------------------------------------------
Sun Dec 18 19:05:55 UTC 2016 - mimi.vx@gmail.com

View File

@ -1,7 +1,7 @@
#
# spec file for package i3lock
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2014 B1 Systems GmbH, Vohburg, Germany.
# Copyright (c) 2012 Pascal Bleser <pascal.bleser@opensuse.org>
#
@ -19,13 +19,13 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
Name: i3lock
Version: 2.8
Version: 2.9
Release: 0
Summary: Screen Locker for the i3 Window Manager
License: BSD-3-Clause
Group: System/GUI/Other
Url: http://i3wm.org/i3lock/
Source: http://i3wm.org/i3lock/i3lock-%{version}.tar.bz2
Source1: i3lock.pam
# borrowed from gnome-icon-theme
@ -33,28 +33,21 @@ Source2: i3lock-icon.png
Source3: xlock.sh
# PATCH-FEATURE-OPENSUSE i3lock-2.5-use-unix2_chkpwd.diff -- seife+obs@b1-systems.com
Patch1: i3lock-2.5-use-unix2_chkpwd.diff
Url: http://i3wm.org/i3lock/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: cairo-devel
BuildRequires: gcc
BuildRequires: glib2-devel
BuildRequires: glibc-devel
BuildRequires: libev-devel
%if 0%{?suse_version} > 1310
# /usr/lib64/libEGL.so.1 now requires libudev.so.1, might be a packaging error
BuildRequires: libudev1
%endif
BuildRequires: make
BuildRequires: pam-devel
BuildRequires: pam-modules
BuildRequires: pkgconfig
BuildRequires: pkgconfig(cairo)
BuildRequires: pkgconfig(libev)
BuildRequires: pkgconfig(xcb-atom)
BuildRequires: pkgconfig(xcb-image)
BuildRequires: pkgconfig(xkbcommon) >= 0.5.0
BuildRequires: pkgconfig(xkbcommon-x11)
Requires: pam-modules
BuildRequires: pam-modules
BuildRequires: pkgconfig(xcb-image)
BuildRequires: pkgconfig(xcb-keysyms)
BuildRequires: pkgconfig(xkbcommon) >= 0.5.0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
i3lock is a simple screen locker like slock. After starting it, you will see a
@ -69,7 +62,7 @@ Requires: xdpyinfo
Conflicts: xlockmore
%description xlock-compat
This package provides a script /usr/bin/xlock which calls i3lock to lock your screen.
This package provides a script %{_bindir}/xlock which calls i3lock to lock your screen.
This is handy for hard-coded screen-saver invocations e.g. in XFCE4, so you can use
i3lock instead of xlock with them.
@ -90,7 +83,7 @@ make \
USE_UNIX2_CHKPWD=1 \
PREFIX="%{_prefix}" \
SYSCONFDIR="%{_sysconfdir}" \
DESTDIR="%{buildroot}" \
DESTDIR=%{buildroot} \
install
rm "%{buildroot}%{_sysconfdir}/pam.d/i3lock"
@ -98,7 +91,7 @@ install -m0644 "%{SOURCE1}" "%{buildroot}%{_sysconfdir}/pam.d/%{name}"
install -D -m0644 i3lock.1 "%{buildroot}%{_mandir}/man1/i3lock.1"
install -D -m0644 %{SOURCE2} %{buildroot}/usr/share/i3lock-xlock-compat/i3lock-icon.png
install -D -m0644 %{SOURCE2} %{buildroot}%{_datadir}/i3lock-xlock-compat/i3lock-icon.png
install -m0755 %{SOURCE3} %{buildroot}/%{_bindir}/xlock
%files xlock-compat
@ -111,6 +104,6 @@ install -m0755 %{SOURCE3} %{buildroot}/%{_bindir}/xlock
%doc CHANGELOG LICENSE README.md
%config(noreplace) %{_sysconfdir}/pam.d/%{name}
%{_bindir}/i3lock
%doc %{_mandir}/man1/i3lock.1*
%{_mandir}/man1/i3lock.1*
%changelog