Fix AD cache fill with alternate character sets

Description

PR: https://github.com/truenas/middleware/pull/6693

User reported AD cache fill failing on Shift-JIS encoded AD usernames
with a unicode decode error. Switch from using "net cache list" to
using py-tdb to iterate keys in a copy of samba's gencache.tdb file
comparing bytes of beginning of key to IDMAP/UID2SID and IDMAP/GID2SID.
This side-steps the name-to-sid entries that were choking us on decoding
output of subprocess.

We use gencache.tdb IDMAP/{X}ID2SID keys to determine before building
our user/group cache so that users in large AD environments can opt to have
us rely on entries already cached in winbindd. This reduces network traffic and
load on the AD DC.

Problem/Justification

None

Impact

None

SmartDraw Connector

Katalon Manual Tests (BETA)

Activity

Show:

Bug Clerk March 29, 2021 at 8:15 PM

Complete

Details

Assignee

Reporter

Components

Priority

More fields

Katalon Platform

Created March 29, 2021 at 6:49 PM
Updated April 13, 2021 at 5:10 PM
Resolved March 31, 2021 at 2:04 PM