Ejemplo n.º 1
0
 def __init__(self, conf, map_name=None, automount_mountpoint=None):
     if map_name is None: map_name = config.MAP_PASSWORD
     super(FilesPasswdMapHandler,
           self).__init__(conf,
                          map_name,
                          automount_mountpoint=automount_mountpoint)
     self.map_parser = file_formats.FilesPasswdMapParser()
Ejemplo n.º 2
0
    def testReadPasswdEntry(self):
        """We correctly parse a typical entry in /etc/passwd format."""
        parser = file_formats.FilesPasswdMapParser()
        file_entry = 'root:x:0:0:Rootsy:/root:/bin/bash'
        map_entry = parser._ReadEntry(file_entry)

        self.assertEqual(map_entry.name, 'root')
        self.assertEqual(map_entry.passwd, 'x')
        self.assertEqual(map_entry.uid, 0)
        self.assertEqual(map_entry.gid, 0)
        self.assertEqual(map_entry.gecos, 'Rootsy')
        self.assertEqual(map_entry.dir, '/root')
        self.assertEqual(map_entry.shell, '/bin/bash')
Ejemplo n.º 3
0
 def GetParser(self):
     """Returns a MapParser to parse FilesPasswd cache."""
     return file_formats.FilesPasswdMapParser()