Q: file-creation-time in samba3
Limor.Hevroni at exanet.com
Thu Feb 19 09:54:09 MST 2009
We are using samba version 3.0.32.
Our samba clients are winNT servers.
We do not support POSIX semantics.
We implement a NAS above linux server.
We want to implement the file creation time under this version, so any
SMB command (& sub-command) which is defined to send/retrieve the
creation-time will have a real creation time.
The problem of course rely on the fact that our FS, kernel does not
support creation time. We want to enhance our FS to support this
metadata as well, but our kernel still wont be able to support it.
With a guiding rule of wanting to avoid as much as possible from
changes in samba-code, to allow smooth upgrades, and with intention to
upgrade to higher versions of samba and in time to upgrade to samba4 as
well, I do not want to invent some solution, in case higher versions
So I understood that in samba4 the creation time was handled.
But I wonder if there is a solution for it in samba3xx as well ???
Because from what I saw in samba3.3.0, in case the kernel has an
"enhanced" stat struct which includes an st_birthtime data member, than
the function which all create_time are directed to, fills the
create_time with that st_birthtime, else it still behaves as older
versions and return the min between the 3 unix' times.
>From looking at the code I saw the following:
1. For SMB_COM_TRANSACTION2,SMB_COM_NT_TRANSACTION the bottom line
is that whatever the SMB sub-command is, the create_time is retrieved at
the end from the get_create_time() method, which in turn return the
minimum between mtime,atime,ctime of "struct stat". (I haven't seen in
the code what happens in the opposite case - when the client sends the
create-time to the CIFS server, in case of file-copy for example ?..)
2. I have also seen a remark about create_time in
smb_set_file_unix_info2() function, saying that create_time support
should be added there and that the correct way to do it will probably be
via the utimes in the VFS layer. I understand that the unix-info2
information-level addition was defined in order to extend the unix_basic
with more attributes among which is the create_time. I must ask the
a. How can I simulate a real SMB command which its info level is
UNIX_INFO2 ? I want to understand what are the "real-world" situations
under which such SMB commands will be initiated by a client.
b. When looking at the code, I saw that the create_time is handled
in the same way as in the basic-unix, arriving at the end to the
get_create_time (with False instead of fake_dir_create_time, but this is
non-important), and retrieving the min of all 3 unix times. So I do not
see any difference - am I missing something ?
I have started to figure out the SMB,CIFS protocol & world. I must point
that although I am a unix veteran I am pretty newbie to windows world.
So I am starting gathering info, but there are still much ahead. (3.) So
I have also wondered - do u have some good CIFS,AD & related issues
books to recommend me on ?
And as part of that I have some maybe unrelated, more general Q:
(4) I first got the impression that the difference between the
transaction relies on the fact that
In case the client-server negotiation ended with the highest protocol
version dialect (is it NT LM 0.12 - or by now there is a higher one ?),
when should I expect an SMB command of the highest dialect - like
NT_CREATE_ANDX and when should I expect an SMB command of lower version
(5) does it depends on the windows-app which I use under the win-NT ?
(6) is it possible that the dialect will be set to NT LM and I will get
a TRANS2-OPEN2 SMB command from the client ?
(7) from the obsolete IETF Draft I understood that a response on
TRANS2_OPEN2 sub-command should be with modification-time returned in
the create-time . (ah ? ) does this definition still valid ?
(8) should I take care of this case if I am handling only windows-NT
servers as CIFS clients ?
(9) I have also seen that the change-notification has an option to
monitor CHANGE_CREATION , I haven't dig into this one but are u really
handling this case in samba3 ?
I will be more than thankful if you'll be answering my Qs.
More information about the samba-technical