[SCM] Samba Shared Repository - branch master updated
Jeremy Allison
jra at samba.org
Tue Sep 16 18:57:06 MDT 2014
The branch, master has been updated
via 6ce6262 lib: Make nt_err_code_struct private
via b3cc5e2 replace: Make EWOULDBLOCK always available
via 4b788ff lib: Avoid a talloc in write_data_iov
via 4be5834 lib: Remove unused file_lines_slashcont
via e899658 lib: Move "large_file_support()" to the source4 smb server
from 1f7da1c tdb: change version to 1.3.1
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 6ce626201457ddb63a42b0aa1a601ab1f8ca0212
Author: Volker Lendecke <vl at samba.org>
Date: Tue Sep 16 23:38:24 2014 +0200
lib: Make nt_err_code_struct private
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Wed Sep 17 02:56:54 CEST 2014 on sn-devel-104
commit b3cc5e204d187b9a1339c928c27f7010afa8ef97
Author: Volker Lendecke <vl at samba.org>
Date: Tue Sep 16 19:44:57 2014 +0200
replace: Make EWOULDBLOCK always available
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 4b788ffe65726df144af4e6aaa6ddabc141f859c
Author: Volker Lendecke <vl at samba.org>
Date: Tue Sep 16 19:19:06 2014 +0200
lib: Avoid a talloc in write_data_iov
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 4be583493aabba76e36e5a105702d6de0c2e82cc
Author: Volker Lendecke <vl at samba.org>
Date: Sun Sep 14 18:49:46 2014 +0200
lib: Remove unused file_lines_slashcont
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit e8996582c6b004261ebc5051f2d809bd7505d0b6
Author: Volker Lendecke <vl at samba.org>
Date: Sun Sep 14 18:44:36 2014 +0200
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 at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
-----------------------------------------------------------------------
Summary of changes:
ctdb/lib/util/util.h | 7 ------
lib/replace/replace.h | 4 +++
lib/replace/wscript | 1 +
lib/util/samba_util.h | 7 ------
lib/util/util_file.c | 45 --------------------------------------
libcli/util/nterr.c | 6 +++++
libcli/util/ntstatus.h | 6 -----
source3/lib/util_sock.c | 12 ++-------
source4/smb_server/smb/negprot.c | 21 +++++++++++++++++
9 files changed, 35 insertions(+), 74 deletions(-)
Changeset truncated at 500 lines:
diff --git a/ctdb/lib/util/util.h b/ctdb/lib/util/util.h
index abf5c46..33f46bd 100644
--- a/ctdb/lib/util/util.h
+++ b/ctdb/lib/util/util.h
@@ -333,18 +333,11 @@ the list.
_PUBLIC_ char **fd_lines_load(int fd, int *numlines, size_t maxsize, TALLOC_CTX *mem_ctx);
/**
-take a list of lines and modify them to produce a list where \ continues
-a line
-**/
-_PUBLIC_ void file_lines_slashcont(char **lines);
-
-/**
save a lump of data into a file. Mostly used for debugging
*/
_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/replace/replace.h b/lib/replace/replace.h
index bc40bf0..3ff4e36 100644
--- a/lib/replace/replace.h
+++ b/lib/replace/replace.h
@@ -41,6 +41,10 @@
#include <stdarg.h>
#include <errno.h>
+#ifndef HAVE_DECL_EWOULDBLOCK
+#define EWOULDBLOCK EAGAIN
+#endif
+
#if defined(_MSC_VER) || defined(__MINGW32__)
#include "win32_replace.h"
#endif
diff --git a/lib/replace/wscript b/lib/replace/wscript
index 6f2fb66..16fd50b 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -518,6 +518,7 @@ removeea setea
conf.CHECK_DECLS('snprintf vsnprintf asprintf vasprintf')
conf.CHECK_DECLS('errno', headers='errno.h', reverse=True)
+ conf.CHECK_DECLS('EWOULDBLOCK', headers='errno.h')
conf.CHECK_DECLS('environ getgrent_r getpwent_r', reverse=True, headers='pwd.h grp.h')
conf.CHECK_DECLS('pread pwrite setenv setresgid setresuid', reverse=True)
diff --git a/lib/util/samba_util.h b/lib/util/samba_util.h
index 528d373..a8d3cd6 100644
--- a/lib/util/samba_util.h
+++ b/lib/util/samba_util.h
@@ -586,12 +586,6 @@ the list.
**/
_PUBLIC_ char **fd_lines_load(int fd, int *numlines, size_t maxsize, TALLOC_CTX *mem_ctx);
-/**
-take a list of lines and modify them to produce a list where \ continues
-a line
-**/
-_PUBLIC_ void file_lines_slashcont(char **lines);
-
_PUBLIC_ bool file_save_mode(const char *fname, const void *packet,
size_t length, mode_t mode);
/**
@@ -600,7 +594,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 815cc2b..886bcae 100644
--- a/lib/util/util_file.c
+++ b/lib/util/util_file.c
@@ -344,30 +344,6 @@ _PUBLIC_ char **fd_lines_load(int fd, int *numlines, size_t maxsize, TALLOC_CTX
return file_lines_parse(p, size, numlines, mem_ctx);
}
-
-/**
-take a list of lines and modify them to produce a list where \ continues
-a line
-**/
-_PUBLIC_ void file_lines_slashcont(char **lines)
-{
- int i, j;
-
- for (i=0; lines[i];) {
- int len = strlen(lines[i]);
- if (lines[i][len-1] == '\\') {
- lines[i][len-1] = ' ';
- if (lines[i+1]) {
- char *p = &lines[i][len];
- while (p < lines[i+1]) *p++ = ' ';
- for (j = i+1; lines[j]; j++) lines[j] = lines[j+1];
- }
- } else {
- i++;
- }
- }
-}
-
_PUBLIC_ bool file_save_mode(const char *fname, const void *packet,
size_t length, mode_t mode)
{
@@ -420,27 +396,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/libcli/util/nterr.c b/libcli/util/nterr.c
index ce2647d..9f90f7a 100644
--- a/libcli/util/nterr.c
+++ b/libcli/util/nterr.c
@@ -33,6 +33,12 @@
#define DOS_CODE(class, code) { #class ":" #code, NT_STATUS_DOS(class, code) }
#define LDAP_CODE(code) { #code, NT_STATUS_LDAP(code) }
+typedef struct
+{
+ const char *nt_errstr;
+ NTSTATUS nt_errcode;
+} nt_err_code_struct;
+
const nt_err_code_struct nt_errs[] =
{
{ "NT_STATUS_OK", NT_STATUS_OK },
diff --git a/libcli/util/ntstatus.h b/libcli/util/ntstatus.h
index 1c3f98b..bb19234 100644
--- a/libcli/util/ntstatus.h
+++ b/libcli/util/ntstatus.h
@@ -2008,10 +2008,4 @@ NTSTATUS nt_status_string_to_code(const char *nt_status_str);
(((NT_STATUS_V(status) & 0xFFFF) == 0xC0020000) || \
((NT_STATUS_V(status) & 0xFFFF) == 0xC0030000))
-typedef struct
-{
- const char *nt_errstr;
- NTSTATUS nt_errcode;
-} nt_err_code_struct;
-
#endif /* _NTSTATUS_H */
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index 522f600..d865ffb 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -255,7 +255,8 @@ ssize_t write_data_iov(int fd, const struct iovec *orig_iov, int iovcnt)
ssize_t to_send;
ssize_t thistime;
size_t sent;
- struct iovec *iov_copy, *iov;
+ struct iovec iov_copy[iovcnt];
+ struct iovec *iov;
to_send = iov_buflen(orig_iov, iovcnt);
if (to_send == -1) {
@@ -276,13 +277,7 @@ ssize_t write_data_iov(int fd, const struct iovec *orig_iov, int iovcnt)
* discarding elements.
*/
- iov_copy = (struct iovec *)talloc_memdup(
- talloc_tos(), orig_iov, sizeof(struct iovec) * iovcnt);
-
- if (iov_copy == NULL) {
- errno = ENOMEM;
- return -1;
- }
+ memcpy(iov_copy, orig_iov, sizeof(struct iovec) * iovcnt);
iov = iov_copy;
while (sent < to_send) {
@@ -311,7 +306,6 @@ ssize_t write_data_iov(int fd, const struct iovec *orig_iov, int iovcnt)
sent += thistime;
}
- TALLOC_FREE(iov_copy);
return sent;
}
diff --git a/source4/smb_server/smb/negprot.c b/source4/smb_server/smb/negprot.c
index 339fa7a..cdfa2b4 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.
****************************************************************************/
--
Samba Shared Repository
More information about the samba-cvs
mailing list