Posts by 'Jelmer Vernooij' – Page 12

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.

BitlBee Bughunting sessions

We held a bit of a BitlBee coding marathon yesterday evening, with all three main coders (Wilmer, Maurits and me) involved. We got a couple of minor bugs fixed, nothing big.

People keep asking us when we (or rather, Wilmer :-), will release 1.0. That question is easy to answer: we’ll release when all known major bugs in BitlBee have been fixed. There’s still a rather major bug in the current development snapshots that very rarely causes BitlBee to suddenly loop and eat CPU. Unfortunately, this bug is hard to reproduce (it takes several days on a heavily used server like testing.bitlbee.org). We’ll track it down eventually, I’m sure, but it’ll probably take another couple of weeks.

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.

Move to serendipity

Once again I’ve switched blog system, this time to serendipity. So far I have tried blosxom and wordpress, both of which were disappointments.

It’s been a while since my last post (December 2004), but there’ll be more updates soon.

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.

Interview with BitlBee developers

LinuxReviews has interviewed my fellow BitlBee developers and me. Interview available here.

(Update 16:55) Slashdot has a post about the interview as well.

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.