From fb3b0987f7f9d7026701ab8b3034ff6084ae2143 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 2 Dec 2009 00:59:21 +0100 Subject: spoolss: add more spoolss architectures to IDL. Guenther --- librpc/gen_ndr/spoolss.h | 6 +++++- librpc/idl/spoolss.idl | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/librpc/gen_ndr/spoolss.h b/librpc/gen_ndr/spoolss.h index cee9a8fa58..2f2e8f25d6 100644 --- a/librpc/gen_ndr/spoolss.h +++ b/librpc/gen_ndr/spoolss.h @@ -21,8 +21,12 @@ #define SPL_ARCH_W32PPC ( "W32PPC" ) #define SPL_ARCH_IA64 ( "IA64" ) #define SPL_ARCH_X64 ( "x64" ) -#define SPOOLSS_ARCHITECTURE_ALL ( "all" ) +#define SPOOLSS_ARCHITECTURE_ALL ( "All" ) +#define SPOOLSS_ARCHITECTURE_ALL_CLUSTER ( "AllCluster" ) #define SPOOLSS_ARCHITECTURE_NT_X86 ( "Windows NT x86" ) +#define SPOOLSS_ARCHITECTURE_IA_64 ( "Windows IA64" ) +#define SPOOLSS_ARCHITECTURE_x64 ( "Windows x64" ) +#define SPOOLSS_ARCHITECTURE_4_0 ( "Windows 4.0" ) #define SPOOLSS_DEFAULT_SERVER_PATH ( "C:\\WINDOWS\\system32\\spool" ) #define SPOOL_PRINTERDATA_KEY ( "PrinterDriverData" ) #define SPOOL_DSSPOOLER_KEY ( "DsSpooler" ) diff --git a/librpc/idl/spoolss.idl b/librpc/idl/spoolss.idl index f665381199..64b2676185 100644 --- a/librpc/idl/spoolss.idl +++ b/librpc/idl/spoolss.idl @@ -1498,8 +1498,12 @@ import "misc.idl", "security.idl", "winreg.idl"; const string SPL_ARCH_IA64 = "IA64"; const string SPL_ARCH_X64 = "x64"; - const string SPOOLSS_ARCHITECTURE_ALL = "all"; + const string SPOOLSS_ARCHITECTURE_ALL = "All"; + const string SPOOLSS_ARCHITECTURE_ALL_CLUSTER = "AllCluster"; const string SPOOLSS_ARCHITECTURE_NT_X86 = "Windows NT x86"; + const string SPOOLSS_ARCHITECTURE_IA_64 = "Windows IA64"; + const string SPOOLSS_ARCHITECTURE_x64 = "Windows x64"; + const string SPOOLSS_ARCHITECTURE_4_0 = "Windows 4.0"; const string SPOOLSS_DEFAULT_SERVER_PATH = "C:\\WINDOWS\\system32\\spool"; typedef [public,gensize] struct { -- cgit From e14fb8f913e35db96d8d7985e505f96150d9ce6b Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 8 Dec 2009 14:46:10 +0100 Subject: s3-spoolss: use SPOOLSS_ARCHITECTURE_ALL in driver enum server code. Guenther --- source3/rpc_server/srv_spoolss_nt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index 9abed16ed9..1e66c7c021 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -6461,7 +6461,7 @@ static WERROR enumprinterdrivers_level(TALLOC_CTX *mem_ctx, uint32_t a,i; WERROR result = WERR_OK; - if (strequal(architecture, "all")) { + if (strequal(architecture, SPOOLSS_ARCHITECTURE_ALL)) { for (a=0; archi_table[a].long_archi != NULL; a++) { -- cgit From 0d53ce7e072d3dc5208fd752c5d49ed313d1c752 Mon Sep 17 00:00:00 2001 From: Björn Jacke Date: Tue, 8 Dec 2009 21:13:19 +0100 Subject: s3: make sys_posix_fallocate more generic this is in preparation for other preallocation methods to be introduced. --- source3/lib/system.c | 8 ++++---- source3/modules/vfs_default.c | 25 +++++++++++-------------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/source3/lib/system.c b/source3/lib/system.c index a2dd89982e..a58d9037a7 100644 --- a/source3/lib/system.c +++ b/source3/lib/system.c @@ -621,16 +621,16 @@ int sys_lstat(const char *fname,SMB_STRUCT_STAT *sbuf, /******************************************************************* An posix_fallocate() wrapper that will deal with 64 bit filesizes. ********************************************************************/ -#if (defined(HAVE_POSIX_FALLOCATE64) || defined(HAVE_POSIX_FALLOCATE)) && !defined(HAVE_BROKEN_POSIX_FALLOCATE) int sys_posix_fallocate(int fd, SMB_OFF_T offset, SMB_OFF_T len) { -#if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_OFF64_T) && defined(HAVE_POSIX_FALLOCATE64) +#if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_OFF64_T) && defined(HAVE_POSIX_FALLOCATE64) && !defined(HAVE_BROKEN_POSIX_FALLOCATE) return posix_fallocate64(fd, offset, len); -#else +#elif defined(HAVE_POSIX_FALLOCATE) && !defined(HAVE_BROKEN_POSIX_FALLOCATE) return posix_fallocate(fd, offset, len); +#else + return ENOSYS; #endif } -#endif /******************************************************************* An ftruncate() wrapper that will deal with 64 bit filesizes. diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 9b842df93f..ded4b1af27 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -917,6 +917,7 @@ static int strict_allocate_ftruncate(vfs_handle_struct *handle, files_struct *fs SMB_OFF_T space_to_write; uint64_t space_avail; uint64_t bsize,dfree,dsize; + int ret; if (currpos == -1) return -1; @@ -943,21 +944,17 @@ static int strict_allocate_ftruncate(vfs_handle_struct *handle, files_struct *fs emulation is being done by the libc (like on AIX with JFS1). In that case we do our own emulation. posix_fallocate implementations can return ENOTSUP or EINVAL in cases like that. */ -#if defined(HAVE_POSIX_FALLOCATE) - { - int ret = sys_posix_fallocate(fsp->fh->fd, st.st_ex_size, space_to_write); - if (ret == ENOSPC) { - errno = ENOSPC; - return -1; - } - if (ret == 0) { - return 0; - } - DEBUG(10,("strict_allocate_ftruncate: sys_posix_fallocate " - "failed with error %d. " - "Falling back to slow manual allocation\n", ret)); + ret = sys_posix_fallocate(fsp->fh->fd, st.st_ex_size, space_to_write); + if (ret == ENOSPC) { + errno = ENOSPC; + return -1; } -#endif + if (ret == 0) { + return 0; + } + DEBUG(10,("strict_allocate_ftruncate: sys_posix_fallocate failed with " + "error %d. Falling back to slow manual allocation\n", ret)); + /* available disk space is enough or not? */ space_avail = get_dfree_info(fsp->conn, fsp->fsp_name->base_name, false, -- cgit From 3609c7433d17d78aceb1806340f53f7a2e23c9e8 Mon Sep 17 00:00:00 2001 From: Björn Jacke Date: Tue, 8 Dec 2009 21:32:51 +0100 Subject: s3:doc: make dos filetimes description less contradictory --- docs-xml/smbdotconf/misc/dosfiletimes.xml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docs-xml/smbdotconf/misc/dosfiletimes.xml b/docs-xml/smbdotconf/misc/dosfiletimes.xml index 90f93a03e8..423b13c3b6 100644 --- a/docs-xml/smbdotconf/misc/dosfiletimes.xml +++ b/docs-xml/smbdotconf/misc/dosfiletimes.xml @@ -6,12 +6,10 @@ Under DOS and Windows, if a user can write to a file they can change the timestamp on it. Under POSIX semantics, only the owner of the file or root may change the timestamp. By - default, Samba runs with POSIX semantics and refuses to change the + default, Samba emulates the DOS semantics and allows to change the timestamp on a file if the user smbd is acting - on behalf of is not the file owner. Setting this option to - yes allows DOS semantics and smbd - 8 will change the file - timestamp as DOS requires. Due to changes in Microsoft Office 2000 and beyond, + on behalf has write permissions. + Due to changes in Microsoft Office 2000 and beyond, the default for this parameter has been changed from "no" to "yes" in Samba 3.0.14 and above. Microsoft Excel will display dialog box warnings about the file being changed by another user if this parameter is not set to "yes" and files are being -- cgit