Posts tagged 'samba' – Page 5

Samba4 this week: Bug squashing

It has been a relatively quiet week for Samba4. Tridge has been working on supporting some more of the Windows LDAP (such as binary or and and operators). Andrew has merged the configuration loading and the command-line handling.

Most changes were bugfixes for existing code by Tridge, Andrew, Metze, Simo, Rafal and me.

comments.

Samba4 this week: “make test”, EJS Wrapper scripts, TDR and strings in pidl

It has been another interesting week in Samba4-land. We have now enabled the Samba4 test suite on all machines in the Samba buildfarm. I did the original (small) patch, metze has done a lot of nice work cleaning up the output, making sure it didn’t try to run the tests when smbd was down, etc and tridge has added options to smbd and smbtorture to make sure they don’t get stuck in an endless loop.

The SPOOLSS test now also works, thanks to continuing efforts from Metze over the past few weeks.

HotaruT and Derell have been working on, respectively, a PostGreSQL and a SQLite backend to LDB. I haven’t checked them out yet (they’re still mostly works-in-progress), but it’d be interesting to see whether they can beat TDB in performance.

I’m currently looking at implementing a new (very simple) data representation format in pidl, so that we don’t have to depend on NDR for, for example, the NetBIOS implementation. It’ll be a very simple format, not supporting pointers and stuff like that, so probably a bit more efficient as well.

Another thing I’m looking at is “proper” string support, e.g. similar to what MIDL has. Pidl’s current extensions (automatic conversion to UTF8, etc) could be supported using a couple of custom attributes.

Other changes this week included improvement of IRPC performance by tridge, EJS improvements by tridge and Tim, more heimdal fixes by Andrew Bartlett.

comments.

Rewriting pidl in Haskell

Now that my rewrite of pidl has been finished, I am wondering what the future for pidl will be.

Looking at the new structure of the source code, I notice that pidl’s structure is now very simple. First, it generates a datastructure representing the IDL file; then it generates new datastructures by walking the first one recursively. In the last step, it recursively walks a datastructure generating output.

Things like this are very easy to do in Haskell, using a trivial parser and a couple of fold functions, as I learned at the course on grammars and parsing at uni.

The parsing step is probably the most difficult one, i.e. going from a file to something like this:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
type Property = (String, [String])

type EnumMember = (String, String)

data Type = Struct (Maybe String) [DataMember]
             | Union (Maybe String) [Maybe DataMember]
             | Enum (Maybe String) [EnumMember]
             | Reference String
             | Interface String (Maybe String) [Property] [InterfaceMember]

type Typedef = (String, Type)

data InterfaceMember = Function String [Property] Type [DataMember]
                     | Typedef String [Property] Type
                     | Const Type String String
                     | Type Type

type DataMember = (Type, Int, String, [Property], [String])

Ah well, back to more important things now…

comments.

Management and status mechanisms + KDC updates

Samba4 development is still progressing nicely. Tridge has been working on a interprocess communication mechanism for managing and gathering statistics from smbd processes, called irpc.

Andrew Bartlett has done more work on the Samba4 KDC. A lot of work is now going by both Andrews to support an in-tree build of heimdal, using Samba4’s build system.

Metze and I have been doing small fixes and improvements to the build system and pidl.

comments.

More Samba4 progress - pidl2, libkdc and SWAT

A lot has happened in the Samba4 world over the last week.

Andrew Bartlett has got a simple domain join to a Samba DC using kerberos working using a hacked-up version of Heimdal kerberos. He’s now looking at the best way of doing a KDC for Samba4 - either writing one from scratch, borrowing one from one of the existing open source implementations or borrowing parts of one of the existing ones (a “libkdc”). There’s been some heated discussion about this on the related mailing lists.

I have merged pidl2 (my rewrite of pidl, our IDL compiler) into the main Samba4 SVN branch. This is something I have been working on for the past 2 months.

Tridge has started working on Samba 4’s internal web server, which will be used for the next generation of SWAT. The webserver supports (a subset of) javascript on the server-side scripting, thru the AppWeb Embedded JavaScript library.

comments.

cldap server working

