Skip to content

[Linux] Some python bugs (with fix) in dbi driver #70

Open
@kotee4ko

Description

@kotee4ko

https://github.com/mxmssh/manul/blob/master/dbi_mode.py#L15

#1
15 - return "/usr/tmp/manul_uds_socket_%d"
15 + return "/usr/tmp/manul_uds_socket_%d" % random.randint(1, 999999999)

#2
on Debian 10 Linux l0c4lh05t 5.10.24 #8 SMP Sun Jun 13 01:31:09 EEST 2021 x86_64 GNU/Linux
I don't have /usr/tmp dir.

63 os.unlink(self.ipc_obj_name) return false
and
73 self.sock.bind(self.ipc_obj_name) return crash
FileNotFoundError: [Errno 2] No such file or directory

workaround:

 61         # Make sure the socket does not already exist
 62         if not os.path.exists("/usr/tmp"):
 63             try:
 64                 os.mkdir("/usr/tmp")
 65             except:
 66                 print("Can't create dir with very strange path. Are u root?\n")
 67

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions