aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files
diff options
context:
space:
mode:
Diffstat (limited to 'package/base-files')
-rw-r--r--package/base-files/Makefile2
-rwxr-xr-xpackage/base-files/files/lib/functions.sh13
2 files changed, 7 insertions, 8 deletions
diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index e6c53e95a4..077bed469d 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:=177
+PKG_RELEASE:=178
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 4879a3708a..dfadfdb2d9 100755
--- a/package/base-files/files/lib/functions.sh
+++ b/package/base-files/files/lib/functions.sh
@@ -202,7 +202,7 @@ add_group_and_user() {
if [ -n "$gname" ] && [ -n "$gid" ]; then
group_exists "$gname" || group_add "$gname" "$gid"
elif [ -n "$gname" ]; then
- group_add_next "$gname"; gid=$?
+ gid="$(group_add_next "$gname")"
fi
if [ -n "$uname" ]; then
@@ -296,9 +296,7 @@ group_add() {
[ -f "${IPKG_INSTROOT}/etc/group" ] || return 1
[ -n "$IPKG_INSTROOT" ] || lock /var/lock/group
echo "${name}:x:${gid}:" >> ${IPKG_INSTROOT}/etc/group
- rc=$?
[ -n "$IPKG_INSTROOT" ] || lock -u /var/lock/group
- return $rc
}
group_exists() {
@@ -308,14 +306,17 @@ group_exists() {
group_add_next() {
local gid gids
gid=$(grep -s "^${1}:" ${IPKG_INSTROOT}/etc/group | cut -d: -f3)
- [ -n "$gid" ] && return $gid
+ if [ -n "$gid" ]; then
+ echo $gid
+ return
+ fi
gids=$(cat ${IPKG_INSTROOT}/etc/group | cut -d: -f3)
gid=65536
while [ -n "$(echo "$gids" | grep "^$gid$")" ] ; do
gid=$((gid + 1))
done
group_add $1 $gid
- return $gid
+ echo $gid
}
group_add_user() {
@@ -348,9 +349,7 @@ user_add() {
[ -n "$IPKG_INSTROOT" ] || lock /var/lock/passwd
echo "${name}:x:${uid}:${gid}:${desc}:${home}:${shell}" >> ${IPKG_INSTROOT}/etc/passwd
echo "${name}:x:0:0:99999:7:::" >> ${IPKG_INSTROOT}/etc/shadow
- rc=$?
[ -n "$IPKG_INSTROOT" ] || lock -u /var/lock/passwd
- return $rc
}
user_exists() {