Copilot commented on code in PR #13473:
URL: https://github.com/apache/trafficserver/pull/13473#discussion_r3696510202


##########
tests/gold_tests/pluginTest/certifier/certifier.test.py:
##########
@@ -45,7 +45,10 @@ def setupTS(self):
         # copy over the cert store in which the certs will be generated/stored
         self.certPathDest = os.path.join(self.ts.Variables.CONFIGDIR, 
"certifier-certs")
         Setup.Copy(self.certPathSrc, self.certPathDest)
-        Setup.MakeDir(os.path.join(self.certPathDest, 'store'))
+        store_path = os.path.join(self.certPathDest, 'store')
+        serial_path = os.path.join(self.certPathDest, 'ca-serial.txt')
+        Setup.MakeDir(store_path)
+        Setup.RunCommand(f'chmod a+rw {serial_path} && chmod a+rwx 
{store_path}')

Review Comment:
   Using Setup.RunCommand with an unquoted shell command (and `&&`) is brittle: 
paths with spaces/shell metacharacters will break, and this needlessly invokes 
a shell. Prefer adjusting permissions via Python (os.chmod) in-process.
   
   This issue also appears in the following locations of the same file:
   - line 135
   - line 195
   - line 261



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to