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
+ DUALCASE=1
+ export DUALCASE
+ test -n ''
+ case `(set -o) 2>/dev/null` in
+ :
+ set -o posix
+ as_nl='
'
+ export as_nl
+ as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
@dvdhrm
dvdhrm / memfd.patch
Created February 28, 2014 18:20
memfd_create() syscall
diff --git a/arch/x86/syscalls/syscall_32.tbl b/arch/x86/syscalls/syscall_32.tbl
index 96bc506..c943b8a 100644
--- a/arch/x86/syscalls/syscall_32.tbl
+++ b/arch/x86/syscalls/syscall_32.tbl
@@ -359,3 +359,4 @@
350 i386 finit_module sys_finit_module
351 i386 sched_setattr sys_sched_setattr
352 i386 sched_getattr sys_sched_getattr
+353 i386 memfd_create sys_memfd_create
diff --git a/arch/x86/syscalls/syscall_64.tbl b/arch/x86/syscalls/syscall_64.tbl
#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/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/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/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(); \