Segfault with "net ads password"

Esh, Andrew AEsh at
Fri Nov 1 21:54:01 GMT 2002

Looks like this bit of code is failing:

utils/net_ads.c, lines 877-886, function "net_ads_password"

    /* use the realm so we can eventually change passwords for users 
    in realms other than default */
    if (!(ads = ads_init(realm, NULL, NULL))) return -1;

    asprintf(&prompt, "Enter new password for %s:", argv[0]);

    new_password = getpass(prompt);

    ret = kerberos_set_password(ads->auth.kdc_server, auth_principal, 
				auth_password, argv[0], new_password,

the last line is reached with "ads->auth.kdc_server" as a bad (null?)
pointer.  The "ads_init" function creates the ads structure and zeroes it.
It doesn't appear to me as though "ads_init" initializes ads->auth, and I
don't see where else it gets set.

-----Original Message-----
From: James Willard [mailto:james at]
Sent: Friday, November 01, 2002 2:23 PM
To: samba-technical at
Subject: RE: Segfault with "net ads password"

And as a follow-up to myself... The following is a backtrace from gdb:

Program received signal SIGSEGV, Segmentation fault.
0x080ec329 in interpret_addr ()
(gdb) bt
#0  0x080ec329 in interpret_addr ()
#1  0x080ec462 in interpret_addr2 ()
#2  0x080efbe0 in open_udp_socket ()
#3  0x0810f56c in krb5_set_password ()
#4  0x0810fdbf in kerberos_set_password ()
#5  0x0806b17c in net_ads_password ()
#6  0x08068690 in net_run_function ()
#7  0x0806b51c in net_ads ()
#8  0x08068690 in net_run_function ()
#9  0x080697d3 in main ()
#10 0x42017589 in __libc_start_main () from /lib/i686/


James Willard
james at

-----Original Message-----
From: samba-technical-admin at
[mailto:samba-technical-admin at] On Behalf Of James
Sent: Friday, November 01, 2002 2:12 PM
To: samba-technical at
Subject: Segfault with "net ads password"


I'm trying to troubleshoot a problem I've been having for the past
several weeks with "net ads password" attempting to change a users'
password. I'm using the Samba 3.0 CVS tree updated this morning (even
though there has been no difference in behavior in the past month or
so). I'm running:

net ads password UserName at DOMAIN.COM -U Admin at REALM.COM%Password

I receive a prompt:

Enter new password for UserName at DOMAIN.COM:

I enter a password and then it segfaults. Below are excerpts from a

write(3, "kadmin", 6)                   = 6
write(3, "\0\0\0\10", 4)                = 4
write(3, "changepw", 8)                 = 8
write(3, "\0\0\0\0", 4)                 = 4
write(3, NULL, 0)                       = 0
fcntl64(3, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) =
close(3)                                = 0
time(NULL)                              = 1036176903
gettimeofday({1036176903, 994633}, NULL) = 0 gettimeofday({1036176903,
995109}, NULL) = 0
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++

The operating system is RedHat Linux 7.3 on a PIII with krb5-1.2.5 and

What other information would be useful in tracking down this bug?


James Willard
james at
-------------- next part --------------
HTML attachment scrubbed and removed

More information about the samba-technical mailing list