[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#769961: unblock android-permissions/0.2



Control: tags -1 moreinfo

Hi,

On Mon, Nov 17, 2014 at 10:50:28PM +0100, Hans-Christoph Steiner wrote:
> diff -Nru android-permissions-0.1/debian/postinst
> android-permissions-0.2/debian/postinst
> --- android-permissions-0.1/debian/postinst	2014-09-29 23:29:40.000000000 +0200
> +++ android-permissions-0.2/debian/postinst	2014-11-17 22:40:34.000000000 +0100
> @@ -19,8 +19,17 @@
> 
> 
>  usergroupadd() {
> -	grep -q ^$2: /etc/group || groupadd --system --gid $1  $2
> -	grep -q ^$2: /etc/passwd || useradd --system --gid $1 --uid $1 --home
> /system --comment "$3"  $2
> +    if grep -q ^$2: /etc/group; then
> +        echo "group $2 exists, forcing to gid $1 to match Android"
> +        sed -i "s,^$2:x:[0-9][0-9]*:,$2:x:$1:," /etc/group


Changing existing groups on the system is a bad idea. It might be better to
fail if the groups are not the way you want them.

It's clear that the package is not meant to be installed in situations other
than a chroot on android, but if it is installed anyway, it should not change
existing groups. You could provide a script that does that, if the user wants
to do it manually.

For the use case you describe (adding the packages to debootstrap to make sure
these groups are created very early during the install), this shouldn't be a
problem, as none of these groups should exist in that case.


Cheers,

Ivo


Reply to: