Opened 5 years ago

Closed 5 years ago

Last modified 3 years ago

#12962 closed defect (fixed)

smbpasswd Segmentation fault

Reported by: vlipert@… Owned by: developers
Priority: normal Milestone: Chaos Calmer 15.05
Component: packages Version: Trunk
Keywords: Cc:


After running "smbpasswd -a <whatever>" I've got "Segmentation fault".
Using revision 35412 from snapshots.
I don't know, if it would be hardware related - in that case I can send more info.

Attachments (2)

smbpasswd_fix_nonuser_segfault.patch (534 bytes) - added by НКВД 5 years ago.
Fix segfault when trying to add a non-existant user
smbpasswd (101 bytes) - added by anonymous 3 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 5 years ago by vlipert@…

Ups, currently I wanted to analyze stack trace with gdb and it worked without crashing :/ So please close it. In case I will know more, I will create new ticket.

comment:2 Changed 5 years ago by vlipert@…

Now I see it, it is crashing, when after "-a" is user, which is not in passwd file. Then I have coredump with this short stack trace:

(gdb) backtrace
#0 0x7738d360 in ?? ()
#1 0x7738569c in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

comment:3 Changed 5 years ago by vlipert@…

(gdb) info registers

zero at v0 v1 a0 a1 a2 a3

R0 00000000 00000001 000000ff 00000003 000000ff ffffffff 7f8028c8 fefe0000

t0 t1 t2 t3 t4 t5 t6 t7

R8 00000007 00000002 00000200 00000100 00000807 00000800 00000400 00000008

s0 s1 s2 s3 s4 s5 s6 s7

R16 005a8cc5 00000005 000000ff 005a8cc0 00000005 00460000 773bc124 00c433fc

t8 t9 k0 k1 gp sp s8 ra

R24 00000000 7738d340 00000000 00000000 773c43b0 7f8028a8 ffffffff 7738569c

sr lo hi bad cause pc

0100bc13 0001db02 00000098 000000ff 00800008 7738d360

fsr fir

00000000 00000000

(gdb) x/64x $sp
0x7f8028a8: 0x7f8028b8 0x77435558 0x00000000 0x77420000
0x7f8028b8: 0x7f8028c8 0x77435404 0x773c43b0 0x77420000
0x7f8028c8: 0x00000000 0x774352b4 0x00000000 0x7f8029b8
0x7f8028d8: 0x00000000 0x77435160 0x00000000 0x00000000
0x7f8028e8: 0x7743f000 0x00000000 0x77435690 0x00000000
0x7f8028f8: 0x00000000 0x00000000 0x00000000 0x00000000
0x7f802908: 0x00000000 0x00000000 0x00000000 0x00000000
0x7f802918: 0x00000000 0x00000000 0x00000000 0x00000000
0x7f802928: 0x00000000 0x00000000 0x00000000 0x00000000
0x7f802938: 0x00000000 0x00000000 0x00000000 0x00000000
0x7f802948: 0x00000000 0x7f802950 0x00000000 0x00000000
0x7f802958: 0x00000000 0x00000000 0x7743f000 0x0000022d
0x7f802968: 0x005a8cc7 0xffffffff 0x00000000 0x00000073
0x7f802978: 0x00000000 0x00000020 0x00000000 0x00000001
0x7f802988: 0x00000013 0x00010000 0x00000003 0x00000008
0x7f802998: 0x00000008 0x00000008 0x00000008 0x00000008

Changed 5 years ago by НКВД

Fix segfault when trying to add a non-existant user

comment:4 Changed 5 years ago by НКВД

Patch to fix segfault when trying to add an user which is not present in /etc/passwd file. Tested on ar71xx.

Index: package/network/services/samba36/patches/111-owrt_smbpasswd.patch
--- package/network/services/samba36/patches/111-owrt_smbpasswd.patch	(revision 35416)
+++ package/network/services/samba36/patches/111-owrt_smbpasswd.patch	(working copy)
@@ -113,7 +113,7 @@
 +	}
 +	if (!find_passwd_line(fp, user, &p1)) {
-+		printf("User %s not found or invalid in /etc/passwd\n");
++		printf("User %s not found or invalid in /etc/passwd\n", user);
 +		goto out;
 +	}

comment:5 Changed 5 years ago by jogo

  • Resolution set to fixed
  • Status changed from new to closed

Thanks, applied in r35610. Next time please submit the patch to the mailing list (see SubmittingPatches).

Changed 3 years ago by anonymous

comment:6 Changed 3 years ago by anonymous

Accidentally attached file to wrong tab, instead of ticket #19652. Please ignore.

Add Comment

Modify Ticket

as closed .
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.