Skip to content

Commit

Permalink
Allow non-root to run pkispawn/pkidestroy
Browse files Browse the repository at this point in the history
pkispawn and pkidestroy have been modified to no longer require
the user to be running as root. Currently non-root users still
cannot complete the installation due to other permission issues,
but eventually a user should be able to create a PKI server for
a rootless systemd service.
  • Loading branch information
edewata committed Jun 4, 2024
1 parent e41fb0d commit c11fab8
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 18 deletions.
4 changes: 0 additions & 4 deletions base/server/python/pki/server/pkidestroy.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@ def main(argv):

interactive = False

# Only run this program as "root".
if not os.geteuid() == 0:
sys.exit("'%s' must be run as root!" % argv[0])

while True:

# -s <subsystem>
Expand Down
4 changes: 0 additions & 4 deletions base/server/python/pki/server/pkispawn.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,6 @@ def main(argv):
else:
validate_user_deployment_cfg(config.user_deployment_cfg)

# Only run this program as "root".
if not os.geteuid() == 0:
sys.exit("'%s' must be run as root!" % argv[0])

while True:
# -s <subsystem>
if args.pki_subsystem is None:
Expand Down
10 changes: 0 additions & 10 deletions tests/dogtag/acceptance/install-tests/ca-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -342,16 +342,6 @@ run_rhcs_ca_installer_tests()
rlAssertGrep "$exp_messg1" "$TmpDir/wrong_ds_passwd.out"
rlPhaseEnd

rlPhaseStartTest "pki_run_rhcs_ca_installer_tests-018: instance creation as non root user"
local username=rhcs
rlRun "useradd $username"
rlRun "cp $INSTANCECFG /home/$username/tmpconfigfile15.in"
rlRun "su -c \"pkispawn -s CA -f /home/$username/tmpconfigfile15.in > /home/$username/nonroot.out 2>&1\" $username" 1 "pkispawn as non-root user should fail"
exp_messg1="'/usr/sbin/pkispawn' must be run as root!"
rlAssertGrep "$exp_messg1" "/home/$username/nonroot.out"
rlRun "userdel -r $username"
rlPhaseEnd


rlPhaseStartTest "pki_run_rhcs_ca_installer_tests-019: special characters in certificate nickname"
local nickname=rh@cs/-$%%!!red^hat
Expand Down

0 comments on commit c11fab8

Please sign in to comment.