rcutil: use realpath to normalize paths for config editing

Summary: This resolves symlinks recursively.

Reviewed By: farnz

Differential Revision: D7639180

fbshipit-source-id: 9f2d29090a63cf0dfc997ae1c84095a2defe329e
This commit is contained in:
Jun Wu 2018-04-16 20:06:28 -07:00 committed by Facebook Github Bot
parent 12466818bb
commit 99467186ae

View File

@ -106,6 +106,7 @@ def editconfig(path, section, name, value):
Try to edit the config in-place without breaking config file syntax for
simple cases. Fallback to just append the new config.
"""
path = os.path.realpath(path)
content = ''
try:
content = util.readfile(path)