mirror of
https://github.com/void-linux/void-packages.git
synced 2025-06-05 06:33:50 +02:00
fprintd: update to 0.9.0.
This commit is contained in:
parent
f3d80b4338
commit
ff6b0cc04a
3 changed files with 18 additions and 131 deletions
|
@ -1,47 +0,0 @@
|
||||||
From 267e6b3238f41b19b61b6502d52769c06df1c8f6 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Bastien Nocera <hadess@hadess.net>
|
|
||||||
Date: Thu, 23 Aug 2018 13:44:14 +0200
|
|
||||||
Subject: [PATCH] device: Fix client_username memory leak
|
|
||||||
|
|
||||||
No need to duplicate that string until we pass it out.
|
|
||||||
|
|
||||||
From https://bugs.launchpad.net/ubuntu/+source/fprintd/+bug/1745455/comments/7
|
|
||||||
---
|
|
||||||
src/device.c | 6 ++----
|
|
||||||
1 file changed, 2 insertions(+), 4 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/device.c b/src/device.c
|
|
||||||
index e9b89bc..a305c9f 100644
|
|
||||||
--- a/src/device.c
|
|
||||||
+++ b/src/device.c
|
|
||||||
@@ -469,7 +469,6 @@ _fprint_device_check_for_username (FprintDevice *rdev,
|
|
||||||
char *sender;
|
|
||||||
unsigned long uid;
|
|
||||||
struct passwd *user;
|
|
||||||
- char *client_username;
|
|
||||||
|
|
||||||
/* Get details about the current sender, and username/uid */
|
|
||||||
conn = dbus_g_connection_get_connection (fprintd_dbus_conn);
|
|
||||||
@@ -490,17 +489,16 @@ _fprint_device_check_for_username (FprintDevice *rdev,
|
|
||||||
"Failed to get information about user UID %lu", uid);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
- client_username = g_strdup (user->pw_name);
|
|
||||||
|
|
||||||
/* The current user is usually allowed to access their
|
|
||||||
* own data, this should be followed by PolicyKit checks
|
|
||||||
* anyway */
|
|
||||||
- if (username == NULL || *username == '\0' || g_str_equal (username, client_username)) {
|
|
||||||
+ if (username == NULL || *username == '\0' || g_str_equal (username, user->pw_name)) {
|
|
||||||
if (ret_sender != NULL)
|
|
||||||
*ret_sender = sender;
|
|
||||||
else
|
|
||||||
g_free (sender);
|
|
||||||
- return client_username;
|
|
||||||
+ return g_strdup (user->pw_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* If we're not allowed to set a different username,
|
|
||||||
--
|
|
||||||
2.18.1
|
|
||||||
|
|
|
@ -1,75 +0,0 @@
|
||||||
From 8de9164be0e4670cd8f3df3c9207a7555228efbf Mon Sep 17 00:00:00 2001
|
|
||||||
From: Bastien Nocera <hadess@hadess.net>
|
|
||||||
Date: Thu, 23 Aug 2018 13:50:49 +0200
|
|
||||||
Subject: [PATCH] main: Fix memory leak when a save fails
|
|
||||||
|
|
||||||
and simplify the flow of that function.
|
|
||||||
|
|
||||||
From https://bugs.launchpad.net/ubuntu/+source/fprintd/+bug/1745455/comments/7
|
|
||||||
---
|
|
||||||
src/file_storage.c | 22 +++++++++++-----------
|
|
||||||
1 file changed, 11 insertions(+), 11 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/file_storage.c b/src/file_storage.c
|
|
||||||
index 6b153ef..1c88be7 100644
|
|
||||||
--- a/src/file_storage.c
|
|
||||||
+++ b/src/file_storage.c
|
|
||||||
@@ -95,16 +95,16 @@ int file_storage_print_data_save(struct fp_print_data *data,
|
|
||||||
enum fp_finger finger, const char *username)
|
|
||||||
{
|
|
||||||
GError *err = NULL;
|
|
||||||
- char *path, *dirpath, *buf;
|
|
||||||
+ char *path, *dirpath;
|
|
||||||
size_t len;
|
|
||||||
int r;
|
|
||||||
char *base_store = NULL;
|
|
||||||
+ char *buf = NULL;
|
|
||||||
|
|
||||||
r = file_storage_get_basestore_for_username(username, &base_store);
|
|
||||||
|
|
||||||
- if (r < 0) {
|
|
||||||
- return r;
|
|
||||||
- }
|
|
||||||
+ if (r < 0)
|
|
||||||
+ goto out;
|
|
||||||
|
|
||||||
len = fp_print_data_get_data(data, (guchar **) &buf);
|
|
||||||
if (!len) {
|
|
||||||
@@ -115,27 +115,27 @@ int file_storage_print_data_save(struct fp_print_data *data,
|
|
||||||
path = __get_path_to_print(fp_print_data_get_driver_id(data), fp_print_data_get_devtype(data), finger, base_store);
|
|
||||||
dirpath = g_path_get_dirname(path);
|
|
||||||
r = g_mkdir_with_parents(dirpath, DIR_PERMS);
|
|
||||||
+ g_free(dirpath);
|
|
||||||
if (r < 0) {
|
|
||||||
- g_free(base_store);
|
|
||||||
g_free(path);
|
|
||||||
- g_free(dirpath);
|
|
||||||
- return r;
|
|
||||||
+ goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
//fp_dbg("saving to %s", path);
|
|
||||||
g_file_set_contents(path, buf, len, &err);
|
|
||||||
- free(buf);
|
|
||||||
- g_free(dirpath);
|
|
||||||
g_free(path);
|
|
||||||
if (err) {
|
|
||||||
r = err->code;
|
|
||||||
//fp_err("save failed: %s", err->message);
|
|
||||||
g_error_free(err);
|
|
||||||
/* FIXME interpret error codes */
|
|
||||||
- return r;
|
|
||||||
+ goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
- return 0;
|
|
||||||
+out:
|
|
||||||
+ g_clear_pointer(&buf, free);
|
|
||||||
+ g_clear_pointer(&base_store, g_free);
|
|
||||||
+ return r;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int load_from_file(char *path, struct fp_print_data **data)
|
|
||||||
--
|
|
||||||
2.18.1
|
|
||||||
|
|
|
@ -1,22 +1,31 @@
|
||||||
# Template file for 'fprintd'
|
# Template file for 'fprintd'
|
||||||
pkgname=fprintd
|
pkgname=fprintd
|
||||||
version=0.8.1
|
version=0.9.0
|
||||||
revision=1
|
revision=1
|
||||||
_release_hash=bdd9f91909f535368b7c21f72311704a
|
wrksrc="fprintd-V_${version//./_}"
|
||||||
build_style=gnu-configure
|
build_style=gnu-configure
|
||||||
configure_args="--sysconfdir=/etc/${pkgname} --disable-static
|
configure_args="--sysconfdir=/etc/${pkgname} --disable-static --without-systemdsystemunitdir"
|
||||||
--without-systemdsystemunitdir"
|
|
||||||
conf_files="/etc/fprintd/fprintd.conf"
|
conf_files="/etc/fprintd/fprintd.conf"
|
||||||
hostmakedepends="intltool pkg-config"
|
hostmakedepends="autoconf automake dbus-glib-devel gettext-devel glib-devel gtk-doc intltool libtool m4 pkg-config"
|
||||||
makedepends="libfprint-devel dbus-devel dbus-glib-devel polkit-devel pam-devel"
|
makedepends="dbus-devel dbus-glib-devel gettext-devel glib-devel libfprint-devel pam-devel polkit-devel"
|
||||||
short_desc="Daemon that provides fingerprint scanning functionality"
|
short_desc="Daemon that provides fingerprint scanning functionality"
|
||||||
maintainer="Enno Boland <gottox@voidlinux.org>"
|
maintainer="Enno Boland <gottox@voidlinux.org>"
|
||||||
license="GPL-2.0-or-later"
|
license="GPL-2.0-or-later"
|
||||||
homepage="https://www.freedesktop.org/wiki/Software/fprint/"
|
homepage="https://www.freedesktop.org/wiki/Software/fprint/"
|
||||||
distfiles="https://gitlab.freedesktop.org/libfprint/fprintd/uploads/${_release_hash}/fprintd-${version}.tar.xz"
|
distfiles="https://gitlab.freedesktop.org/libfprint/fprintd/-/archive/V_${version//./_}/fprintd-V_${version//./_}.tar.bz2"
|
||||||
checksum=34e91fdd0e41d1b57d4417c1ab3c43987dc09012772b8bab7ef46dafd3039a88
|
checksum=3bfbf870a3c333a0a1f08287b2b8501c34fd347faac8c1d52bd0d64ab3474d8e
|
||||||
lib32disabled=yes
|
lib32disabled=yes
|
||||||
patch_args="-Np1"
|
|
||||||
|
pre_configure() {
|
||||||
|
glib-gettextize -c -f
|
||||||
|
gtkdocize --copy
|
||||||
|
intltoolize -c -f
|
||||||
|
libtoolize -c
|
||||||
|
aclocal
|
||||||
|
autoconf
|
||||||
|
autoheader
|
||||||
|
automake -a -c
|
||||||
|
}
|
||||||
|
|
||||||
post_install() {
|
post_install() {
|
||||||
mv $DESTDIR/etc/$pkgname/dbus-1 $DESTDIR/usr/share/dbus-1
|
mv $DESTDIR/etc/$pkgname/dbus-1 $DESTDIR/usr/share/dbus-1
|
||||||
|
|
Loading…
Add table
Reference in a new issue