From e8996582c6b004261ebc5051f2d809bd7505d0b6 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 14 Sep 2014 18:44:36 +0200 Subject: 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 Reviewed-by: Jeremy Allison --- ctdb/lib/util/util.h | 1 - lib/util/samba_util.h | 1 - lib/util/util_file.c | 21 --------------------- source4/smb_server/smb/negprot.c | 21 +++++++++++++++++++++ 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 @@ -419,27 +419,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 */ 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. ****************************************************************************/ -- cgit v1.2.1