From owner-freebsd-questions@FreeBSD.ORG Tue Jul 11 18:32:57 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CD56C16A4DA for ; Tue, 11 Jul 2006 18:32:57 +0000 (UTC) (envelope-from micahjon@ywave.com) Received: from relay2.av-mx.com (relay2.av-mx.com [137.118.16.124]) by mx1.FreeBSD.org (Postfix) with ESMTP id 50E7543D6A for ; Tue, 11 Jul 2006 18:32:56 +0000 (GMT) (envelope-from micahjon@ywave.com) X-Virus-Scan-Time: 0 Received: from [137.118.16.55] (HELO mx3.av-mx.com) by relay2.av-mx.com (CommuniGate Pro SMTP 4.2.10) with SMTP id 326303619 for freebsd-questions@freebsd.org; Tue, 11 Jul 2006 14:32:51 -0400 Received: (qmail 18631 invoked from network); 11 Jul 2006 18:32:50 -0000 Received: from dsl20226.ywave.com (HELO ?192.168.1.65?) (micahjon@ywave.com@216.227.107.226) by mx3.av-mx.com with SMTP; 11 Jul 2006 18:32:50 -0000 X-CLIENT-IP: 216.227.107.226 X-CLIENT-HOST: dsl20226.ywave.com Message-ID: <44B3EED0.4050401@ywave.com> Date: Tue, 11 Jul 2006 11:32:48 -0700 From: Micah User-Agent: Thunderbird 1.5.0.4 (X11/20060611) MIME-Version: 1.0 To: Thierry Lacoste References: <200607101841.21965.th.lacoste@wanadoo.fr> <44B3D0A7.4010206@ywave.com> <200607111946.47422.th.lacoste@wanadoo.fr> In-Reply-To: <200607111946.47422.th.lacoste@wanadoo.fr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: Segmentation fault with smbpasswd X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jul 2006 18:32:58 -0000 Thierry Lacoste wrote: > On Tuesday 11 July 2006 18:24, Micah wrote: >> Thierry Lacoste wrote: >>> I'm running FreeBSD 6.1-RELEASE and installed samba-3.0.22,1 >>> from a relatively recent snapshot or /usr/ports. >>> >>> Here is the global section of my /usr/local/etc/smb.conf: >>> >>> [global] >>> workgroup = OFFICE >>> server string = Samba Server >>> passdb backend = tdbsam >>> logon script = scripts\logon.bat >>> logon path = \\%L\Profiles\%U >>> logon drive = H: >>> logon home = \\%L\%U >>> domain logons = Yes >>> os level = 35 >>> preferred master = Yes >>> domain master = Yes >>> >>> After a fresh install of samba smbpasswd gives this: >>> [root@aldebaran ~]# smbpasswd -a admin >>> New SMB password: >>> Retype new SMB password: >>> Unable to open/create TDB passwd >>> Unable to open/create TDB passwd >>> pdb_getsampwnam: TDB passwd (/usr/local/private/passdb.tdb) did not >>> exist. File successfully created. >>> Segmentation fault: 11 (core dumped) >>> >>> Then it gives this: >>> [root@aldebaran ~]# smbpasswd -a admin >>> New SMB password: >>> Retype new SMB password: >>> Unable to open/create TDB passwd >>> pdb_getsampwnam: Unable to open TDB passwd >>> (/usr/local/private/passdb.tdb)! account_policy_get: tdb_fetch_uint32 >>> failed for field 1 (min password length), returning 0 >>> account_policy_get: tdb_fetch_uint32 failed for field 2 (password >>> history), returning 0 >>> account_policy_get: tdb_fetch_uint32 failed for field 3 (user must logon >>> to change password), returning 0 >>> account_policy_get: tdb_fetch_uint32 failed for field 4 (maximum password >>> age), returning 0 >>> account_policy_get: tdb_fetch_uint32 failed for field 5 (minimum password >>> age), returning 0 >>> account_policy_get: tdb_fetch_uint32 failed for field 6 (lockout >>> duration), returning 0 >>> account_policy_get: tdb_fetch_uint32 failed for field 7 (reset count >>> minutes), returning 0 >>> account_policy_get: tdb_fetch_uint32 failed for field 8 (bad lockout >>> attempt), returning 0 >>> account_policy_get: tdb_fetch_uint32 failed for field 9 (disconnect >>> time), returning 0 >>> account_policy_get: tdb_fetch_uint32 failed for field 10 (refuse machine >>> password change), returning 0 >>> TDBSAM version too old (0), trying to convert it. >>> TDBSAM converted successfully. >>> Added user admin. >>> >>> After that, samba seems to work properly. >>> >>> If I touch /usr/local/private/passdb.tdb after a fresh install of samba >>> I have directly the second behavior (no segfault) and then again samba >>> is operational. >>> >>> What did I miss? >>> >>> Regards, >>> Thierry. >> You possibly found a bug in the port. Contact the maintainer or file a pr. >> >> HTH, >> Micah > Thanks. I did contact the maintainer. > > I tried with FreeBSD 6.0-RELEASE and samba-3.0.14a_1,1 from the ToolKit disk. > When I first use smbpasswd I only have the account_policy_get failures > (no segfault). > > BTW I searched the web about the account_policy_get failures but couldn't > find any explanation exept that it is safe to ignore those messages when > smbpasswd is used for the first time. > Can someone shed some light on them? > > Regards, > Thierry. > My guess, without looking at the source code, is that smbpasswd tries to access passwddb.tbd before adding the first password. Since the file is empty, it's an invalid file and generates errors. HTH, Micah