Skip to content
GitLab
    • Explore Projects Groups Topics Snippets
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • fusiondirectory fusiondirectory
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 39
    • Issues 39
    • List
    • Boards
    • Service Desk
    • Milestones
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Terraform modules
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • fusiondirectoryfusiondirectory
  • fusiondirectoryfusiondirectory
  • Issues
  • #1672
Something went wrong while setting issue due date.
Closed
Open
Issue created 12 years ago by bmortier@bmortierMaintainer
  • New related issue

  • New related issue

when copying a user it doesnt generate a new uidnumber and guidnumber

Closed

when copying a user it doesnt generate a new uidnumber and guidnumber

Hello,

when copying a user it doesnt generate a new uidnumber and gidnumber

i have this in my tree

0 uid=toto,ou=people,dc=labo,dc=opensides,dc=be sn: toto givenName: toto uid: toto dateOfBirth: 2012-12-12 gender: M preferredLanguage: fr_FR cn: toto toto homeDirectory: /home/toto gecos: toto toto loginShell: /bin/ash uidNumber: 1101 gidNumber: 1101 host: * objectClass: top objectClass: person objectClass: organizationalPerson objectClass: inetOrgPerson objectClass: gosaAccount objectClass: posixAccount objectClass: shadowAccount objectClass: hostObject sambaLMPassword: BAC14D04669EE1D1AAD3B435B51404EE sambaNTPassword: FBBF55D0EF0E34D39593F55C5F2CA5F2 sambaPwdLastSet: 1354879250 sambaBadPasswordCount: 0 sambaBadPasswordTime: 0

i made a copy and got this

0 uid=toto42,ou=people,dc=labo,dc=opensides,dc=be sn: toto42 givenName: toto uid: toto42 dateOfBirth: 2012-12-12 gender: M preferredLanguage: fr_FR cn: toto toto42 homeDirectory: /home/toto42 gecos: toto toto42 loginShell: /bin/ash uidNumber: 1101 gidNumber: 1101 host: * objectClass: top objectClass: person objectClass: organizationalPerson objectClass: inetOrgPerson objectClass: gosaAccount objectClass: posixAccount objectClass: shadowAccount objectClass: hostObject

has you can see there is the same number as the original for uid/gid

(from redmine: issue id 1672, created on 2012-12-07, closed on 2012-12-11)

  • Changesets:
    • Revision 6e19f1bc by Benoit MORTIER on 2012-12-07T15:13:59.000Z:
Fixes: #1672 when copying a user it doesnt generate a new uidnumber and guidnumber
  • Revision 51cee3c8 by Benoit MORTIER on 2012-12-11T08:30:08.000Z:
