[macOS] User in database lock is root

During translation of the user manual I ‘killed -9’ Gramps in order to make screenshots of the popup windows that appear, when a database is locked at start of Gramps.
To my surprise the user name in the lock file is ‘root’ !!
How can this happen? I never run applications as root.

Looking at the utils.py for the method to create the lock file:

host = os.uname()[1]
# An ugly workaround for os.getlogin() issue with Konsole
try:
    user = os.getlogin()
except:
    # not win, so don't need get_env_var.
    # under cron getlogin() throws and there is no USER.
    user = os.environ.get("USER", "noUSER")

A smal test program

import os

user = os.getlogin()
print(user)
user = os.environ.get("USER", "noUSER")
print(user)

prints the actual user, so I’m really worried if some code in Gramps is running as root and thereby compromises security.

If I run ARM Gramps 6.0.4 from command line, the lock is owned by my username. If I run thru Finder and click on the app, the lock is owned by root. Very strange.

My suggestion is to file a bug and assign to jralls.

1 Like

Thanks Gary.

Bug #13981 created, however I’m not able to assign the report to anyone.

Added to your bug report.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.