from portage import _encodings
from portage import _unicode_decode
from portage import _unicode_encode
-from portage.data import portage_gid
+from portage.data import portage_gid, portage_uid
from portage.package.ebuild.prepare_build_dirs import _ensure_log_subdirs
from portage.util import ensure_dirs, normalize_path
# Only initialize group/mode if the directory doesn't
# exist, so that we don't override permissions if they
# were previously set by the administrator.
- ensure_dirs(logdir, gid=portage_gid, mode=0o2770)
+ # NOTE: These permissions should be compatible with our
+ # default logrotate config as discussed in bug 374287.
+ ensure_dirs(logdir, uid=portage_uid, gid=portage_gid, mode=0o2770)
cat = mysettings['CATEGORY']
pf = mysettings['PF']
from portage import _encodings
from portage import _unicode_decode
from portage import _unicode_encode
-from portage.data import portage_gid
+from portage.data import portage_gid, portage_uid
from portage.localization import _
from portage.package.ebuild.prepare_build_dirs import _ensure_log_subdirs
from portage.util import apply_permissions, ensure_dirs, normalize_path
# Only initialize group/mode if the directory doesn't
# exist, so that we don't override permissions if they
# were previously set by the administrator.
- ensure_dirs(logdir, gid=portage_gid, mode=0o2770)
+ # NOTE: These permissions should be compatible with our
+ # default logrotate config as discussed in bug 374287.
+ ensure_dirs(logdir, uid=portage_uid, gid=portage_gid, mode=0o2770)
elogdir = os.path.join(logdir, "elog")
_ensure_log_subdirs(logdir, elogdir)
try:
modified = ensure_dirs(mysettings["PORT_LOGDIR"])
if modified:
+ # Only initialize group/mode if the directory doesn't
+ # exist, so that we don't override permissions if they
+ # were previously set by the administrator.
+ # NOTE: These permissions should be compatible with our
+ # default logrotate config as discussed in bug 374287.
apply_secpass_permissions(mysettings["PORT_LOGDIR"],
uid=portage_uid, gid=portage_gid, mode=0o2770)
except PortageException as e: