summaryrefslogtreecommitdiffstats
path: root/booster
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-05-05 16:01:32 +0530
committerAnand V. Avati <avati@amp.gluster.com>2009-05-05 17:45:35 +0530
commitad4f864c448a3bbcec67d3fb3c44e07993cd70e7 (patch)
treea2cbed0e225c6ccb25a61e0ef762f4f62da56ac0 /booster
parent13610ba31d3b5a60c4d03343438f696725558e65 (diff)
booster: Add chown API
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'booster')
-rw-r--r--booster/src/booster.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/booster/src/booster.c b/booster/src/booster.c
index 0c53b4f9c..eb4f81114 100644
--- a/booster/src/booster.c
+++ b/booster/src/booster.c
@@ -151,6 +151,7 @@ static pid_t (*real_fork) (void);
static int (*real_mkdir) (const char *pathname, mode_t mode);
static int (*real_rmdir) (const char *pathname);
static int (*real_chmod) (const char *pathname, mode_t mode);
+static int (*real_chown) (const char *pathname, uid_t owner, gid_t group);
#define RESOLVE(sym) do { \
if (!real_##sym) \
@@ -1063,6 +1064,25 @@ chmod (const char *pathname, mode_t mode)
return ret;
}
+int
+chown (const char *pathname, uid_t owner, gid_t group)
+{
+ int ret = -1;
+
+ ret = glusterfs_chown (pathname, owner, group);
+
+ if (((ret == -1) && (errno != ENODEV)) || (ret == 0))
+ return ret;
+
+ if (real_chown == NULL) {
+ errno = ENOSYS;
+ ret = -1;
+ } else
+ ret = real_chown (pathname, owner, group);
+
+ return ret;
+}
+
#define MOUNT_TABLE_HASH_SIZE 256
@@ -1235,6 +1255,7 @@ _init (void)
RESOLVE (mkdir);
RESOLVE (rmdir);
RESOLVE (chmod);
+ RESOLVE (chown);
/* This must be called after resolving real functions
* above so that the socket based IO calls in libglusterfsclient