2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-11-01 11:52:31 +00:00

Fix syncfiles merge update records

The change to fix superset problem also reversed logic
to prefer the 'old' entries to the 'new' entries.  For now,
restore the logic of merge entries superseding existing entries.

What is really warranted is a facility to intelligently sync the account
databases.  Specifically, read in /etc/login.defs, look at UID_MIN and
GID_MIN for the platform.  For UID/GID lower than that, rpms may manage
and such care needs to be given to not change UID/GID, but still need to
update things like shadow and group *membership*, but presrve uid/gid.

Above UID_MIN/GID_MIN, they are user groups and the uid/gid portion is
important in shared filesystem context, so it is imperative that they
work.
This commit is contained in:
Jarrod Johnson
2018-03-08 11:02:29 -05:00
parent ee54a2cc7b
commit 72420d1f00

View File

@@ -86,19 +86,16 @@ for i in $*; do
userlist=$userlisttmp$listend
grepcmd=$grepcmd$userlist
#set -x
grepcmd="$grepcmd $mergefile > $mergefile.nodups"
cp -p $filebackup $filebackup.nodups # preserve ownership and such
grepcmd="$grepcmd $filebackup > $filebackup.nodups"
#echo "grepcmd=$grepcmd"
# now run it
eval $grepcmd
mv $filebackup.nodups $filebackup
fi
# add new entries from mergefile, if any
if [ -a "$mergefile.nodups" ]; then
cat $mergefile.nodups >> $curfile
rm $mergefile.nodups
else # no set intersection, make it a simple append
cat $filebackup $mergefile > $curfile
fi
cat $filebackup $mergefile > $curfile
# now cleanup
rm $filebackup.userlist