Accepting request 504488 from home:kukuk:sysusers

Split of system-users to solve build and dependency cycles

OBS-URL: https://build.opensuse.org/request/show/504488
OBS-URL: https://build.opensuse.org/package/show/Base:System/system-user-root?expand=0&rev=1
This commit is contained in:
Dirk Mueller 2017-06-18 21:33:40 +00:00 committed by Git OBS Bridge
commit 888a4ae548
5 changed files with 116 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

5
system-user-root.changes Normal file
View File

@ -0,0 +1,5 @@
-------------------------------------------------------------------
Sat Jun 17 12:41:57 CEST 2017 - kukuk@suse.de
- New package, splitted from system-users

11
system-user-root.conf Normal file
View File

@ -0,0 +1,11 @@
# Type Name ID GECOS [HOME]
# The superuser
g root 0 -
u root 0 root /root
# Group owner of /etc/shadow
g shadow 15 -
# Default group for normal users
g users 100 -

76
system-user-root.spec Normal file
View File

@ -0,0 +1,76 @@
#
# spec file for package system-users
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: system-user-root
Version: 20170617
Release: 0
Summary: System user and group root
License: MIT
Group: System/Fhs
Source1: system-user-root.conf
BuildArch: noarch
Provides: group(root)
Provides: group(shadow)
Provides: group(users)
Provides: user(root)
%description
This package provides the root account including the groups root,
shadow and users.
%prep
%setup -q -c -T
%build
%install
mkdir -p %{buildroot}%{_sysusersdir}
install -m 644 %{SOURCE1} %{buildroot}%{_sysusersdir}/system-user-root.conf
%pre -p <lua>
if not posix.access("/etc", "f") then
posix.mkdir("/etc")
end
if not posix.access("/etc/passwd", "f") then
file = io.open("/etc/passwd", "a+")
file:write("root:x:0:0:root:/root:/bin/bash\n")
file:close()
posix.chmod("/etc/passwd", 0644)
end
if not posix.access("/etc/group", "f") then
file = io.open("/etc/group", "a+")
file:write("root:x:0:\nshadow:x:15:\nusers:x:100:\n")
file:close()
posix.chmod("/etc/group", 0644)
end
if not posix.access("/etc/shadow", "f") then
file = io.open("/etc/shadow", "a+")
local date = os.time()
date = math.floor(date / 86400)
file:write("root::", date, "::::::\n")
file:close()
posix.chown("/etc/shadow", 0, 15)
posix.chmod("/etc/shadow", 0640)
end
%files
%defattr(-,root,root)
%{_sysusersdir}/system-user-root.conf
%changelog