Skip to content

Commit 657549a

Browse files
authored
Merge pull request #38 from liuyongqing/master
fix chmod and chown failed bug
2 parents a43fea6 + e999a0a commit 657549a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
dnl Process this file with autoconf to produce a configure script.
2222

2323
AC_PREREQ(2.59)
24-
AC_INIT(cosfs, 1.0.17)
24+
AC_INIT(cosfs, 1.0.18)
2525
AC_CONFIG_HEADER([config.h])
2626

2727
AC_CANONICAL_SYSTEM

src/s3fs.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,7 +1191,7 @@ static int rename_object(const char* from, const char* to)
11911191
}
11921192
s3_realpath = get_realpath(from);
11931193

1194-
meta["x-cos-copy-source"] = urlEncode(service_path + bucket + "-" + appid + s3_realpath);
1194+
meta["x-cos-copy-source"] = urlEncode(service_path + bucket + "-" + appid + get_realpath(s3_realpath.c_str()));
11951195
meta["Content-Type"] = S3fsCurl::LookupMimeType(string(to));
11961196
meta["x-cos-metadata-directive"] = "REPLACE";
11971197

@@ -1538,7 +1538,7 @@ static int s3fs_chmod(const char* path, mode_t mode)
15381538
}else{
15391539
// normal object or directory object of newer version
15401540
meta["x-cos-meta-mode"] = str(mode);
1541-
meta["x-cos-copy-source"] = urlEncode(service_path + bucket + get_realpath(strpath.c_str()));
1541+
meta["x-cos-copy-source"] = urlEncode(service_path + bucket + "-" + appid + get_realpath(strpath.c_str()));
15421542
meta["x-cos-metadata-directive"] = "REPLACE";
15431543

15441544
if(put_headers(strpath.c_str(), meta, true) != 0){
@@ -1709,7 +1709,7 @@ static int s3fs_chown(const char* path, uid_t uid, gid_t gid)
17091709
}else{
17101710
meta["x-cos-meta-uid"] = str(uid);
17111711
meta["x-cos-meta-gid"] = str(gid);
1712-
meta["x-cos-copy-source"] = urlEncode(service_path + bucket + get_realpath(strpath.c_str()));
1712+
meta["x-cos-copy-source"] = urlEncode(service_path + bucket + "-" + appid + get_realpath(strpath.c_str()));
17131713
meta["x-cos-metadata-directive"] = "REPLACE";
17141714

17151715
if(put_headers(strpath.c_str(), meta, true) != 0){
@@ -1874,7 +1874,7 @@ static int s3fs_utimens(const char* path, const struct timespec ts[2])
18741874
}
18751875
}else{
18761876
meta["x-cos-meta-mtime"] = str(ts[1].tv_sec);
1877-
meta["x-cos-copy-source"] = urlEncode(service_path + bucket + get_realpath(strpath.c_str()));
1877+
meta["x-cos-copy-source"] = urlEncode(service_path + bucket + "-" + appid + get_realpath(strpath.c_str()));
18781878
meta["x-cos-metadata-directive"] = "REPLACE";
18791879

18801880
if(put_headers(strpath.c_str(), meta, true) != 0){

0 commit comments

Comments
 (0)