summaryrefslogtreecommitdiffstats
path: root/booster/src/booster.c
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-05-05 16:04:50 +0530
committerAnand V. Avati <avati@amp.gluster.com>2009-05-05 17:51:16 +0530
commitfe94d6e4992d7b7f2bcee73dfd2b0af76e1f2611 (patch)
tree5053676d7856eddfd0b32fb2988a3e04a8d55a37 /booster/src/booster.c
parent8a3495e7d4b2273746d9e38aefbae583131951ca (diff)
booster: Add lchown API
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'booster/src/booster.c')
-rw-r--r--booster/src/booster.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/booster/src/booster.c b/booster/src/booster.c
index df025b63a55..3f74d7731c0 100644
--- a/booster/src/booster.c
+++ b/booster/src/booster.c
@@ -193,6 +193,7 @@ static ssize_t (*real_getxattr) (const char *path, const char *name,
static ssize_t (*real_lgetxattr) (const char *path, const char *name,
void *value, size_t size);
static int (*real_remove) (const char* path);
+static int (*real_lchown) (const char *path, uid_t owner, gid_t group);
#define RESOLVE(sym) do { \
if (!real_##sym) \
@@ -2036,6 +2037,27 @@ out:
return ret;
}
+int
+lchown (const char *path, uid_t owner, gid_t group)
+{
+ int ret = -1;
+
+ ret = glusterfs_lchown (path, owner, group);
+ if (((ret == -1) && (errno != ENODEV)) || (ret == 0))
+ goto out;
+
+ if (real_lchown == NULL) {
+ errno = ENOSYS;
+ ret = -1;
+ goto out;
+ }
+
+ ret = real_lchown (path, owner, group);
+
+out:
+ return ret;
+}
+
pid_t
fork (void)
{
@@ -2125,6 +2147,7 @@ _init (void)
RESOLVE (getxattr);
RESOLVE (lgetxattr);
RESOLVE (remove);
+ RESOLVE (lchown);
/* This must be called after resolving real functions
* above so that the socket based IO calls in libglusterfsclient