Bug 5923 - secrets.tdb corrupted after upgrade from 3.022 to 3.0.30
secrets.tdb corrupted after upgrade from 3.022 to 3.0.30
Status: CLOSED FIXED
Product: Samba 3.0
Classification: Unclassified
Component: Upgrade
3.0.30
IA64 HP-UX
: P3 critical
: none
Assigned To: Samba Bugzilla Account
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-27 08:35 UTC by anoop
Modified: 2008-12-08 23:04 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description anoop 2008-11-27 08:35:07 UTC
I am trying to upgrade from 3.0.22 to 3.0.30 on a HP-UX 11iv2 IA machine.

Setup:
 samba 3.0.22 is a member server to Windows 2003 DC with "security =ADS". Which
is running without any issues.

Problem:
 Now i'm trying to upgrade samba from version 3.0.22 to 3.0.30. I have installed the 3.0.30, keeping all the tdb's and conf file intact. After install when I try to start samba (smbd, nmbd) with winbindd, winbindd does not start.

here is what the winbindd log file has,

[2008/11/27 06:54:43, 5] libsmb/namecache.c:namecache_enable(57)
  namecache_enable: enabling netbios namecache, timeout 660 seconds
[2008/11/27 06:54:43, 10] nsswitch/idmap_cache.c:idmap_cache_init(60)
  Opening cache file at /var/opt/samba/locks/idmap_cache.tdb
[2008/11/27 06:54:43, 8] lib/util.c:fcntl_lock(1991)
  fcntl_lock fd=8 op=9 offset=0 count=1 type=2
[2008/11/27 06:54:43, 8] lib/util.c:fcntl_lock(2011)
  fcntl_lock: Lock call successful
[2008/11/27 06:54:43, 4] lib/time.c:TimeInit(1258)
  TimeInit: Serverzone is 28800
[2008/11/27 06:54:43, 2] lib/tallocmsg.c:register_msg_pool_usage(105)
  Registered MSG_REQ_POOL_USAGE
[2008/11/27 06:54:43, 2] lib/dmallocmsg.c:register_dmalloc_msgs(75)
  Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
[2008/11/27 06:54:43, 0] nsswitch/winbindd_cache.c:initialize_winbindd_cache(2351)
  initialize_winbindd_cache: clearing cache and re-creating with version number 1
[2008/11/27 06:54:43, 0] nsswitch/winbindd_util.c:init_domain_list(505)
  Could not fetch our SID - did we join?
[2008/11/27 06:54:43, 0] nsswitch/winbindd.c:main(1123)
  unable to initalize domain list


When I try to see what is there in the tdb file,
hpntco1# strings secrets.tdb
TDB file

The tdb file has been reinitialized, but after installation of 3.0.30 the tdb file was intact,
hpntco1# strings secrets.tdb
SECRETS/SID/CIFS2K3
SECRETS/MACHINE_PASSWORD/CIFS2K3zWoi8#TAd6GXDv
SECRETS/MACHINE_LAST_CHANGE_TIME/CIFS2K3
S6:&
SECRETS/MACHINE_SEC_CHANNEL_TYPE/CIFS2K3
SECRETS/SID/HPNTCO1
fBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB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BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB

After starting the samba services the secrets.tdb was reinitialized.

What I doubt here is the tdb_header structure which has changed from 3.0.22 to 3.0.30.

3.0.22 code:
struct tdb_header {
        char magic_food[32]; /* for /etc/magic */
        u32 version; /* version of the code */
        u32 hash_size; /* number of hash entries */
        tdb_off rwlocks;
        tdb_off reserved[31];
};

3.0.30 code:
struct tdb_header {
        char magic_food[32]; /* for /etc/magic */
        u32 version; /* version of the code */
        u32 hash_size; /* number of hash entries */
        tdb_off_t rwlocks; /* obsolete - kept to detect old formats */
        tdb_off_t recovery_start; /* offset of transaction recovery region */
        tdb_off_t sequence_number; /* used when TDB_SEQNUM is set */
        tdb_off_t reserved[29];
};

I couldn't get my upgrade working.
What is going wrong here.. Is there any migration utility to migrate the tdb's
from 3.0.22 to 3.0.30.

smb.conf file:
[global]
        workgroup = CIFS2K3
        realm = CIFS2K3.ADS.COM
        security = ADS
        password server = HP2K3.CIFS2K3.ADS.COM
        log level = 10
        syslog = 0
        log file = /var/opt/samba/log.%m
        max log size = 1000
        server signing = auto
        socket options = TCP_NODELAY
        local master = No
        panic action = /var/opt/samba/panic-action %d
        idmap uid = 10000-20000
        idmap gid = 10000-20000
        winbind separator = +
        winbind cache time = 3000
        winbind enum users = Yes
        winbind enum groups = Yes
        read only = No
        dos filetime resolution = Yes
Comment 1 Volker Lendecke 2008-11-27 09:19:58 UTC
You're the second one to report this. I tried hard, but I'm afraid but I don't know a way to get this right without login to such a box.

Volker
Comment 2 anoop 2008-11-27 10:34:06 UTC
Hi Volker,

Is there a bug already riased., could you please
give me the pointer to it, so that i could start
from whereever you guys have left and continue
debugging.

I dout it wont be possible to give access to the m/c
since they are all in a private firewalled n/w.

thanks
Anoop
Comment 3 anoop 2008-12-08 07:43:32 UTC
Got the problem, it was indeed with the tdb_header struct.

We have added two new members to the tdb_header structure for mmap support. 
We did not realize that when a new member is added to the tdb_header structure
the reserved array member size should be deremented. So it should be
tdb_off_t reserved[27] instead tdb_off_t reserved[29], since we have added two parameters.

Now its fixed!

Thanks
Anoop
Comment 4 Volker Lendecke 2008-12-08 07:58:08 UTC
Wait a second -- this was a MODIFIED version of the tdb libs????

What is THIS??

VOlker
Comment 5 Volker Lendecke 2008-12-08 08:01:14 UTC
Guys, this is not funny. If you mess with Samba code and report bugs here, at least tell us about your changes. This bug, or rather the other version of it, has REALLY taken hours of my time.

*NOT* amused :-(

Volker
Comment 6 anoop 2008-12-08 23:04:12 UTC
Sorry Volker. It was indeed my mistake not mentioning the changes we have made.

Sorry again.