Commit e8c23bfde24f8e2f57fe4965e613bd46d0c28d1b

Thomas de Grivel 2020-03-29T13:25:48

sync groups before users

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/unix/operations.lisp b/unix/operations.lisp
index 25f291a..735a8df 100644
--- a/unix/operations.lisp
+++ b/unix/operations.lisp
@@ -43,9 +43,15 @@
 
 ;;  User
 
+(defun sync-groups ()
+  (do-resources (res) (current-host)
+    (when (typep res 'group)
+      (sync res))))
+
 (defmethod op-update-user ((user user) (os os-unix)
                            &key ensure uid gid realname home shell
                              login-class groups)
+  (sync-groups)
   (run-as-root
    (join-str " "
              (ecase ensure