--- posix.c.old 2009-01-16 14:58:25.909272836 +0100 +++ posix.c 2009-01-16 14:56:57.460702199 +0100 @@ -3037,16 +3037,18 @@ /* TODO: handle another flag, GF_SET_OVERWRITE */ - /* Change the mode */ - ret = chmod (pathname, trav->buf.st_mode); - if (ret == -1) { - op_errno = errno; - gf_log (this->name, GF_LOG_ERROR, - "chmod on %s failed: %s", pathname, - strerror (op_errno)); - goto out; - } - + if(!S_ISLNK(trav->buf.st_mode)){ + /* Change the mode */ + ret = chmod (pathname, trav->buf.st_mode); + if (ret == -1) { + op_errno = errno; + gf_log (this->name, GF_LOG_ERROR, + "chmod on %s failed: %s", pathname, + strerror (op_errno)); + goto out; + } + } + /* change the ownership */ ret = lchown (pathname, trav->buf.st_uid, trav->buf.st_gid); if (ret == -1) {