Menu

#30 [PATCH] lensfun-update-data incorrect check for user name

fixed
None
2015-07-14
2015-07-14
No

lensfun-update-data does not update system-wide data, even when running as root (for example, under su or sudo). The problem is that it uses the getpass.getuser() function, which looks at the environment variables such as USER and USERNAME instead of checking the UID under which the process is running.

The shortest possible patch attached. However, maybe the sys.platform != "win32" check should also be changed to os.name == "posix" instead. See the documentation at

https://docs.python.org/2/library/os.html#os.name

For the reference, I have originally reported it downstream to Fedora bugzilla:
https://bugzilla.redhat.com/show_bug.cgi?id=1242826

1 Attachments

Discussion

  • Torsten Bronger

    Torsten Bronger - 2015-07-14
    • assigned_to: Torsten Bronger
     
  • Torsten Bronger

    Torsten Bronger - 2015-07-14
    • status: open --> fixed
     
  • Torsten Bronger

    Torsten Bronger - 2015-07-14

    Thank you, I applied your changes. Apparently under Ubuntu, the old way actually worked.