Remove sys_chroot() - libreplace already provides an alternative.
authorJelmer Vernooij <jelmer@samba.org>
Sat, 1 Nov 2008 02:46:09 +0000 (03:46 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Sat, 1 Nov 2008 02:46:09 +0000 (03:46 +0100)
lib/replace/replace.c
lib/replace/replace.h
source3/configure.in
source3/include/proto.h
source3/lib/system.c
source3/smbd/server.c

index d757a0154e7736e5cf4da9e58d75865804a2345d..0683f556eb8f5fafd48f5bfbfeff0a062026187c 100644 (file)
@@ -667,5 +667,3 @@ char *rep_realpath(const char *path, char *resolved_path)
        return NULL;
 }
 #endif
-
-
index 8d0dd57064c259b248082337dfbbc668f1be9180..d717d6391ca1462d7ddd2a76cb01b7198c20f05d 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_CHROOT
+#define chroot rep_chroot
+int rep_chroot(const char *dirname);
+#endif
+
 #ifndef HAVE_LINK
 #define link rep_link
 int rep_link(const char *oldpath, const char *newpath);
index 4e5ce99b78cefedb8a65672b5574867ebfa8336d..c2a5d1a75f7fd2ea5221dfdc460ace2ac83dbb41 100644 (file)
@@ -1025,7 +1025,7 @@ if test x"$ac_cv_func_execl" = x"no"; then
     EXTRA_BIN_PROGS="$EXTRA_BIN_PROGS bin/smbrun\$(EXEEXT)"
 fi
 
-AC_CHECK_FUNCS(waitpid getcwd strdup strndup strnlen strerror fchown chmod fchmod chroot mknod mknod64)
+AC_CHECK_FUNCS(waitpid getcwd strdup strndup strnlen strerror fchown chmod fchmod mknod mknod64)
 AC_CHECK_FUNCS(strtol strtoll strtoul strtoull strtouq __strtoull)
 AC_CHECK_FUNCS(fstat strchr chflags)
 AC_CHECK_FUNCS(getrlimit fsync fdatasync memset strlcpy strlcat setpgid)
index e8b25667abb9b845e78c73387509492a553010b2..ee6dcc16014ff43473b3b41e5f123c41c2d5e853 100644 (file)
@@ -1002,7 +1002,6 @@ int sys_closedir(SMB_STRUCT_DIR *dirp);
 int sys_mknod(const char *path, mode_t mode, SMB_DEV_T dev);
 int sys_waitpid(pid_t pid,int *status,int options);
 char *sys_getwd(char *s);
-int sys_chroot(const char *dname);
 void set_effective_capability(enum smbd_capability capability);
 void drop_effective_capability(enum smbd_capability capability);
 long sys_random(void);
index da2797322ace2c011d7afa92fdfd251a4d4ff097..d23e7ae6db46b5275276091679c03fededa0d196 100644 (file)
@@ -565,24 +565,6 @@ char *sys_getwd(char *s)
        return wd;
 }
 
-/*******************************************************************
-os/2 also doesn't have chroot
-********************************************************************/
-int sys_chroot(const char *dname)
-{
-#ifndef HAVE_CHROOT
-       static int done;
-       if (!done) {
-               DEBUG(1,("WARNING: no chroot!\n"));
-               done=1;
-       }
-       errno = ENOSYS;
-       return -1;
-#else
-       return(chroot(dname));
-#endif
-}
-
 #if defined(HAVE_POSIX_CAPABILITIES)
 
 /**************************************************************************
index 4e81263ee4c30082486d21e96b6cfbed9eb0d8ba..7583da65a52e79b5f81b3a84260a23848c6ff26e 100644 (file)
@@ -1415,7 +1415,7 @@ extern void build_options(bool screen);
        }
 
        if (*lp_rootdir()) {
-               if (sys_chroot(lp_rootdir()) == 0)
+               if (chroot(lp_rootdir()) == 0)
                        DEBUG(2,("Changed root to %s\n", lp_rootdir()));
        }