You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2021/07/12 11:02:32 UTC

[whimsy] branch master updated: ASF::Person.create does not exist

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 3cd3aa1  ASF::Person.create does not exist
3cd3aa1 is described below

commit 3cd3aa12f8aa35bf63b0c3a399e7047292a1ca8e
Author: Sebb <se...@apache.org>
AuthorDate: Mon Jul 12 12:02:24 2021 +0100

    ASF::Person.create does not exist
---
 lib/whimsy/asf/ldap.rb | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/whimsy/asf/ldap.rb b/lib/whimsy/asf/ldap.rb
index abb5af7..79550a0 100644
--- a/lib/whimsy/asf/ldap.rb
+++ b/lib/whimsy/asf/ldap.rb
@@ -587,13 +587,13 @@ module ASF
       person
     end
 
-    # rename a person
+    # rename a person/committer
     def rename(newid, attrs={})
       # ensure person exists in LDAP
       raise ArgumentError(self.id) unless self.dn
 
-      # create a new person
-      new_person = ASF::Person.create(self.attrs.merge(attrs).merge(uid: newid))
+      # create a new person/committer (this should create new uid/gid numbers, if not overridden)
+      new_person = ASF::Committer.create(self.attrs.merge(attrs).merge(uid: newid))
 
       # determine what groups the individual is a member of
       uid_groups = ASF.search_subtree('dc=apache,dc=org',
@@ -618,6 +618,7 @@ module ASF
       end
 
       # remove original user
+      # TODO: the old entry should probably be disabled instead, to avoid reuse of uid/gid
       ASF::Person.remove(person.id)
 
       # return new user