[ARVADOS] created: 2.1.0-1111-gb0a22cf56
Git user
git at public.arvados.org
Tue Jul 27 18:41:29 UTC 2021
at b0a22cf565ffdc9fcc04dcbb3ae875ae36f7411c (commit)
commit b0a22cf565ffdc9fcc04dcbb3ae875ae36f7411c
Author: Ward Vandewege <ward at curii.com>
Date: Tue Jul 27 14:40:19 2021 -0400
17903: use more distribution-agnostic commands to add/remove a user
to/from a group. This makes arvados-login-sync work on CentOS as
well as Debian-based distributions.
Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward at curii.com>
diff --git a/services/login-sync/bin/arvados-login-sync b/services/login-sync/bin/arvados-login-sync
index d8836f19b..8e5c6deb5 100755
--- a/services/login-sync/bin/arvados-login-sync
+++ b/services/login-sync/bin/arvados-login-sync
@@ -144,7 +144,7 @@ begin
if existing_groups.index(addgroup).nil?
# User should be in group, but isn't, so add them.
STDERR.puts "Add user #{username} to #{addgroup} group"
- system("adduser", username, addgroup)
+ system("usermod", "-aG", addgroup, username)
end
end
@@ -152,7 +152,7 @@ begin
if groups.index(removegroup).nil?
# User is in a group, but shouldn't be, so remove them.
STDERR.puts "Remove user #{username} from #{removegroup} group"
- system("deluser", username, removegroup)
+ system("gpasswd", "-d", username, removegroup)
end
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list