summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGravatar Ian Nartowicz <iann@crunchbang>2014-05-30 20:42:24 +0100
committerGravatar Ian Nartowicz <iann@crunchbang>2014-05-30 20:42:24 +0100
commitac24e2c9fbde52438e7f0a07e243069dc9859652 (patch)
treeacbcb23720db562871e6747e2a06e56f6fc8b181 /plugins
parent05a0a7247636e6bee40e987fb96c8c7cd012d5d0 (diff)
Preserve file permissions
Diffstat (limited to 'plugins')
-rw-r--r--plugins/vorbis/vcedit.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/vorbis/vcedit.c b/plugins/vorbis/vcedit.c
index 5709f89c..00a3a47f 100644
--- a/plugins/vorbis/vcedit.c
+++ b/plugins/vorbis/vcedit.c
@@ -33,6 +33,7 @@
#include <limits.h>
#include <unistd.h>
#include <stdbool.h>
+#include <sys/stat.h>
#include <ogg/ogg.h>
#include <deadbeef.h>
#include "vcedit.h"
@@ -220,6 +221,11 @@ off_t vcedit_write_metadata(DB_FILE *in, const char *fname, int link, const char
*lasterror = "file not opened for reading.";
goto cleanup;
}
+ struct stat stat_struct;
+ if (stat(fname, &stat_struct) || chmod(outname, stat_struct.st_mode)) {
+ *lasterror = "cannot transfer file permissions.";
+ goto cleanup;
+ }
/* Copy through pages until we reach the right info header */
int codec_serial = 0;