Move sys_chown() to rep_chown().
authorJelmer Vernooij <jelmer@samba.org>
Sat, 1 Nov 2008 02:27:45 +0000 (03:27 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Sat, 1 Nov 2008 02:27:45 +0000 (03:27 +0100)
lib/replace/README
lib/replace/libreplace.m4
lib/replace/replace.c
lib/replace/replace.h
source3/lib/system.c

index 2f3b37340fc7451688ac391b945fe58856d3b541..a63409580cab476c7c8757d1f6e17ee487cea896 100644 (file)
@@ -46,6 +46,7 @@ mkdtemp
 mkstemp (a secure one!)
 pread
 pwrite
+chown
 getpass
 readline (the library)
 inet_ntoa
index 6f1543863a673100ef90b1b1e3d85e515ff2f4ab..c802525eed10c5e662938c341d54db0d0ee51916 100644 (file)
@@ -108,7 +108,7 @@ AC_CHECK_FUNCS(seteuid setresuid setegid setresgid chroot bzero strerror)
 AC_CHECK_FUNCS(vsyslog setlinebuf mktime ftruncate chsize rename)
 AC_CHECK_FUNCS(waitpid strlcpy strlcat initgroups memmove strdup)
 AC_CHECK_FUNCS(pread pwrite strndup strcasestr strtok_r mkdtemp)
-AC_CHECK_FUNCS(isatty)
+AC_CHECK_FUNCS(isatty chown)
 AC_HAVE_DECL(setresuid, [#include <unistd.h>])
 AC_HAVE_DECL(setresgid, [#include <unistd.h>])
 AC_HAVE_DECL(errno, [#include <errno.h>])
index 98d799b07e8f3950fe30039da961c6944964c34f..74af75ebf12f4b8fc5c3eafd249aa2d3853fb6bf 100644 (file)
@@ -2,6 +2,7 @@
    Unix SMB/CIFS implementation.
    replacement routines for broken systems
    Copyright (C) Andrew Tridgell 1992-1998
+   Copyright (C) Jelmer Vernooij 2005-2008
 
      ** NOTE! The following LGPL license applies to the replace
      ** library. This does NOT imply that all of Samba is released
@@ -614,3 +615,15 @@ int rep_utimes(const char *filename, const struct timeval tv[2])
        return utime(filename, &u);
 }
 #endif
+
+#ifndef HAVE_CHOWN
+/**
+chown isn't used much but OS/2 doesn't have it
+**/
+int rep_chown(const char *fname, uid_t uid, gid_t gid)
+{
+       errno = ENOSYS;
+       return -1;
+}
+#endif
+
index a8164b642b16d5e101c4c6f09285e130ab5b0424..2518d40a65d214886e152bf7a09df58feadcc7a8 100644 (file)
@@ -215,6 +215,11 @@ int rep_seteuid(uid_t);
 int rep_setegid(gid_t);
 #endif
 
+#ifndef HAVE_CHOWN
+#define chown rep_chown
+int rep_chown(const char *path, uid_t uid, gid_t gid);
+#endif
+
 #ifndef HAVE_SETLINEBUF
 #define setlinebuf rep_setlinebuf
 void rep_setlinebuf(FILE *);
index eabb6d6dc48dbca7b1dc7fb9b4ea4b5cec934b2c..7f5f5722550482b24e21f95d2dd286d81a7b336b 100644 (file)
@@ -622,25 +622,6 @@ int sys_link(const char *oldpath, const char *newpath)
 #endif
 }
 
-/*******************************************************************
-chown isn't used much but OS/2 doesn't have it
-********************************************************************/
-
-int sys_chown(const char *fname,uid_t uid,gid_t gid)
-{
-#ifndef HAVE_CHOWN
-       static int done;
-       if (!done) {
-               DEBUG(1,("WARNING: no chown!\n"));
-               done=1;
-       }
-       errno = ENOSYS;
-       return -1;
-#else
-       return(chown(fname,uid,gid));
-#endif
-}
-
 /*******************************************************************
  Wrapper for lchown.
 ********************************************************************/