[vhffs-dev] [1607] as suggested by xavier, we don't need to modify the "oldpath" argument of symlink(), we should rely on what user provided |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
- To: vhffs-dev@xxxxxxxxx
- Subject: [vhffs-dev] [1607] as suggested by xavier, we don't need to modify the "oldpath" argument of symlink(), we should rely on what user provided
- From: subversion@xxxxxxxxxxxxx
- Date: Thu, 13 May 2010 15:31:42 +0200
Revision: 1607
Author: gradator
Date: 2010-05-13 15:31:42 +0200 (Thu, 13 May 2010)
Log Message:
-----------
as suggested by xavier, we don't need to modify the "oldpath" argument of symlink(), we should rely on what user provided
Modified Paths:
--------------
trunk/vhffs-fs/vhffsfs.c
Modified: trunk/vhffs-fs/vhffsfs.c
===================================================================
--- trunk/vhffs-fs/vhffsfs.c 2010-05-12 00:10:38 UTC (rev 1606)
+++ trunk/vhffs-fs/vhffsfs.c 2010-05-13 13:31:42 UTC (rev 1607)
@@ -1409,31 +1409,23 @@
static int vhffsfs_symlink(const char *from, const char *to)
{
int res;
- char *rfrom, *rto;
+ char *rto;
uid_t uid;
gid_t gid;
- rfrom = vhffsfs_realpath(from, NULL, NULL);
- if(!rfrom) return -ENOENT;
-
rto = vhffsfs_realpath(to, &uid, &gid);
- if(!rto) {
- free(rfrom);
- return -ENOENT;
- }
+ if(!rto) return -ENOENT;
#ifdef WITH_CHECKQUOTA
res = vhffsfs_checkquota_gid_with_realpath(rto, gid, 0, 1);
- if(res) {
- free(rfrom);
+ if(res) {
free(rto);
return -EDQUOT;
}
#endif
- res = symlink(rfrom, rto);
+ res = symlink(from, rto);
if(res == 0) lchown(rto, uid, gid);
- free(rfrom);
free(rto);
if(res == -1) return -errno;