1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

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>
This commit is contained in:
Volker Lendecke 2014-09-14 18:44:36 +02:00 committed by Jeremy Allison
parent 1f7da1ca7f
commit e8996582c6
4 changed files with 21 additions and 23 deletions

View File

@ -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 */

View File

@ -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

View File

@ -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
*/

View File

@ -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.
****************************************************************************/