From: Yousong Zhou Date: Thu, 15 Jun 2017 10:07:32 +0000 (+0800) Subject: base-files: allocate uid/gid starting from 65536 X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=f334a0cdb8498dfd2bbb780245e4e0ed0d103ece;p=openwrt%2Fstaging%2Fblogic.git 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 --- diff --git a/package/base-files/Makefile b/package/base-files/Makefile index c669ff0ac67a..54c157611f1c 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/version.mk PKG_NAME:=base-files -PKG_RELEASE:=173 +PKG_RELEASE:=174 PKG_FLAGS:=nonshared PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh index 2b6415a20081..81ef84b8ef8f 100755 --- a/package/base-files/files/lib/functions.sh +++ b/package/base-files/files/lib/functions.sh @@ -306,8 +306,8 @@ group_add_next() { gid=$(grep -s "^${1}:" ${IPKG_INSTROOT}/etc/group | cut -d: -f3) [ -n "$gid" ] && return $gid gids=$(cat ${IPKG_INSTROOT}/etc/group | cut -d: -f3) - gid=100 - while [ -n "$(echo $gids | grep $gid)" ] ; do + gid=65536 + while [ -n "$(echo "$gids" | grep "^$gid$")" ] ; do gid=$((gid + 1)) done group_add $1 $gid @@ -334,8 +334,8 @@ user_add() { local rc [ -z "$uid" ] && { uids=$(cat ${IPKG_INSTROOT}/etc/passwd | cut -d: -f3) - uid=100 - while [ -n "$(echo $uids | grep $uid)" ] ; do + uid=65536 + while [ -n "$(echo "$uids" | grep "^$uid$")" ] ; do uid=$((uid + 1)) done }