Fixes: #1672 when copying a user it doesnt generate a new uidnumber and guidnumber
  • Custom Fields:
    • Bug in version: 1.0.5
  • Uploads:
    • 0001-Fixes-1672.patch
    • 0002-Fixes-1672-when-copying-a-user-it-doesnt-generate-a-.patch
    • 0003-Fixes-1672-when-copying-a-user-it-doesnt-generate-a-.patch

    Tasks

    0

    No tasks are currently assigned. Use tasks to break down this issue into smaller parts.

    Linked items
    0

    Link issues together to show that they're related. Learn more.

    Activity


    • bmortier
      bmortier @bmortier · 12 years ago
      Author Maintainer

      This should fix uidNumber, but I'm not sure about what's going wrong for gid…

      (from redmine: written on 2012-12-07)

      By Côme Chilliet on 2017-09-02T14:53:02 (imported from GitLab)

    • bmortier
      bmortier @bmortier · 12 years ago
      Author Maintainer

      Hello,

      the latest commit break copy-paste

      DEBUG[1] (/usr/share/fusiondirectory/html/main.php:129) - Setting language to: 'en_US.UTF-8' DEBUG[1] (/usr/share/fusiondirectory/include/class_CopyPasteHandler.inc:load_entry_from_queue():145) - load_entry_from_queue: 'uid=toto,ou=people,dc=labo,dc=opensides,dc=be' DEBUG[1] (/usr/share/fusiondirectory/include/class_plugin.inc:plugin():232) - Object check: 'found' DEBUG[1] (/usr/share/fusiondirectory/include/class_plugin.inc:plugin():232) - Object check: 'found' Fatal error: Call to undefined method IntAttribute::setInitialValue() in /usr/share/fusiondirectory/plugins/personal/posix/class_posixAccount.inc on line 352

      Cheers

      (from redmine: written on 2012-12-07)

      By bmortier on 2017-09-02T14:53:02 (imported from GitLab)

    • bmortier
      bmortier @bmortier · 12 years ago
      Author Maintainer

      Hello,

      with the latest fixes it correctly generate a new uidNumber. i also understoud why the guidNumber is not right :)

      when you paste you need also to create a default group like when you create it trought the interface

      look at the ldif here

      original user

      0 uid=toto,ou=people,dc=labo,dc=opensides,dc=be sn: toto givenName: toto uid: toto dateOfBirth: 2012-12-12 gender: M preferredLanguage: fr_FR cn: toto toto homeDirectory: /home/toto gecos: toto toto loginShell: /bin/ash uidNumber: 1101 gidNumber: 1101 host: * objectClass: top objectClass: person objectClass: organizationalPerson objectClass: inetOrgPerson objectClass: gosaAccount objectClass: posixAccount objectClass: shadowAccount objectClass: hostObject sambaLMPassword: BAC14D04669EE1D1AAD3B435B51404EE sambaNTPassword: FBBF55D0EF0E34D39593F55C5F2CA5F2 sambaPwdLastSet: 1354879250 sambaBadPasswordCount: 0 sambaBadPasswordTime: 0

      original group

      0 cn=toto,ou=groups,dc=labo,dc=opensides,dc=be objectClass: top objectClass: posixGroup cn: toto description: Group of user toto gidNumber: 1101

      copied user

      0 uid=toto42,ou=people,dc=labo,dc=opensides,dc=be sn: toto42 givenName: toto42 uid: toto42 dateOfBirth: 2012-12-12 gender: M preferredLanguage: fr_FR cn: toto42 toto42 homeDirectory: /home/toto gecos: toto42 toto42 loginShell: /bin/ash uidNumber: 1103 gidNumber: 1101 host: * objectClass: top objectClass: person objectClass: organizationalPerson objectClass: inetOrgPerson objectClass: gosaAccount objectClass: posixAccount objectClass: shadowAccount objectClass: hostObject

      but no new default group

      root@fusiondirectory-105:/var/cache/fusiondirectory# ldapvi cn=toto42 0 entries read
      No search results. (Maybe use --add or --discover instead?)

      Cheers

      (from redmine: written on 2012-12-07)

      By bmortier on 2017-09-02T14:53:02 (imported from GitLab)

    • bmortier
      bmortier @bmortier · 12 years ago
      Author Maintainer

      Hello,

      i retested it and the it works right now :) the only error left is that i doesnt reset the primary group to automatic it keep the group copied from the original user

      Cheers

      (from redmine: written on 2012-12-10)

      By bmortier on 2017-09-02T14:53:03 (imported from GitLab)

    • bmortier
      bmortier @bmortier · 12 years ago
      Author Maintainer

      Hum, I was expecting that. So, that means I need to detect if the group the user was in was created for him. I suppose I just need to test if the name of the group equals the name of the user? And in that case I switch back to automatic creation. I'm gonna propose a patch that does that, you'll tell me if it's doing what's expected by the end user.

      (from redmine: written on 2012-12-11)

      By Côme Chilliet on 2017-09-02T14:53:03 (imported from GitLab)

    • bmortier
      bmortier @bmortier · 12 years ago
      Author Maintainer

      Hello,

      this work for creating a new group but thz side effect is that you loose the samba atrribute in the cas for the user and the group

      Cheers

      (from redmine: written on 2012-12-11)

      By bmortier on 2017-09-02T14:53:04 (imported from GitLab)

    • bmortier
      bmortier @bmortier · 12 years ago
      Author Maintainer

      I don't understand what you mean. Can you be more specific on what should happen and what actually happen? Is this a posixAccount related problem or a sambaAccount related problem?

      (from redmine: written on 2012-12-11)

      By Côme Chilliet on 2017-09-02T14:53:04 (imported from GitLab)

    • bmortier
      bmortier @bmortier · 12 years ago
      Author Maintainer

      Hello,

      what i mean is with the latest patch you got the new group creation right, but the samba account data is not copied in this case in the user and group created by the copy

      Cheers

      (from redmine: written on 2012-12-11)

      By bmortier on 2017-09-02T14:53:05 (imported from GitLab)

    • bmortier
      bmortier @bmortier · 12 years ago
      Author Maintainer

      This might fix the problem…

      (from redmine: written on 2012-12-11)

      By Côme Chilliet on 2017-09-02T14:53:05 (imported from GitLab)

    • bmortier
      bmortier @bmortier · 12 years ago
      Author Maintainer

      Hello,

      i knew it would break the fonctionnality :) but i patched it anyway ... now it just scream about missing samba SID...

      so maybe this should be done at the end of paste

      /* Handle gidNumber
       * - If we do not have a primary group selected (automatic), we will check if there
       *    is already a group  with the same name and use this as primary.
       * - .. if we couldn't find a group with the same name, we will create a new one,
       *    using the users uid as cn and a generated uniqe gidNumber.

      you cannot set primarygroup = 0 and do nothing because primarygroup is used by samba to add the correct attributes

      Cheers

      (from redmine: written on 2012-12-11)

      By bmortier on 2017-09-02T14:53:05 (imported from GitLab)

    • bmortier
      bmortier @bmortier · 12 years ago
      Author Maintainer

      Hello,

      sorry that was my fault the code is correct, closing this bug

      Cheers

      Close issue

      (from redmine: written on 2012-12-11)

      By bmortier on 2017-09-02T14:53:05 (imported from GitLab)

    • bmortier closed 7 years ago

      closed

      By bmortier on 2017-09-02T14:53:06 (imported from GitLab)

    • bmortier added Fixed PJ1802-0188 fusiondirectory-core and removed Bugs labels 6 years ago

      added Fixed PJ1802-0188 fusiondirectory-core and removed Bugs labels

      By bmortier on 2019-01-24T16:49:34 (imported from GitLab)

    Please register or sign in to reply
    Assignee
    bmortier's avatar
    bmortier
    Assign to
    Labels
    0
    None
    0
    None
      Assign labels
    • Manage project labels

    Milestone
    No milestone
    None
    Due date
    None
    None
    None
    Time tracking
    No estimate or time spent
    Confidentiality
    Not confidential
    Not confidential

    You are going to turn on confidentiality. Only project members with at least the Reporter role, the author, and assignees can view or be notified about this issue.

    Lock issue
    Unlocked
    0
    0 Participants
    Reference:

    Menu

    Explore Projects Groups Topics Snippets