Ensure correct permissions and file ownership of Apache NSS database
451098
This commit is contained in:
1 parent
6cce2f45e8
commit
ec597b0ef1
1 file changed
+12
@@ -19,6 +19,8 @@
|
||||
#
|
||||
|
||||
import sys
|
||||
import os
|
||||
import pwd
|
||||
|
||||
import traceback
|
||||
|
||||
@@ -144,6 +146,16 @@ def main():
|
||||
print server_cert
|
||||
set_http_cert_name(server_cert[0])
|
||||
|
||||
# Fix the database permissions
|
||||
os.chmod(NSS_DIR + "/cert8.db", 0640)
|
||||
os.chmod(NSS_DIR + "/key3.db", 0640)
|
||||
os.chmod(NSS_DIR + "/secmod.db", 0640)
|
||||
|
||||
pent = pwd.getpwnam("apache")
|
||||
os.chown(NSS_DIR + "/cert8.db", 0, pent.pw_gid )
|
||||
os.chown(NSS_DIR + "/key3.db", 0, pent.pw_gid )
|
||||
os.chown(NSS_DIR + "/secmod.db", 0, pent.pw_gid )
|
||||
|
||||
except Exception, e:
|
||||
print "an unexpected error occurred: %s" % str(e)
|
||||
traceback.print_exc()
|
||||
|
||||
Reference in new issue
Block a user