Skip to content

Instantly share code, notes, and snippets.

View dvdhrm's full-sized avatar
✔️
Fixing Whitespace, what else would you do at this time?

David Rheinsberg dvdhrm

✔️
Fixing Whitespace, what else would you do at this time?
View GitHub Profile
#define _GNU_SOURCE
#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <unistd.h>
int main(int argc, char **argv)
@dvdhrm
dvdhrm / systemd-authority
Created August 14, 2014 10:55
authorityd
Authority
=========
The systemd authority infrastructure provides authentication and authorization
services to a system via dbus. Privileged processes can query the
authority-daemon to request authorization on behalf of someone else. In other
words, processes that provide services to unprivileged processes can ask for
authorization of that unprivileged process. Furthermore, in case the
authorization is not granted, you might optionally ask for authentication as a
user with sufficient privileges.
diff --git a/util.c b/util.c
index b2c8742..393f696 100644
--- a/util.c
+++ b/util.c
@@ -68,3 +68,151 @@ int kdbus_item_validate_name(const struct kdbus_item *item)
return kdbus_sysname_is_valid(item->str);
}
+
+int kdbus_item_validate(const struct kdbus_item *item)
@dvdhrm
dvdhrm / dummy@.service
Created October 3, 2014 14:15
systemd unit to run systemd-consoled via /bin/login on a VT
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
Description=Dummy Session on %I
After=systemd-user-sessions.service plymouth-quit-wait.service
diff --git a/domain.c b/domain.c
index 90840e7..757e41f 100644
--- a/domain.c
+++ b/domain.c
@@ -28,14 +28,8 @@
#include "limits.h"
#include "util.h"
-/* map of majors to domains */
-static DEFINE_IDR(kdbus_domain_major_idr);
diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c
index 849b91f..8f964b3 100644
--- a/drivers/input/misc/uinput.c
+++ b/drivers/input/misc/uinput.c
@@ -30,11 +30,10 @@
#include <linux/input/mt.h>
#include "../input-compat.h"
-static int uinput_dev_event(struct input_dev *dev,
- unsigned int type, unsigned int code, int value)
diff --git a/domain.c b/domain.c
index 561b0bf..e5ee9ec 100644
--- a/domain.c
+++ b/domain.c
@@ -369,8 +369,15 @@ int kdbus_domain_get_user_unlocked(struct kdbus_domain *domain,
if (!uid_eq(tmp_user->uid, uid))
continue;
- u = kdbus_domain_user_ref(tmp_user);
- goto out;
diff --git a/fs/namei.c b/fs/namei.c
index db5fe86..ea1478d 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -111,6 +111,16 @@
* any extra contention...
*/
+#define PRINT(format, ...) do { \
+ rcu_read_lock(); \
diff --git a/policy.c b/policy.c
index dba1dc3..cdd3b8e 100644
--- a/policy.c
+++ b/policy.c
@@ -282,10 +282,10 @@ int kdbus_policy_check_talk_access(struct kdbus_policy_db *db,
* send access is granted.
*/
+ mutex_lock(&conn_dst->lock);
down_read(&db->entries_rwlock);
From 2fe0094a2b701cb06d0fa062e6d28bbc734fa04e Mon Sep 17 00:00:00 2001
From: David Herrmann <dh.herrmann@gmail.com>
Date: Wed, 26 Nov 2014 17:42:37 +0100
Subject: [PATCH] metadata: provide module-option to set attach-flags masks
A new module option, called "kdbus.attach_flags_mask", can be used to set
a mask of attach-flags that is applied to the input mask on
kdbus_meta_export(). In other words, attach-flags not listed in that mask
will never be returned to user-space.