archrelease: copy trunk to extra-x86_64
[arch-packages.git] / systemd / trunk / 0001-Use-Arch-Linux-device-access-groups.patch
blob6449c017db0c68b1c74d4d2ecf0eec137a2fa470
1 From f7d07e298c819a81eab965efbdbf53a2ce67fc0e Mon Sep 17 00:00:00 2001
2 From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
3 Date: Tue, 6 Mar 2018 23:39:47 +0100
4 Subject: [PATCH] Use Arch Linux' device access groups
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 cdrom → optical
10 dialout → uucp
11 tape → storage
12 ---
13 meson.build | 6 +++---
14 meson_options.txt | 12 ++++++------
15 rules.d/50-udev-default.rules.in | 14 +++++++-------
16 sysusers.d/basic.conf.in | 6 +++---
17 4 files changed, 19 insertions(+), 19 deletions(-)
19 diff --git a/meson.build b/meson.build
20 index 32e5413a62..f781e06fed 100644
21 --- a/meson.build
22 +++ b/meson.build
23 @@ -796,19 +796,19 @@ conf.set_quoted('NOBODY_GROUP_NAME', nobody_group)
24 static_ugids = []
25 foreach option : ['adm-gid',
26 'audio-gid',
27 - 'cdrom-gid',
28 - 'dialout-gid',
29 'disk-gid',
30 'input-gid',
31 'kmem-gid',
32 'kvm-gid',
33 'lp-gid',
34 + 'optical-gid',
35 'render-gid',
36 'sgx-gid',
37 - 'tape-gid',
38 + 'storage-gid',
39 'tty-gid',
40 'users-gid',
41 'utmp-gid',
42 + 'uucp-gid',
43 'video-gid',
44 'wheel-gid',
45 'systemd-journal-gid',
46 diff --git a/meson_options.txt b/meson_options.txt
47 index 5048de755d..676e5e2e0d 100644
48 --- a/meson_options.txt
49 +++ b/meson_options.txt
50 @@ -235,10 +235,6 @@ option('adm-gid', type : 'integer', value : '-1',
51 description : 'soft-static allocation for the "adm" group')
52 option('audio-gid', type : 'integer', value : '-1',
53 description : 'soft-static allocation for the "audio" group')
54 -option('cdrom-gid', type : 'integer', value : '-1',
55 - description : 'soft-static allocation for the "cdrom" group')
56 -option('dialout-gid', type : 'integer', value : '-1',
57 - description : 'soft-static allocation for the "dialout" group')
58 option('disk-gid', type : 'integer', value : '-1',
59 description : 'soft-static allocation for the "disk" group')
60 option('input-gid', type : 'integer', value : '-1',
61 @@ -249,18 +245,22 @@ option('kvm-gid', type : 'integer', value : '-1',
62 description : 'soft-static allocation for the "kvm" group')
63 option('lp-gid', type : 'integer', value : '-1',
64 description : 'soft-static allocation for the "lp" group')
65 +option('optical-gid', type : 'integer', value : '-1',
66 + description : 'soft-static allocation for the "optical" group')
67 option('render-gid', type : 'integer', value : '-1',
68 description : 'soft-static allocation for the "render" group')
69 option('sgx-gid', type : 'integer', value : '-1',
70 description : 'soft-static allocation for the "sgx" group')
71 -option('tape-gid', type : 'integer', value : '-1',
72 - description : 'soft-static allocation for the "tape" group')
73 +option('storage-gid', type : 'integer', value : '-1',
74 + description : 'soft-static allocation for the "storage" group')
75 option('tty-gid', type : 'integer', value : 5,
76 description : 'the numeric GID of the "tty" group')
77 option('users-gid', type : 'integer', value : '-1',
78 description : 'soft-static allocation for the "users" group')
79 option('utmp-gid', type : 'integer', value : '-1',
80 description : 'soft-static allocation for the "utmp" group')
81 +option('uucp-gid', type : 'integer', value : '-1',
82 + description : 'soft-static allocation for the "uucp" group')
83 option('video-gid', type : 'integer', value : '-1',
84 description : 'soft-static allocation for the "video" group')
85 option('wheel-gid', type : 'integer', value : '-1',
86 diff --git a/rules.d/50-udev-default.rules.in b/rules.d/50-udev-default.rules.in
87 index 18a3cf46bf..f3c440fd89 100644
88 --- a/rules.d/50-udev-default.rules.in
89 +++ b/rules.d/50-udev-default.rules.in
90 @@ -22,7 +22,7 @@ SUBSYSTEM=="tty", KERNEL=="sclp_line[0-9]*", GROUP="tty", MODE="0620"
91 SUBSYSTEM=="tty", KERNEL=="ttysclp[0-9]*", GROUP="tty", MODE="0620"
92 SUBSYSTEM=="tty", KERNEL=="3270/tty[0-9]*", GROUP="tty", MODE="0620"
93 SUBSYSTEM=="vc", KERNEL=="vcs*|vcsa*", GROUP="tty"
94 -KERNEL=="tty[A-Z]*[0-9]|ttymxc[0-9]*|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*", GROUP="dialout"
95 +KERNEL=="tty[A-Z]*[0-9]|ttymxc[0-9]*|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*", GROUP="uucp"
97 SUBSYSTEM=="mem", KERNEL=="mem|kmem|port", GROUP="kmem", MODE="0640"
99 @@ -67,13 +67,13 @@ KERNEL=="irlpt[0-9]*", GROUP="lp"
100 SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}=="*:0701??:*", GROUP="lp"
102 SUBSYSTEM=="block", GROUP="disk"
103 -SUBSYSTEM=="block", KERNEL=="sr[0-9]*", GROUP="cdrom"
104 -SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="4|5", GROUP="cdrom"
105 -KERNEL=="sch[0-9]*", GROUP="cdrom"
106 -KERNEL=="pktcdvd[0-9]*", GROUP="cdrom"
107 -KERNEL=="pktcdvd", GROUP="cdrom"
108 +SUBSYSTEM=="block", KERNEL=="sr[0-9]*", GROUP="optical"
109 +SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="4|5", GROUP="optical"
110 +KERNEL=="sch[0-9]*", GROUP="optical"
111 +KERNEL=="pktcdvd[0-9]*", GROUP="optical"
112 +KERNEL=="pktcdvd", GROUP="optical"
114 -SUBSYSTEM=="scsi_generic|scsi_tape", SUBSYSTEMS=="scsi", ATTRS{type}=="1|8", GROUP="tape"
115 +SUBSYSTEM=="scsi_generic|scsi_tape", SUBSYSTEMS=="scsi", ATTRS{type}=="1|8", GROUP="storage"
116 SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="0", GROUP="disk"
117 KERNEL=="qft[0-9]*|nqft[0-9]*|zqft[0-9]*|nzqft[0-9]*|rawqft[0-9]*|nrawqft[0-9]*", GROUP="disk"
118 KERNEL=="loop-control", GROUP="disk", OPTIONS+="static_node=loop-control"
119 diff --git a/sysusers.d/basic.conf.in b/sysusers.d/basic.conf.in
120 index 8cc1a7cad2..21bb6d8948 100644
121 --- a/sysusers.d/basic.conf.in
122 +++ b/sysusers.d/basic.conf.in
123 @@ -22,17 +22,17 @@ g utmp {{UTMP_GID }} - -
125 # Physical and virtual hardware access groups
126 g audio {{AUDIO_GID }} - -
127 -g cdrom {{CDROM_GID }} - -
128 -g dialout {{DIALOUT_GID}} - -
129 g disk {{DISK_GID }} - -
130 g input {{INPUT_GID }} - -
131 g kmem {{KMEM_GID }} - -
132 g kvm {{KVM_GID }} - -
133 g lp {{LP_GID }} - -
134 +g optical {{OPTICAL_GID}} - -
135 g render {{RENDER_GID }} - -
136 g sgx {{SGX_GID }} - -
137 -g tape {{TAPE_GID }} - -
138 +g storage {{STORAGE_GID}} - -
139 g tty {{TTY_GID }} - -
140 +g uucp {{UUCP_GID }} - -
141 g video {{VIDEO_GID }} - -
143 # Default group for normal users