Dan Kenigsberg has posted comments on this change. Change subject: ovirtfunctions: Prevent recursion in safe_delete ......................................................................
Patch Set 1: Code-Review-1 (1 comment) http://gerrit.ovirt.org/#/c/27476/1/src/ovirtnode/ovirtfunctions.py File src/ovirtnode/ovirtfunctions.py: Line 1090: if os.path.isdir(filename): Line 1091: ls_cmd = subprocess_closefds("ls -d '%s'" % filename, shell=True, stdout=PIPE, stderr=STDOUT) Line 1092: output, err = ls_cmd.communicate() Line 1093: for child in output: Line 1094: if os.path.realpath(filename) == os.path.realpath(child): this solves only a case of immediate recursion, where child==parents. It does not avoid grandchild == granddad (or a distant uncle). The reasonable solution (taken by rm -fr dir) is not to follow symbolic links. Line 1095: # Child == Parent - Don't recurse Line 1096: pass Line 1097: else: Line 1098: ovirt_safe_delete_config(child) -- To view, visit http://gerrit.ovirt.org/27476 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic2e89492f4c18c1afd41e399e854fc9be4f091eb Gerrit-PatchSet: 1 Gerrit-Project: ovirt-node Gerrit-Branch: master Gerrit-Owner: Fabian Deutsch <[email protected]> Gerrit-Reviewer: Dan Kenigsberg <[email protected]> Gerrit-Reviewer: Douglas Schilling Landgraf <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ node-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/node-patches
