"mender-artifact modify" deletes unrelated files in same directory

Description

The mender-artifact "modify" command deletes the file "mender_test.img" if it is in the same directory as the artifact being modified. This can cause unexpected loss of data. Example:

$ dir
total 520K
rw-rr- 1 don don 512K Sep 27 14:57 mender_test.img
rw-rr- 1 don don 7.0K Sep 27 14:58 x.mender

$ mender-artifact modify -n octopus x.mender

$ dir
total 8.0K
rw------ 1 don don 7.0K Sep 27 15:08 x.mender

I suspect the file is deleted because it has the same name as the embedded image file, and was overwritten for temporary usage during the modify operation.

Affects versions

None

Environment

None

Attachments

1

Checklist

Activity

Show:

Ole Petter OrhagenOctober 8, 2018 at 4:54 PM

Fixed

Details

Assignee

Reporter

Priority

Zendesk Support

Checklist

Created September 27, 2018 at 8:37 PM
Updated October 12, 2018 at 7:57 AM
Resolved October 12, 2018 at 7:57 AM