Registry.tdb and tdb functionality document

Aravinda Guzzar aguzzar at
Wed May 9 18:23:29 GMT 2007


I see a difference in the way the registry.tdb is handled in the samba code.

While all the permanent TDBs viz. gencache.tdb, group_mapping.tdb,
account_policy.tdb, share_info.tdb, secrets.tdb.
schannel_store.tdb etc. are opend with O_RDWR|O_CREAT flags, registry.tdb is
uniquely been tried to open first with O_RDWR flag and if fails then tried
with O_RDWR|O_CREAT flag.

 if ( !(tdb_reg = tdb_open_log(lock_path("registry.tdb"), 0, TDB_DEFAULT,
O_RDWR, 0600)) )
  tdb_reg = tdb_open_log(lock_path("registry.tdb"), 0, TDB_DEFAULT,
O_RDWR|O_CREAT, 0600);
  if ( !tdb_reg ) {
   DEBUG(0,("regdb_init: Failed to open registry %s (%s)\n",
    lock_path("registry.tdb"), strerror(errno) ));
   return False;

  DEBUG(10,("regdb_init: Successfully created registry tdb\n"));


Is there any special reason/history behind this way of handling this TDB

I bumped on this while understanding the way TDBs are designed in samba. Is
there any special document to understand the internals of its operations
apart fromt the code study.

Thanks in advance for any information regarding this.

More information about the samba-technical mailing list