base-files: allocate uid/gid starting from 65536

There already exist static assignment of uid/gid 65533 in packages feed
and we have nobody/nogroup taking 65534 as their ids.  Let's change the
pid of dynamic assignment to start from 65536 so that the two assignment
scheme will not collide with each other

While at it, fix the scan command checking existence of uid/gid

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
This commit is contained in:
Yousong Zhou 2017-06-15 18:07:32 +08:00
parent 3ccca56eb0
commit f334a0cdb8
2 changed files with 5 additions and 5 deletions

View file

@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/version.mk include $(INCLUDE_DIR)/version.mk
PKG_NAME:=base-files PKG_NAME:=base-files
PKG_RELEASE:=173 PKG_RELEASE:=174
PKG_FLAGS:=nonshared PKG_FLAGS:=nonshared
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/

View file

@ -306,8 +306,8 @@ group_add_next() {
gid=$(grep -s "^${1}:" ${IPKG_INSTROOT}/etc/group | cut -d: -f3) gid=$(grep -s "^${1}:" ${IPKG_INSTROOT}/etc/group | cut -d: -f3)
[ -n "$gid" ] && return $gid [ -n "$gid" ] && return $gid
gids=$(cat ${IPKG_INSTROOT}/etc/group | cut -d: -f3) gids=$(cat ${IPKG_INSTROOT}/etc/group | cut -d: -f3)
gid=100 gid=65536
while [ -n "$(echo $gids | grep $gid)" ] ; do while [ -n "$(echo "$gids" | grep "^$gid$")" ] ; do
gid=$((gid + 1)) gid=$((gid + 1))
done done
group_add $1 $gid group_add $1 $gid
@ -334,8 +334,8 @@ user_add() {
local rc local rc
[ -z "$uid" ] && { [ -z "$uid" ] && {
uids=$(cat ${IPKG_INSTROOT}/etc/passwd | cut -d: -f3) uids=$(cat ${IPKG_INSTROOT}/etc/passwd | cut -d: -f3)
uid=100 uid=65536
while [ -n "$(echo $uids | grep $uid)" ] ; do while [ -n "$(echo "$uids" | grep "^$uid$")" ] ; do
uid=$((uid + 1)) uid=$((uid + 1))
done done
} }