Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/etc/shadow: fix file permissions #2299

Merged
merged 4 commits into from
Dec 8, 2017
Merged

/etc/shadow: fix file permissions #2299

merged 4 commits into from
Dec 8, 2017

Conversation

MilhouseVH
Copy link
Contributor

  1. Now that /etc/shadow is a symbolic link to /storage/.config/shadow the correct file to chmod 000 in the image is /usr/config/shadow. This also avoids the following warning when running fakeroot:
chmod: cannot operate on dangling symlink '/home/neil/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.0-devel/image/system/etc/shadow'
  1. Ensure that /storage/.config/shadow always has the correct 000 file permission.

@MilhouseVH
Copy link
Contributor Author

MilhouseVH commented Dec 7, 2017

Added a second commit that ensures we only match the user at the beginning of the line. For instance, if we tried to add a user avahi-daemon with the old method it would not be added because:

avahi:x:495:495:avahi-daemon:/var/run/avahi-daemon:/bin/sh

@MilhouseVH
Copy link
Contributor Author

Third commit: if we add or remove a user from the build, this won't be reflected in the users personal /storage/.config/shadow file which will be missing the new user (in the case of an add), or still referencing the no longer valid user (in the case of a remove, ie. the user is no longer being added during the build).

This third change always overwrites any existing /storage/.config/shadow file with the default values, while retaining any existing root details from the users /storage/.config/shadow file.

@chewitt chewitt merged commit 4b79f70 into LibreELEC:master Dec 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants