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

Use proper SELinux context with http.keytab #755

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion ipaserver/install/server/upgrade.py
Expand Up @@ -1427,7 +1427,15 @@ def update_ipa_httpd_service_conf(http):
def update_http_keytab(http):
root_logger.info('[Moving HTTPD service keytab to gssproxy]')
if os.path.exists(paths.OLD_IPA_KEYTAB):
shutil.move(paths.OLD_IPA_KEYTAB, http.keytab)
# ensure proper SELinux context by using copy operation
shutil.copy(paths.OLD_IPA_KEYTAB, http.keytab)
try:
os.remove(paths.OLD_IPA_KEYTAB)
except OSError as e:
root_logger.error(
'Cannot remove file %s (%s). Please remove the file manually.',
paths.OLD_IPA_KEYTAB, e
)
pent = pwd.getpwnam(http.keytab_user)
os.chown(http.keytab, pent.pw_uid, pent.pw_gid)

Expand Down