View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0008024 | Kali Linux | Kali Package Bug | public | 2022-10-26 11:05 | 2023-01-05 04:39 |
Reporter | X0RW3LL | Assigned To | arnaudr | ||
Priority | low | Severity | crash | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 2022.3 | ||||
Summary | 0008024: kali-tweaks crashes on unhandled UnicodeDecodeError | ||||
Description | kali-tweaks will crash when selecting the Hardening screen. Reason being that the samba helper script [kali-tweaks/helpers/samba] will call assert_config_file_valid() on line 36 (https://gitlab.com/kalilinux/packages/kali-tweaks/-/blob/kali/master/helpers/samba#L36), which in turn calls testparm /etc/samba/smb.conf --suppress-prompt The real issue here is that testparm will return improperly encoded bytes that Python's not handling gracefully in the run command. Many thanks to Arszilla for helping out with this, and the team for their consideration | ||||
Steps To Reproduce | 1) Pull the latest package upgrades | ||||
Additional Information | ################################################################################# | ||||
Update: testparm will display this issue when /etc/samba/smb.conf is explicitly passed as an argument. Since testparm will pull configs from that location by default without explicit paths, we can use a workaround where we rely on the implicit location instead. Proposed changes for kali-tweaks/helpers/samba lines 43 and 45 are as follows:
|
|
Thanks for reporting! The variables SAMBA_CONFIG is needed for unit tests, where we don't use the default location /etc/samba/smb.conf. So we can't remove it. The bug is really new. I tested and couldn't reproduce it. Then I upgraded the system: <pre> And then I could reproduce the bug. At first glance, it's not easy to see what package is guilty... However: <pre> ┌──(kali㉿kali)-[~] Surely that's where the regression comes from. I opened an issue on the Debian bugtracker: https://bugs.debian.org/1022826 |
|
Thank you so much, arnaudr! Yeah, I thought the workaround was a long shot, but now I'm really curios as to how you got to the point of locating the exact package/library that caused this. Only if you have the time to share your thought process though! I've never submitted any bug reports outside of here tbh, so it's a bit of a learning curve for me. I really appreciate you doing this <3 Many thanks! |
|
I was just lucky :) I picked up a one week-old Kali VM, the bugs didn't manifest, I upgraded it, and the bug was there. So the bug was introduced by one of the packages that were pulled in by the upgrade (list above). Then I just had to find which package was related to testparm. "testparm" is provided by samba-common-bin (you can see that with "apt-file search bin/testparm"), then I looked at the dependencies for samba-common-bin (with "apt show samba-common-bin"), compared that with the packages that were upgraded. libpopt0 was the only one that I spot. I could confirm that testparm links against libpopt with "ldd /usr/bin/testparm | grep libpopt". Plus, libpopt is a library to parse cmdline arguments, and that's exactly the problem that we have here, testparm chokes if we pass it a config file in argument. But if I didn't have a (rather short) list of packages that were brought in by the "apt full-upgrade" command, it would have been much harder to find out. |
|
Anyway, so a new version of Samba was uploaded to Debian unstable, it should be in Kali at some point next week. Ideally, kali-tweaks should handle this kind of unexpected errors more gracefully, and a setting that is not functional should just be greyed out, or something like that. I opened an issue for that: https://gitlab.com/kalilinux/packages/kali-tweaks/-/issues/36 |
|
And finally, I just released kali-tweaks 2022.4.1 with the workaround that you mentioned (ie. not giving a config file to testparm). Should land in Kali rolling in a day or so, I'll keep an eye on it. Thanks again for the detailed report! |
|
Awesome! That's exactly what I was looking for! kali-tweaks has been one of my favorite tools for quickly managing configs, so many thanks for such a great solution! |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2022-10-26 11:05 | X0RW3LL | New Issue | |
2022-10-26 11:32 | X0RW3LL | Note Added: 0017003 | |
2022-10-26 14:52 | arnaudr | Note Added: 0017004 | |
2022-10-26 14:53 | arnaudr | Note Edited: 0017004 | |
2022-10-26 14:53 | arnaudr | Note Edited: 0017004 | |
2022-10-26 18:36 | X0RW3LL | Note Added: 0017005 | |
2022-10-27 01:30 | arnaudr | Note Added: 0017006 | |
2022-10-27 01:32 | arnaudr | Note Edited: 0017006 | |
2022-10-27 01:47 | arnaudr | Note Added: 0017007 | |
2022-10-27 02:06 | arnaudr | Note Added: 0017008 | |
2022-10-27 02:06 | arnaudr | Assigned To | => arnaudr |
2022-10-27 02:06 | arnaudr | Status | new => assigned |
2022-10-27 05:20 | X0RW3LL | Note Added: 0017010 | |
2023-01-05 04:39 | arnaudr | Status | assigned => resolved |
2023-01-05 04:39 | arnaudr | Resolution | open => fixed |