From 797ce28336ecc03e3d586bbed8120e2f080f29f7 Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Mon, 10 Sep 2012 20:53:45 -0500 Subject: [PATCH] Use python, not groups to grab a user group in t/test-meta.sh. Group names may actually contain spaces, and since the groups commmand only reports a space-delimited list of groups on stdout, we had a problem. Thanks to "Oei, Yung-Chin" and Gabriel Filion for tracking this down. Signed-off-by: Rob Browning Reviewed-by: Zoran Zaric --- t/test-meta.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/test-meta.sh b/t/test-meta.sh index 3ce1d55..ba7e218 100755 --- a/t/test-meta.sh +++ b/t/test-meta.sh @@ -220,8 +220,8 @@ WVSTART 'meta --edit' WVPASS bup xstat src | grep -qvE '^user: root' # Make sure we can restore one of the user's groups. - user_groups="$(groups)" - last_group="$(echo ${user_groups/* /})" + last_group="$(python -c 'import os,grp; \ + print grp.getgrgid(os.getgroups()[0])[0]')" rm -rf src WVPASS bup meta --edit --set-group "$last_group" ../src.meta \ | WVPASS bup meta -x -- 2.39.2