openbmc / phosphor-certificate-manager

Apache License 2.0
6 stars 5 forks source link

Update copyCertificate function to preserve file metadata #22

Closed ZTang813 closed 2 months ago

ZTang813 commented 2 months ago

Cert Manager currently creates a new file with the same content during Certificate::copyCertificate function but doesn’t preserve the file metadata(uid,gid,rwx etc.) from the original file. It's a nice to have feature if both content and file metadata are preserved during the copy. This would be useful for security software running later on to validate the file's integrity and authenticity.

This is achievable by utilizing the cp command. PCM will issue a std::system call to ask the underlying host environment's command processor to execute the cp -fp call.

This PR doesn't change any current business logic to any existing code that depends on PCM.

williamspatrick commented 2 months ago

Please submit via Gerrit. We do not accept PRs on repositories in the organization.