mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-05-18 14:21:45 +00:00
adjust /etc/{passwd|shadow|group|gshadow} handling in ubuntu-touch for more info so the log gets all needed data for necessary changes at once
This commit is contained in:
parent
3c40a504ad
commit
00daad436c
8
debian/changelog
vendored
8
debian/changelog
vendored
@ -1,3 +1,11 @@
|
|||||||
|
livecd-rootfs (2.258) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
|
* collect changes to /etc/{passwd|shadow|group|gshadow} in the error output
|
||||||
|
in case they got updated on ubuntu-touch. Give a proper hint what to
|
||||||
|
change to make the error go away on the next run.
|
||||||
|
|
||||||
|
-- Oliver Grawert <ogra@ubuntu.com> Wed, 29 Oct 2014 09:49:56 +0100
|
||||||
|
|
||||||
livecd-rootfs (2.257) utopic; urgency=medium
|
livecd-rootfs (2.257) utopic; urgency=medium
|
||||||
|
|
||||||
* Drop the click packages moved in 2.255 from the rootfs, leaving them
|
* Drop the click packages moved in 2.255 from the rootfs, leaving them
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#!/bin/sh -eu
|
#!/bin/sh -eu
|
||||||
|
|
||||||
|
ERRCNT=""
|
||||||
|
|
||||||
passwd_hash=$(set -- $(md5sum /etc/passwd) && echo $1)
|
passwd_hash=$(set -- $(md5sum /etc/passwd) && echo $1)
|
||||||
shadow_hash=$(set -- $(cat /etc/shadow | sed "s/:.*:0:99999:/:0:99999:/g" | md5sum) && echo $1)
|
shadow_hash=$(set -- $(cat /etc/shadow | sed "s/:.*:0:99999:/:0:99999:/g" | md5sum) && echo $1)
|
||||||
group_length=$(cat /etc/group | wc -l)
|
group_length=$(cat /etc/group | wc -l)
|
||||||
@ -12,26 +14,39 @@ gshadow_orig_length=$(cat /etc/gshadow.orig | wc -l)
|
|||||||
|
|
||||||
if [ "$passwd_hash" != "$passwd_orig_hash" ]; then
|
if [ "$passwd_hash" != "$passwd_orig_hash" ]; then
|
||||||
echo "/etc/passwd has changed during setup." >&2
|
echo "/etc/passwd has changed during setup." >&2
|
||||||
|
echo "The new /etc/passwd md5sum is: $passwd_hash" >&2
|
||||||
diff -Nrup /etc/passwd.orig /etc/passwd >&2
|
diff -Nrup /etc/passwd.orig /etc/passwd >&2
|
||||||
exit 1
|
ERRCNT=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$shadow_hash" != "$shadow_orig_hash" ]; then
|
if [ "$shadow_hash" != "$shadow_orig_hash" ]; then
|
||||||
echo "/etc/shadow has changed during setup." >&2
|
echo "/etc/shadow has changed during setup." >&2
|
||||||
|
echo "The new /etc/shadow md5sum is: $shadow_hash" >&2
|
||||||
diff -Nrup /etc/shadow.orig /etc/shadow >&2
|
diff -Nrup /etc/shadow.orig /etc/shadow >&2
|
||||||
exit 1
|
ERRCNT=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$group_length" != "$group_orig_length" ]; then
|
if [ "$group_length" != "$group_orig_length" ]; then
|
||||||
echo "/etc/group has changed during setup." >&2
|
echo "/etc/group has changed during setup." >&2
|
||||||
diff -Nrup /etc/group.orig /etc/group >&2
|
diff -Nrup /etc/group.orig /etc/group >&2
|
||||||
exit 1
|
ERRCNT=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$gshadow_length" != "$gshadow_orig_length" ]; then
|
if [ "$gshadow_length" != "$gshadow_orig_length" ]; then
|
||||||
echo "/etc/gshadow has changed during setup." >&2
|
echo "/etc/gshadow has changed during setup." >&2
|
||||||
diff -Nrup /etc/gshadow.orig /etc/gshadow >&2
|
diff -Nrup /etc/gshadow.orig /etc/gshadow >&2
|
||||||
exit 1
|
ERRCNT=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$ERRCNT" ]; then
|
||||||
|
echo "There were changes to the password database,"
|
||||||
|
echo "please adjust the values in the livecd-rootfs source in the file:"
|
||||||
|
echo "live-build/ubuntu-touch/hooks/00-uid-gid-fix.chroot_early"
|
||||||
|
echo
|
||||||
|
echo "Please check also if a maintainer script of the package"
|
||||||
|
echo "that added these entries perhaps crated a home directory and,"
|
||||||
|
echo "if needed, add code for creation of it to the above hook"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm /etc/passwd.orig /etc/shadow.orig /etc/group.orig /etc/gshadow.orig
|
rm /etc/passwd.orig /etc/shadow.orig /etc/group.orig /etc/gshadow.orig
|
||||||
|
Loading…
x
Reference in New Issue
Block a user