Tridge just got the cldap server working! That means we’re another item down before we can release an alpha.

I’m still stuck working on the rewritten version of pidl as allocation issues are causing me headaches.

comments.

LCA 2005

I’m currently in Australia, enjoying Linux.Conf.Au 2005. Say hi if you’re around.

comments.

dissecting WMI

Over the past few days, I have been busy trying to figure out what WMI is and how we could possibly implement it in Samba.

WMI is Microsofts’ implementation of the WBEM standard; unlike most other vendors, it however does not use the CIM-XML but DCOM.

I did a quick capture of the network traffic when running the following script:

1
2
3
4
5
6
7
8
9
For Each Host In WScript.Arguments
   Set WMIservice = GetObject("winmgmts:{impersonationLevel=impersonate}!\\\\" & host & "\root\cimv2")

   Set colsettings = WMIservice.ExecQuery("SELECT * FROM Win32_Processor")

   For Each proc In colsettings
       Wscript.Echo(host & ": " & proc.description)
   Next
 Next

It appears WMI uses just the very simple set of DCOM interfaces (IOXIDResolver, IRemUnknown2, IRemUnknown, ISystemActivator) combined with a small number of WMI-specific interfaces.

This means that implementing the client-side of WMI will be relatively easy - once I get DCOM working fully again, it should just be a matter of adding the ODL for the required interfaces.

comments.

Mixing pointers and arrays in IDL

There is a very thin line between the way various encodings that can be given to combinations of arrays and pointers in IDL files. Consider the following examples:

[size_is(…)] int data[] - Inline array of integers [size_is(…)] int *data - Pointer to array of integers [size_is(…)] int *data[] - Array of pointers followed by array of integers [size_is(,…)] int *data[] - Pointer to an array of integers

Summarizing the meaning of the operators:

  • [] stands for an in-line array
  • * is a pointer, possibly to an array

comments.

DCOM client support

DCOM client support finally works! TODO things left for DCOM now are:

  • Server side support
  • Supporting base interfaces outside current file
  • Fix annoying bug in pidl WRT to IStream_Read
  • Implement IUnknown
  • Implement pinging

comments.

My Samba 4 TODO-list

It seems the list is getting longer rather then shorter…

  • finish gepdump (MGMT support)
  • finish DCOM - generate <code>dcerpc_pipes</code> table dynamically - allow binding strings to contain no transport name
  • client_credentials struct
  • more extensive support for expressions in pidl
  • build system in 100% perl

comments.

Samba 4 milestones reached

  • SPNEGO over HTTP works (abartlet)
  • Samba 4 has its first user (tridge)

comments.

MS RPC flaws

Now that I’ve been working with MSRPC extensively for some time, I’m actually starting to like it ! Although things could’ve been less complex (NDR alignment, for example) the protocol itself is actually quite clean and nicely set up.

Some of the major flaws in MSRPC are (imho):

  • Overly complex. A couple percents of performance boost (if at all) by doing alignment of data types is not worth the trouble.
  • Once you have a certain interface the only way to change an existing method’s parameters is adding a new method with the new parameters.
  • Not everybody who works with MSRPC completely understands what it’s doing and how it works. This has been the cause of quite a few flawed interfaces (the winreg interface for example), causing security flaws and inefficiency.

One of the nice things about RPC (and perhaps also one of it’s problems) is it’s flexibility. The encoding can be changed as well as the transport that’s being used.

comments.

Rewrite progressing

Finally, the rewrite of the registry subsystem in Samba 4 is starting to finish off. I changed some major things after the initial version:

  • Changed from typedefs back to structs, like we do in the rest of Samba 4 (e.g. struct registry_key instead of REG_KEY.
  • Pass TALLOC_CTX‘s around for memory allocation. No longer give every key or value it’s own TALLOC_CTX.
  • A registry context is nothing but a collection of hives that all have their own root key. In the previous version, there was one registry context with multiple roots. (this makes the backend code much, much simpler)

comments.

samba-docs build system used for AMANDA

Stefan Weichinger has used the samba-docs build system for the documentation of AMANDA, The Advanced Maryland Automatic Network Disk Archiver.

Preview is available here. Very neat stuff!

comments.