Move sys_link to libreplace.
authorJelmer Vernooij <jelmer@samba.org>
Sat, 1 Nov 2008 02:30:47 +0000 (03:30 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Sat, 1 Nov 2008 02:30:47 +0000 (03:30 +0100)
lib/replace/README
lib/replace/libreplace.m4
lib/replace/replace.c
lib/replace/replace.h
source3/include/proto.h
source3/lib/system.c
source3/modules/vfs_default.c

index a63409580cab476c7c8757d1f6e17ee487cea896..8dcc1006258582d1b745f7e87ffb55beb90f1881 100644 (file)
@@ -65,6 +65,7 @@ getifaddrs
 freeifaddrs
 utime
 utimes
+link
 
 Types:
 bool
index c802525eed10c5e662938c341d54db0d0ee51916..b58575d33d0b13caa5a34bc90b20a1c719843775 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 chown)
+AC_CHECK_FUNCS(isatty chown link)
 AC_HAVE_DECL(setresuid, [#include <unistd.h>])
 AC_HAVE_DECL(setresgid, [#include <unistd.h>])
 AC_HAVE_DECL(errno, [#include <errno.h>])
index 74af75ebf12f4b8fc5c3eafd249aa2d3853fb6bf..adf79321073a1a86a36ae04c5a61ffcc25d3bc37 100644 (file)
@@ -627,3 +627,11 @@ int rep_chown(const char *fname, uid_t uid, gid_t gid)
 }
 #endif
 
+#ifndef HAVE_LINK
+int rep_link(const char *oldpath, const char *newpath)
+{
+       errno = ENOSYS;
+       return -1;
+}
+#endif
+
index 2518d40a65d214886e152bf7a09df58feadcc7a8..7d8bbec18ffb65cb76a4a417ca6f969f8d86493a 100644 (file)
@@ -220,6 +220,11 @@ int rep_setegid(gid_t);
 int rep_chown(const char *path, uid_t uid, gid_t gid);
 #endif
 
+#ifndef HAVE_LINK
+#define link rep_link
+int rep_link(const char *oldpath, const char *newpath);
+#endif
+
 #ifndef HAVE_SETLINEBUF
 #define setlinebuf rep_setlinebuf
 void rep_setlinebuf(FILE *);
index 41ca5a00869e179a9241506673d158cd58f66e88..14d0c2e8dd31b199d19b8ad716952ab7eb058f58 100644 (file)
@@ -1006,7 +1006,6 @@ char *sys_getwd(char *s);
 int sys_symlink(const char *oldpath, const char *newpath);
 int sys_readlink(const char *path, char *buf, size_t bufsiz);
 int sys_link(const char *oldpath, const char *newpath);
-int sys_chown(const char *fname,uid_t uid,gid_t gid);
 int sys_lchown(const char *fname,uid_t uid,gid_t gid);
 int sys_chroot(const char *dname);
 void set_effective_capability(enum smbd_capability capability);
index 7f5f5722550482b24e21f95d2dd286d81a7b336b..cb3551c11e4e2b450f112f7889109bd343834d8d 100644 (file)
@@ -608,20 +608,6 @@ int sys_readlink(const char *path, char *buf, size_t bufsiz)
 #endif
 }
 
-/*******************************************************************
-system wrapper for link
-********************************************************************/
-
-int sys_link(const char *oldpath, const char *newpath)
-{
-#ifndef HAVE_LINK
-       errno = ENOSYS;
-       return -1;
-#else
-       return link(oldpath, newpath);
-#endif
-}
-
 /*******************************************************************
  Wrapper for lchown.
 ********************************************************************/
index 808adf3b282eae0302cf9b3a3d3cf34884aa3d1a..f47ff8fdfc07f4b4f06c6952b217b81b563e6166 100644 (file)
@@ -889,7 +889,7 @@ static int vfswrap_link(vfs_handle_struct *handle,  const char *oldpath, const c
        int result;
 
        START_PROFILE(syscall_link);
-       result = sys_link(oldpath, newpath);
+       result = link(oldpath, newpath);
        END_PROFILE(syscall_link);
        return result;
 }