[Samba] Segmentation Fault when trying to set root samba password, IPA as a backend

Rowland penny rpenny at samba.org
Sun Mar 6 14:47:42 UTC 2016


On 06/03/16 14:12, Volker Lendecke wrote:
> On Fri, Mar 04, 2016 at 04:16:44PM +0000, Rowland penny wrote:
>> On 04/03/16 09:58, Volker Lendecke wrote:
>>> On Fri, Mar 04, 2016 at 10:53:17AM +0100, Volker Lendecke wrote:
>>>> On Wed, Mar 02, 2016 at 09:23:34AM +0000, Rowland penny wrote:
>>>>> OK, here is the output:
>>>> Can you try the attached (UNTESTED!) patch?
>>>>
>>>> Thanks,
>>> Gna, should have at least compiled it....
>>>
>>> New patch :-)
>>>
>>> Volker
>>>
>> Sorry Volker, it didn't work :-(
>>
>> It still segfaults and valgrind now shows more errors, see attached files
> Hmm. Looked pretty closely, but I don't see how this can happen, and
> I am out of the openldap config business long enough that I don't get
> this set up quickly.

>
> Can you run that under gdb? Set a breakpoint for
> smbldap_talloc_autofree_ldapmod with
>
> break smbldap_talloc_autofree_ldapmod
> run -a ldap05
>
> and when it hits the breakpoint, can you send me the output
> of "bt full"?
>
> Thanks,
>
> Volker
>

Hi Volker, I started the VM and tried what you said, it seemed to work 
ok, but the user wasn't added to ldap, so I tried adding another user 
'smbpasswd -a ldap07' and this worked without segfaulting. I then tried 
to add another user and this time it did segfault, so I ran gdb again 
and got this:

root at testpdc:~# gdb smbpasswd
GNU gdb (Debian 7.7.1+dfsg-5) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i586-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from smbpasswd...done.
(gdb) break smbldap_talloc_autofree_ldapmod
Function "smbldap_talloc_autofree_ldapmod" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y

Breakpoint 1 (smbldap_talloc_autofree_ldapmod) pending.
(gdb) run -a ldap09
Starting program: /usr/local/samba/bin/smbpasswd -a ldap09
[Thread debugging using libthread_db enabled]
Using host libthread_db library 
"/lib/i386-linux-gnu/i686/cmov/libthread_db.so.1".
New SMB password:
Retype new SMB password:

Breakpoint 1, smbldap_talloc_autofree_ldapmod (mem_ctx=0x80032f78,
     mod=0x80011a98) at ../source3/lib/smbldap.c:274
274        if (mod == NULL) {
(gdb) bt full
#0  smbldap_talloc_autofree_ldapmod (mem_ctx=0x80032f78, mod=0x80011a98)
     at ../source3/lib/smbldap.c:274
         handle = 0xbffff988
         __FUNCTION__ = "smbldap_talloc_autofree_ldapmod"
#1  0xb7d45b5b in ldapsam_get_new_rid (priv=0x80027aa8, rid=0xbffffb58)
     at ../source3/passdb/pdb_ldap.c:4854
         smbldap_state = 0x80027fc0
         result = 0x80036740
         entry = 0x80036740
         mods = 0x80011a98
         status = {v = 0}
         value = 0x0
         rc = -2147280760
         nextRid = 1012
         dn = 0xb70dbd06 "LDAPMessage *"
         mem_ctx = 0x80032f78
         __FUNCTION__ = "ldapsam_get_new_rid"
#2  0xb7d45c33 in ldapsam_new_rid_internal (methods=0x80027e28, 
rid=0xbffffb58)
     at ../source3/passdb/pdb_ldap.c:4882
         result = {v = 0}
         i = 0
#3  0xb7d46bd3 in ldapsam_create_user (my_methods=0x80027e28,
     tmp_ctx=0x8001e888, name=0x800081c0 <user_name> "ldap09", acb_info=16,
---Type <return> to continue, or q <return> to quit---
     rid=0xbffffb58) at ../source3/passdb/pdb_ldap.c:5248
         ldap_state = 0x80027aa8
         entry = 0x0
         result = 0x8001d468
         num_result = 0
         is_machine = false
         add_posix = true
         init_okay = false
         mods = 0x0
         user = 0x80036600
         filter = 0x80028468 "(&(uid=ldap09)(objectClass=posixAccount))"
         username = 0x0
         homedir = 0xb7dadf10 <incomplete sequence \370\215>
         gidstr = 0x800338f0 "\200\064f\267\200\064f\267"
         uidstr = 0xb7185e30 <incomplete sequence \355>
         shell = 0x1 <error: Cannot access memory at address 0x1>
         dn = 0x0
         group_sid = {sid_rev_num = 101 'e', num_auths = 0 '\000',
           id_auth = "\000\000!\330\027\267", sub_auths = {0, 0, 
3084355880,
             3071827504, 0, 0, 101, 3071793185, 0, 0, 2147706368, 
2147706320,
             3071787687, 3071793110, 3071752196}}
         user_sid = {sid_rev_num = 159 '\237', num_auths = -71 '\271',
           id_auth = "\022\267h\324\001\200", sub_auths = {0, 2147706368,
---Type <return> to continue, or q <return> to quit---
             3084553151, 2147647744, 0, 3071457625, 3084265071, 
3221224576, 0,
             3221224168, 3084108032, 2147603560, 2147603560, 3221224136,
             2147706368}}
         gid = 4294967295
         uid = 4294967295
         ret = {v = 3084574480}
         rc = 0
         __FUNCTION__ = "ldapsam_create_user"
#4  0xb7d6346f in pdb_create_user (mem_ctx=0x8001e888,
     name=0x800081c0 <user_name> "ldap09", flags=16, rid=0xbffffb58)
     at ../source3/passdb/pdb_interface.c:542
         pdb = 0x80027e28
#5  0xb7d54402 in local_password_change (
     user_name=0x800081c0 <user_name> "ldap09", local_flags=577,
     new_passwd=0x800118b8 "p4ssword", pp_err_str=0xbffffbb8,
     pp_msg_str=0xbffffbbc) at ../source3/passdb/passdb.c:745
         tosctx = 0x8001e888
         sam_pass = 0x80028100
         acb = 16
         rid = 0
         result = {v = 0}
         user_exists = false
         ret = -1
---Type <return> to continue, or q <return> to quit---
#6  0x800034ac in password_change (remote_mach=0x0,
     username=0x800081c0 <user_name> "ldap09", old_passwd=0x0,
     new_pw=0x800118b8 "p4ssword", local_flags=577)
     at ../source3/utils/smbpasswd.c:264
         ret = {v = 0}
         err_str = 0x0
         msg_str = 0x0
#7  0x80003c88 in process_root (local_flags=577)
     at ../source3/utils/smbpasswd.c:466
         pwd = 0x1
         result = 0
         old_passwd = 0x0
         __FUNCTION__ = "process_root"
#8  0x800041ad in main (argc=3, argv=0xbffffd14)
     at ../source3/utils/smbpasswd.c:627
         ok = true
         frame = 0x8001e888
         local_flags = 577
         ret = 3
(gdb) quit
A debugging session is active.

     Inferior 1 [process 2108] will be killed.

Quit anyway? (y or n) y


The user wasn't added to ldap, is it supposed to be when smbpasswd is 
run the way you suggested, or I am I doing something wrong?

Rowland



More information about the samba mailing list