summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2014-09-14 18:44:36 +0200
committerJeremy Allison <jra@samba.org>2014-09-17 00:31:21 +0200
commite8996582c6b004261ebc5051f2d809bd7505d0b6 (patch)
tree3c1932959cffdd1a90ea2d1381de5423af82118d
parent1f7da1ca7f76cc30c5a753da85184e3e19967769 (diff)
downloadsamba-e8996582c6b004261ebc5051f2d809bd7505d0b6.tar.gz
lib: Move "large_file_support()" to the source4 smb server
That's the only place where it's used, make it static there. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--ctdb/lib/util/util.h1
-rw-r--r--lib/util/samba_util.h1
-rw-r--r--lib/util/util_file.c21
-rw-r--r--source4/smb_server/smb/negprot.c21
4 files changed, 21 insertions, 23 deletions
diff --git a/ctdb/lib/util/util.h b/ctdb/lib/util/util.h
index abf5c4647d9..8702f2a05aa 100644
--- a/ctdb/lib/util/util.h
+++ b/ctdb/lib/util/util.h
@@ -344,7 +344,6 @@ _PUBLIC_ void file_lines_slashcont(char **lines);
_PUBLIC_ bool file_save(const char *fname, const void *packet, size_t length);
_PUBLIC_ int vfdprintf(int fd, const char *format, va_list ap) PRINTF_ATTRIBUTE(2,0);
_PUBLIC_ int fdprintf(int fd, const char *format, ...) PRINTF_ATTRIBUTE(2,3);
-_PUBLIC_ bool large_file_support(const char *path);
/* The following definitions come from lib/util/util.c */
diff --git a/lib/util/samba_util.h b/lib/util/samba_util.h
index 528d3737dd2..958df88cc69 100644
--- a/lib/util/samba_util.h
+++ b/lib/util/samba_util.h
@@ -600,7 +600,6 @@ _PUBLIC_ bool file_save_mode(const char *fname, const void *packet,
_PUBLIC_ bool file_save(const char *fname, const void *packet, size_t length);
_PUBLIC_ int vfdprintf(int fd, const char *format, va_list ap) PRINTF_ATTRIBUTE(2,0);
_PUBLIC_ int fdprintf(int fd, const char *format, ...) PRINTF_ATTRIBUTE(2,3);
-_PUBLIC_ bool large_file_support(const char *path);
/*
compare two files, return true if the two files have the same content
diff --git a/lib/util/util_file.c b/lib/util/util_file.c
index 815cc2bf9e6..8fd3277e0a7 100644
--- a/lib/util/util_file.c
+++ b/lib/util/util_file.c
@@ -420,27 +420,6 @@ _PUBLIC_ int fdprintf(int fd, const char *format, ...)
/*
- try to determine if the filesystem supports large files
-*/
-_PUBLIC_ bool large_file_support(const char *path)
-{
- int fd;
- ssize_t ret;
- char c;
-
- fd = open(path, O_RDWR|O_CREAT, 0600);
- unlink(path);
- if (fd == -1) {
- /* have to assume large files are OK */
- return true;
- }
- ret = pread(fd, &c, 1, ((uint64_t)1)<<32);
- close(fd);
- return ret == 0;
-}
-
-
-/*
compare two files, return true if the two files have the same content
*/
bool file_compare(const char *path1, const char *path2)
diff --git a/source4/smb_server/smb/negprot.c b/source4/smb_server/smb/negprot.c
index 339fa7a9e35..cdfa2b4046f 100644
--- a/source4/smb_server/smb/negprot.c
+++ b/source4/smb_server/smb/negprot.c
@@ -18,6 +18,7 @@
*/
#include "includes.h"
+#include "system/filesys.h"
#include "auth/credentials/credentials.h"
#include "auth/gensec/gensec.h"
#include "auth/auth.h"
@@ -251,6 +252,26 @@ static void reply_nt1_orig(struct smbsrv_request *req)
DEBUG(3,("not using extended security (SPNEGO or NTLMSSP)\n"));
}
+/*
+ try to determine if the filesystem supports large files
+*/
+static bool large_file_support(const char *path)
+{
+ int fd;
+ ssize_t ret;
+ char c;
+
+ fd = open(path, O_RDWR|O_CREAT, 0600);
+ unlink(path);
+ if (fd == -1) {
+ /* have to assume large files are OK */
+ return true;
+ }
+ ret = pread(fd, &c, 1, ((uint64_t)1)<<32);
+ close(fd);
+ return ret == 0;
+}
+
/****************************************************************************
Reply for the nt protocol.
****************************************************************************/