Menu

#341 removes _client.so on production deployment when run as root

Future
open
nobody
None
na
2021-01-05
2018-11-26
No

If LIRC is installed on a read-only filesytem lirc-setup will fail due to:

if os.path.exists(os.path.join(HERE, '_client.so')):
    try:
        os.unlink(os.path.join(HERE, '_client.so'))
    except PermissionError:
        pass

in python-pkg/lirc/paths.py. That code is not accounting for all possible exceptions including the OSError possibilities such as EROFS.

As an aside, this is pretty nasty code to be included in production depoyment. If it's run as root, on a system where the filesystem it resides on is not read-only, this nukes a needed file and does not restore it, leaving the system broken. Something should be done to guard against that. Either refuse to run as root or don't do any of that removing/restoring the file shennanigans in a production installation.

Discussion

  • Geiger David

    Geiger David - 2019-01-16

    Hi,

    Same issue here on Mageia Cauldron!

    Regards,
    David

     
  • Jakub Leska

    Jakub Leska - 2021-01-05

    Hi,
    I just came across this issue too, it is really hard to find out what is going on especially when the file disappears.
    Is there something else than lack of time/priority what blocking this from being fixed? Can I help somehow?

    Best regards,
    Jakub

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.