Esempio n. 1
0
    def get_id(self, entry):
        checksum = crc32(dn_to_domain(self.parameters['base_dn']))

        if 'entryUUID' in entry:
            return get(entry, 'entryUUID.0')

        if 'uidNumber' in entry:
            return str(uuid2(checksum, int(get(entry, 'uidNumber.0'))))

        if 'gidNumber' in entry:
            return str(uuid2(checksum, int(get(entry, 'gidNumber.0'))))

        return str(uuid.uuid4())
Esempio n. 2
0
    def get_id(self, entry):
        checksum = crc32(dn_to_domain(self.parameters['base_dn']))

        if 'entryUUID' in entry:
            return get(entry, 'entryUUID')

        if 'uidNumber' in entry:
            return str(uuid2(checksum, int(get(entry, 'uidNumber'))))

        if 'gidNumber' in entry:
            return str(uuid2(checksum, int(get(entry, 'gidNumber'))))

        return str(uuid.uuid4())
Esempio n. 3
0
    def _convert_user(self, entry):
        tmp = (self.domain_name or "").encode('utf-8')

        return {
            'id': str(uuid2(crc32(tmp), entry.pw_uid)),
            'uid': entry.pw_uid,
            'gid': entry.pw_gid,
            'builtin': False,
            'username': entry.pw_name,
            'full_name': entry.pw_gecos,
            'shell': entry.pw_shell,
            'home': entry.pw_dir,
            'sshpubkey': None,
            'group': str(uuid2(crc32(tmp), entry.pw_gid)),
            'groups': None,
            'sudo': False,
        }
Esempio n. 4
0
 def _convert_group(self, entry):
     tmp = (self.domain_name or "").encode("utf-8")
     return {
         "id": str(uuid2(crc32(tmp), int(entry.gr_gid))),
         "gid": entry.gr_gid,
         "name": entry.gr_name,
         "parents": None,
         "builtin": False,
         "sudo": False,
     }
Esempio n. 5
0
 def _convert_group(self, entry):
     tmp = (self.domain_name or "").encode('utf-8')
     return {
         'id': str(uuid2(crc32(tmp), int(entry.gr_gid))),
         'gid': entry.gr_gid,
         'name': entry.gr_name,
         'parents': None,
         'builtin': False,
         'sudo': False,
     }
Esempio n. 6
0
 def _convert_group(self, entry):
     tmp = (self.domain_name or "").encode('utf-8')
     return {
         'id': str(uuid2(crc32(tmp), int(entry.gr_gid))),
         'gid': entry.gr_gid,
         'name': entry.gr_name,
         'parents': None,
         'builtin': False,
         'sudo': False,
         }
Esempio n. 7
0
    def _convert_user(self, entry):
        tmp = (self.domain_name or "").encode("utf-8")

        retval = {
            "id": str(uuid2(crc32(tmp), entry.pw_uid)),
            "uid": entry.pw_uid,
            "gid": entry.pw_gid,
            "builtin": False,
            "username": entry.pw_name,
            "full_name": entry.pw_gecos,
            "shell": entry.pw_shell,
            "home": entry.pw_dir,
            "sshpubkey": None,
            "group": str(uuid2(crc32(tmp), entry.pw_gid)),
            "groups": None,
            "sudo": False,
        }
        if entry.pw_passwd and entry.pw_passwd != "*":
            retval["unixhash"] = entry.pw_passwd
        else:
            retval["unixhash"] = None

        return retval
Esempio n. 8
0
    def _convert_user(self, entry):
        tmp = (self.domain_name or "").encode('utf-8')

        retval = {
            'id': str(uuid2(crc32(tmp), entry.pw_uid)),
            'uid': entry.pw_uid,
            'gid': entry.pw_gid,
            'builtin': False,
            'username': entry.pw_name,
            'full_name': entry.pw_gecos,
            'shell': entry.pw_shell,
            'home': entry.pw_dir,
            'sshpubkey': None,
            'group': str(uuid2(crc32(tmp), entry.pw_gid)),
            'groups': None,
            'sudo': False,
        }
        if entry.pw_passwd and entry.pw_passwd != "*":
            retval['unixhash'] = entry.pw_passwd
        else:
            retval['unixhash'] = None

        return retval
Esempio n. 9
0
    def _convert_user(self, entry):
        tmp = (self.domain_name or "").encode('utf-8')
        
        retval = {
            'id': str(uuid2(crc32(tmp), entry.pw_uid)),
            'uid': entry.pw_uid,
            'gid': entry.pw_gid,
            'builtin': False,
            'username': entry.pw_name,
            'full_name': entry.pw_gecos,
            'shell': entry.pw_shell,
            'home': entry.pw_dir,
            'sshpubkey': None,
            'group': str(uuid2(crc32(tmp), entry.pw_gid)),
            'groups': None,
            'sudo': False,
            }
        if entry.pw_passwd and entry.pw_passwd != "*":
            retval['unixhash'] = entry.pw_passwd
        else:
            retval['unixhash'] = None

        return retval