summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs-xml/smbdotconf/misc/dosfiletimes.xml8
-rw-r--r--librpc/gen_ndr/spoolss.h6
-rw-r--r--librpc/idl/spoolss.idl6
-rw-r--r--source3/lib/system.c8
-rw-r--r--source3/modules/vfs_default.c25
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c2
6 files changed, 29 insertions, 26 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 @@
<para>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 <command moreinfo="none">smbd</command> is acting
- on behalf of is not the file owner. Setting this option to <constant>
- yes</constant> allows DOS semantics and <citerefentry><refentrytitle>smbd</refentrytitle>
- <manvolnum>8</manvolnum></citerefentry> 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
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 {
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,
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++) {