diff options
Diffstat (limited to 'archival/rpm.c')
-rw-r--r-- | archival/rpm.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/archival/rpm.c b/archival/rpm.c index d399e0ea2..a459839d9 100644 --- a/archival/rpm.c +++ b/archival/rpm.c | |||
@@ -290,8 +290,7 @@ static void fileaction_dobackup(char *filename, int fileref) | |||
290 | if (rpm_getint(RPMTAG_FILEFLAGS, fileref) & RPMFILE_CONFIG) { /* Only need to backup config files */ | 290 | if (rpm_getint(RPMTAG_FILEFLAGS, fileref) & RPMFILE_CONFIG) { /* Only need to backup config files */ |
291 | stat_res = lstat (filename, &oldfile); | 291 | stat_res = lstat (filename, &oldfile); |
292 | if (stat_res == 0 && S_ISREG(oldfile.st_mode)) { /* File already exists - really should check MD5's etc to see if different */ | 292 | if (stat_res == 0 && S_ISREG(oldfile.st_mode)) { /* File already exists - really should check MD5's etc to see if different */ |
293 | newname = xstrdup(filename); | 293 | newname = xasprintf("%s.rpmorig", filename); |
294 | newname = strcat(newname, ".rpmorig"); | ||
295 | copy_file(filename, newname, FILEUTILS_RECUR | FILEUTILS_PRESERVE_STATUS); | 294 | copy_file(filename, newname, FILEUTILS_RECUR | FILEUTILS_PRESERVE_STATUS); |
296 | remove_file(filename, FILEUTILS_RECUR | FILEUTILS_FORCE); | 295 | remove_file(filename, FILEUTILS_RECUR | FILEUTILS_FORCE); |
297 | free(newname); | 296 | free(newname); |