Revision 22114677 lib/utils/security.py

b/lib/utils/security.py
100 100
  return cert.digest("sha1")
101 101

  
102 102

  
103
def GenerateNewSslCert(new_cert, cert_filename, serial_no, log_msg):
103
def GenerateNewSslCert(new_cert, cert_filename, serial_no, log_msg,
104
                       uid=-1, gid=-1):
104 105
  """Creates a new SSL certificate and backups the old one.
105 106

  
106 107
  @type new_cert: boolean
......
111 112
  @param serial_no: serial number of the certificate
112 113
  @type log_msg: string
113 114
  @param log_msg: log message to be written on certificate creation
115
  @type uid: int
116
  @param uid: the user ID of the user who will be owner of the certificate file
117
  @type gid: int
118
  @param gid: the group ID of the group who will own the certificate file
114 119

  
115 120
  """
116 121
  cert_exists = os.path.exists(cert_filename)
......
119 124
      io.CreateBackup(cert_filename)
120 125

  
121 126
    logging.debug(log_msg)
122
    x509.GenerateSelfSignedSslCert(cert_filename, serial_no)
127
    x509.GenerateSelfSignedSslCert(cert_filename, serial_no, uid=uid, gid=gid)
123 128

  
124 129

  
125 130
def VerifyCertificate(filename):

Also available in: Unified diff