Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config: Initialize default PORTAGE_USERNAME and PORTAGE_GRPNAME #1416

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions cnf/make.globals
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@ BINPKG_GPG_VERIFY_BASE_COMMAND="/usr/bin/gpg --verify --batch --no-tty --no-auto
# The binary package default GPG home directory for verify
BINPKG_GPG_VERIFY_GPG_HOME="/etc/portage/gnupg"

# The user and group will be used when drop root privileges
PORTAGE_USERNAME="portage"
PORTAGE_GRPNAME="portage"

# The user and group will be used when drop root privileges during GPG verify
GPG_VERIFY_USER_DROP="nobody"
GPG_VERIFY_GROUP_DROP="nogroup"
Expand Down
9 changes: 9 additions & 0 deletions lib/portage/package/ebuild/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1125,6 +1125,15 @@ def __init__(
self["PORTAGE_GRPNAME"] = grp_struct.gr_name
self.backup_changes("PORTAGE_GRPNAME")

else:
if "PORTAGE_USERNAME" not in self:
self["PORTAGE_USERNAME"] = "portage"
self.backup_changes("PORTAGE_USERNAME")

if "PORTAGE_GRPNAME" not in self:
self["PORTAGE_GRPNAME"] = "portage"
self.backup_changes("PORTAGE_GRPNAME")

for var, default_val in default_inst_ids.items():
try:
self[var] = str(int(self.get(var, default_val)))
Expand Down
Loading