Get Samba version or capability information from Windows

David Collier-Brown davec-b at rogers.com
Thu Jan 17 22:09:54 GMT 2008


Volker Lendecke wrote: 
>>Maybe, but that's much less reliable, isn't it?  The version number and
>>earlier/later dependencies would have to be calculated from an arbitrary
>>version string.  There's also no magic which would allow to identify
>>that this is a Samba server at all.  Sure, it would be better than
>>today, but still...

Four well-known ways of doing versions and capabilities are
- via a version number, either binary of string, with the same or
  more precision than the usual version string
- via a date, also 
- via a SVN/Git revision number (not the checksum (;-))
and, adding capabilities
- via a version number per interface
- via a (binary) capabilities vector

the latter two are useful if you plan on removing old capabilities
and inserting new ones, but if you aren't the last one reduces
to an odd counter that grows from left to right (;-))

  I'd mildly reccomend a compact form of the first three of these, 
ending in a string version and date/time for human convenience.

struct smb_extra_info
   {
    uint32_t magic_number;	/* "SmBa" or something */
    uint64_t samba_build_ver;	/* SVN or Git version number. */
    time_t   samba_build_time;	/* The time of the commit. */
    char     samba_version[32]; /* String version and date/time */
   };

  This assumes that you only need 4-byte alignment if you want to
grab the binary build_ver and build_time, of course.

-dave
-- 
David Collier-Brown,         | Always do right. This will gratify
System Programmer and Author | some people and astonish the rest
davecb at spamcop.net           |                      -- Mark Twain
(416) 223-5943


More information about the samba-technical mailing list