Re: [SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-970-gd6270df

2009-08-13 Thread Stefan (metze) Metzmacher
Hi Jeremy,

 - Log -
 commit d6270df748dcfd8d5a02c328518c2332da8fbed5
 Author: Jeremy Allison j...@samba.org
 Date:   Wed Aug 12 13:00:54 2009 -0700
 
 Add store create time parameter (docs to follow)
 that stores the create time in the user.DosTimestamps EA.
 Jeremy.

Can we please use an idl based union to store this information?

Also user.DosTimestamps is misleading when it only stores the create time.

It would be nice if we could use a single EA to store all timestamps
and maybe all other info like the current xattr_DosAttrib struct used by
samba4.

But I think we should rename xattr_DosAttrib into
xattr_DosInforation or xattr_DosMetaData.

As *XATTR_DOSATTRIB_NAME = user.DosAttrib;
and #define SAMBA_XATTR_DOS_ATTRIB user.DOSATTRIB are different.

metze
 ---
 
 Summary of changes:
  source3/include/proto.h  |   12 -
  source3/include/smb.h|2 +
  source3/modules/vfs_default.c|9 
  source3/param/loadparm.c |   12 +
  source3/script/tests/selftest.sh |1 +
  source3/smbd/dosmode.c   |   91 
 --
  source3/smbd/nttrans.c   |8 ++--
  source3/smbd/open.c  |9 
  source3/smbd/reply.c |2 +-
  source3/smbd/trans2.c|9 ++--
  10 files changed, 140 insertions(+), 15 deletions(-)
 
 
 Changeset truncated at 500 lines:
 
 diff --git a/source3/include/proto.h b/source3/include/proto.h
 index 8b3e029..963e6df 100644
 --- a/source3/include/proto.h
 +++ b/source3/include/proto.h
 @@ -4187,6 +4187,7 @@ bool lp_administrative_share(int );
  bool lp_print_ok(int );
  bool lp_map_hidden(int );
  bool lp_map_archive(int );
 +bool lp_store_create_time(int );
  bool lp_store_dos_attributes(int );
  bool lp_dmapi_support(int );
  bool lp_locking(const struct share_params *p );
 @@ -6266,10 +6267,17 @@ bool set_sticky_write_time_fsp(struct files_struct 
 *fsp,
  struct timespec mtime);
  bool update_write_time(struct files_struct *fsp);
  
 -struct timespec get_create_timespec(struct files_struct *fsp,
 +NTSTATUS set_create_timespec_ea(connection_struct *conn,
 + struct files_struct *fsp,
 + const struct smb_filename *smb_fname,
 + struct timespec create_time);
 +
 +struct timespec get_create_timespec(connection_struct *conn,
 + struct files_struct *fsp,
   const struct smb_filename *smb_fname);
  
 -struct timespec get_change_timespec(struct files_struct *fsp,
 +struct timespec get_change_timespec(connection_struct *conn,
 + struct files_struct *fsp,
   const struct smb_filename *smb_fname);
  
  /* The following definitions come from smbd/error.c  */
 diff --git a/source3/include/smb.h b/source3/include/smb.h
 index fb01a92..28bd60a 100644
 --- a/source3/include/smb.h
 +++ b/source3/include/smb.h
 @@ -1859,6 +1859,8 @@ struct ea_list {
  #define SAMBA_XATTR_DOS_ATTRIB user.DOSATTRIB
  /* Prefix for DosStreams in the vfs_streams_xattr module */
  #define SAMBA_XATTR_DOSSTREAM_PREFIX user.DosStream.
 +/* Prefix for DOS timestamps. */
 +#define SAMBA_XATTR_DOSTIMESTAMPS user.DosTimestamps
  
  #define UUID_SIZE 16
  
 diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
 index 2ee2fd1..a793b33 100644
 --- a/source3/modules/vfs_default.c
 +++ b/source3/modules/vfs_default.c
 @@ -817,6 +817,15 @@ static int vfswrap_ntimes(vfs_handle_struct *handle,
   errno = ENOSYS;
   result = -1;
  #endif
 +
 + if (!null_timespec(ft-create_time) 
 + lp_store_create_time(SNUM(handle-conn))) {
 + set_create_timespec_ea(handle-conn,
 + NULL,
 + smb_fname,
 + ft-create_time);
 + }
 +
   out:
   END_PROFILE(syscall_ntimes);
   return result;
 diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
 index dbbd6e3..3598471 100644
 --- a/source3/param/loadparm.c
 +++ b/source3/param/loadparm.c
 @@ -446,6 +446,7 @@ struct service {
   bool bMap_system;
   bool bMap_hidden;
   bool bMap_archive;
 + bool bStoreCreateTime;
   bool bStoreDosAttributes;
   bool bDmapiSupport;
   bool bLocking;
 @@ -589,6 +590,7 @@ static struct service sDefault = {
   False,  /* bMap_system */
   False,  /* bMap_hidden */
   True,   /* bMap_archive */
 + False,  /* bStoreCreateTime */
   False,  /* bStoreDosAttributes */
   False,  /* bDmapiSupport */
   True,   /* bLocking */
 @@ -3066,6 +3068,15 @@ static struct 

[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-970-gd6270df

2009-08-12 Thread Jeremy Allison
The branch, master has been updated
   via  d6270df748dcfd8d5a02c328518c2332da8fbed5 (commit)
  from  1ddd10b56aea663b06768638d83e3bdcfea9ec89 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -
commit d6270df748dcfd8d5a02c328518c2332da8fbed5
Author: Jeremy Allison j...@samba.org
Date:   Wed Aug 12 13:00:54 2009 -0700

Add store create time parameter (docs to follow)
that stores the create time in the user.DosTimestamps EA.
Jeremy.

---

Summary of changes:
 source3/include/proto.h  |   12 -
 source3/include/smb.h|2 +
 source3/modules/vfs_default.c|9 
 source3/param/loadparm.c |   12 +
 source3/script/tests/selftest.sh |1 +
 source3/smbd/dosmode.c   |   91 --
 source3/smbd/nttrans.c   |8 ++--
 source3/smbd/open.c  |9 
 source3/smbd/reply.c |2 +-
 source3/smbd/trans2.c|9 ++--
 10 files changed, 140 insertions(+), 15 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/proto.h b/source3/include/proto.h
index 8b3e029..963e6df 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -4187,6 +4187,7 @@ bool lp_administrative_share(int );
 bool lp_print_ok(int );
 bool lp_map_hidden(int );
 bool lp_map_archive(int );
+bool lp_store_create_time(int );
 bool lp_store_dos_attributes(int );
 bool lp_dmapi_support(int );
 bool lp_locking(const struct share_params *p );
@@ -6266,10 +6267,17 @@ bool set_sticky_write_time_fsp(struct files_struct *fsp,
   struct timespec mtime);
 bool update_write_time(struct files_struct *fsp);
 
-struct timespec get_create_timespec(struct files_struct *fsp,
+NTSTATUS set_create_timespec_ea(connection_struct *conn,
+   struct files_struct *fsp,
+   const struct smb_filename *smb_fname,
+   struct timespec create_time);
+
+struct timespec get_create_timespec(connection_struct *conn,
+   struct files_struct *fsp,
const struct smb_filename *smb_fname);
 
-struct timespec get_change_timespec(struct files_struct *fsp,
+struct timespec get_change_timespec(connection_struct *conn,
+   struct files_struct *fsp,
const struct smb_filename *smb_fname);
 
 /* The following definitions come from smbd/error.c  */
diff --git a/source3/include/smb.h b/source3/include/smb.h
index fb01a92..28bd60a 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -1859,6 +1859,8 @@ struct ea_list {
 #define SAMBA_XATTR_DOS_ATTRIB user.DOSATTRIB
 /* Prefix for DosStreams in the vfs_streams_xattr module */
 #define SAMBA_XATTR_DOSSTREAM_PREFIX user.DosStream.
+/* Prefix for DOS timestamps. */
+#define SAMBA_XATTR_DOSTIMESTAMPS user.DosTimestamps
 
 #define UUID_SIZE 16
 
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 2ee2fd1..a793b33 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -817,6 +817,15 @@ static int vfswrap_ntimes(vfs_handle_struct *handle,
errno = ENOSYS;
result = -1;
 #endif
+
+   if (!null_timespec(ft-create_time) 
+   lp_store_create_time(SNUM(handle-conn))) {
+   set_create_timespec_ea(handle-conn,
+   NULL,
+   smb_fname,
+   ft-create_time);
+   }
+
  out:
END_PROFILE(syscall_ntimes);
return result;
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index dbbd6e3..3598471 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -446,6 +446,7 @@ struct service {
bool bMap_system;
bool bMap_hidden;
bool bMap_archive;
+   bool bStoreCreateTime;
bool bStoreDosAttributes;
bool bDmapiSupport;
bool bLocking;
@@ -589,6 +590,7 @@ static struct service sDefault = {
False,  /* bMap_system */
False,  /* bMap_hidden */
True,   /* bMap_archive */
+   False,  /* bStoreCreateTime */
False,  /* bStoreDosAttributes */
False,  /* bDmapiSupport */
True,   /* bLocking */
@@ -3066,6 +3068,15 @@ static struct parm_struct parm_table[] = {
.flags  = FLAG_ADVANCED,
},
{
+   .label  = store create time,
+   .type   = P_BOOL,
+   .p_class= P_LOCAL,
+   .ptr= sDefault.bStoreCreateTime,
+   .special= NULL,
+