0001-Use-Arch-Linux-device-access-groups.patch 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. From 0e8c18bc2639da328274d02d9222ee2c1f6bf696 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
  8. cdrom → optical
  9. dialout → uucp
  10. tape → storage
  11. ---
  12. meson.build | 6 +++---
  13. meson_options.txt | 12 ++++++------
  14. rules.d/50-udev-default.rules.in | 14 +++++++-------
  15. sysusers.d/basic.conf.in | 6 +++---
  16. 4 files changed, 19 insertions(+), 19 deletions(-)
  17. diff --git a/meson.build b/meson.build
  18. index 76ad51d3fb..5cf679b088 100644
  19. --- a/meson.build
  20. +++ b/meson.build
  21. @@ -915,19 +915,19 @@ conf.set_quoted('NOBODY_GROUP_NAME', nobody_group)
  22. static_ugids = []
  23. foreach option : ['adm-gid',
  24. 'audio-gid',
  25. - 'cdrom-gid',
  26. - 'dialout-gid',
  27. 'disk-gid',
  28. 'input-gid',
  29. 'kmem-gid',
  30. 'kvm-gid',
  31. 'lp-gid',
  32. + 'optical-gid',
  33. 'render-gid',
  34. 'sgx-gid',
  35. - 'tape-gid',
  36. + 'storage-gid',
  37. 'tty-gid',
  38. 'users-gid',
  39. 'utmp-gid',
  40. + 'uucp-gid',
  41. 'video-gid',
  42. 'wheel-gid',
  43. 'systemd-journal-gid',
  44. diff --git a/meson_options.txt b/meson_options.txt
  45. index 814f340840..253a77ecb3 100644
  46. --- a/meson_options.txt
  47. +++ b/meson_options.txt
  48. @@ -257,10 +257,6 @@ option('adm-gid', type : 'integer', value : 0,
  49. description : 'soft-static allocation for the "adm" group')
  50. option('audio-gid', type : 'integer', value : 0,
  51. description : 'soft-static allocation for the "audio" group')
  52. -option('cdrom-gid', type : 'integer', value : 0,
  53. - description : 'soft-static allocation for the "cdrom" group')
  54. -option('dialout-gid', type : 'integer', value : 0,
  55. - description : 'soft-static allocation for the "dialout" group')
  56. option('disk-gid', type : 'integer', value : 0,
  57. description : 'soft-static allocation for the "disk" group')
  58. option('input-gid', type : 'integer', value : 0,
  59. @@ -271,18 +267,22 @@ option('kvm-gid', type : 'integer', value : 0,
  60. description : 'soft-static allocation for the "kvm" group')
  61. option('lp-gid', type : 'integer', value : 0,
  62. description : 'soft-static allocation for the "lp" group')
  63. +option('optical-gid', type : 'integer', value : '0',
  64. + description : 'soft-static allocation for the "optical" group')
  65. option('render-gid', type : 'integer', value : 0,
  66. description : 'soft-static allocation for the "render" group')
  67. option('sgx-gid', type : 'integer', value : 0,
  68. description : 'soft-static allocation for the "sgx" group')
  69. -option('tape-gid', type : 'integer', value : 0,
  70. - description : 'soft-static allocation for the "tape" group')
  71. +option('storage-gid', type : 'integer', value : '0',
  72. + description : 'soft-static allocation for the "storage" group')
  73. option('tty-gid', type : 'integer', value : 5,
  74. description : 'the numeric GID of the "tty" group')
  75. option('users-gid', type : 'integer', value : 0,
  76. description : 'soft-static allocation for the "users" group')
  77. option('utmp-gid', type : 'integer', value : 0,
  78. description : 'soft-static allocation for the "utmp" group')
  79. +option('uucp-gid', type : 'integer', value : '0',
  80. + description : 'soft-static allocation for the "uucp" group')
  81. option('video-gid', type : 'integer', value : 0,
  82. description : 'soft-static allocation for the "video" group')
  83. option('wheel-gid', type : 'integer', value : 0,
  84. diff --git a/rules.d/50-udev-default.rules.in b/rules.d/50-udev-default.rules.in
  85. index 843bdaf9ce..a192f091df 100644
  86. --- a/rules.d/50-udev-default.rules.in
  87. +++ b/rules.d/50-udev-default.rules.in
  88. @@ -26,7 +26,7 @@ SUBSYSTEM=="tty", KERNEL=="sclp_line[0-9]*", GROUP="tty", MODE="0620"
  89. SUBSYSTEM=="tty", KERNEL=="ttysclp[0-9]*", GROUP="tty", MODE="0620"
  90. SUBSYSTEM=="tty", KERNEL=="3270/tty[0-9]*", GROUP="tty", MODE="0620"
  91. SUBSYSTEM=="vc", KERNEL=="vcs*|vcsa*", GROUP="tty"
  92. -KERNEL=="tty[A-Z]*[0-9]|ttymxc[0-9]*|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*", GROUP="dialout"
  93. +KERNEL=="tty[A-Z]*[0-9]|ttymxc[0-9]*|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*", GROUP="uucp"
  94. SUBSYSTEM=="mem", KERNEL=="mem|kmem|port", GROUP="kmem", MODE="0640"
  95. @@ -72,13 +72,13 @@ KERNEL=="irlpt[0-9]*", GROUP="lp"
  96. SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}=="*:0701??:*", GROUP="lp"
  97. SUBSYSTEM=="block", GROUP="disk"
  98. -SUBSYSTEM=="block", KERNEL=="sr[0-9]*", GROUP="cdrom"
  99. -SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="4|5", GROUP="cdrom"
  100. -KERNEL=="sch[0-9]*", GROUP="cdrom"
  101. -KERNEL=="pktcdvd[0-9]*", GROUP="cdrom"
  102. -KERNEL=="pktcdvd", GROUP="cdrom"
  103. +SUBSYSTEM=="block", KERNEL=="sr[0-9]*", GROUP="optical"
  104. +SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="4|5", GROUP="optical"
  105. +KERNEL=="sch[0-9]*", GROUP="optical"
  106. +KERNEL=="pktcdvd[0-9]*", GROUP="optical"
  107. +KERNEL=="pktcdvd", GROUP="optical"
  108. -SUBSYSTEM=="scsi_generic|scsi_tape", SUBSYSTEMS=="scsi", ATTRS{type}=="1|8", GROUP="tape"
  109. +SUBSYSTEM=="scsi_generic|scsi_tape", SUBSYSTEMS=="scsi", ATTRS{type}=="1|8", GROUP="storage"
  110. SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="0", GROUP="disk"
  111. KERNEL=="qft[0-9]*|nqft[0-9]*|zqft[0-9]*|nzqft[0-9]*|rawqft[0-9]*|nrawqft[0-9]*", GROUP="disk"
  112. KERNEL=="loop-control", GROUP="disk", OPTIONS+="static_node=loop-control"
  113. diff --git a/sysusers.d/basic.conf.in b/sysusers.d/basic.conf.in
  114. index a602b872e4..8d38febb6a 100644
  115. --- a/sysusers.d/basic.conf.in
  116. +++ b/sysusers.d/basic.conf.in
  117. @@ -23,17 +23,17 @@ g utmp {{UTMP_GID }} - -
  118. # Physical and virtual hardware access groups
  119. g audio {{AUDIO_GID }} - -
  120. -g cdrom {{CDROM_GID }} - -
  121. -g dialout {{DIALOUT_GID}} - -
  122. g disk {{DISK_GID }} - -
  123. g input {{INPUT_GID }} - -
  124. g kmem {{KMEM_GID }} - -
  125. g kvm {{KVM_GID }} - -
  126. g lp {{LP_GID }} - -
  127. +g optical {{OPTICAL_GID}} - -
  128. g render {{RENDER_GID }} - -
  129. g sgx {{SGX_GID }} - -
  130. -g tape {{TAPE_GID }} - -
  131. +g storage {{STORAGE_GID}} - -
  132. g tty {{TTY_GID }} - -
  133. +g uucp {{UUCP_GID }} - -
  134. g video {{VIDEO_GID }} - -
  135. # Default group for normal users