Skip to content

Replace Perl call with libcrypt#651

Open
misaochan wants to merge 1 commit into
iiab:masterfrom
misaochan:perl-hotfix
Open

Replace Perl call with libcrypt#651
misaochan wants to merge 1 commit into
iiab:masterfrom
misaochan:perl-hotfix

Conversation

@misaochan

Copy link
Copy Markdown
Contributor
  • Calls libcrypt.so.1 directly via ctypes instead of spawning Perl. The password is passed as raw bytes to the C function.
  • Adds a module-level threading.Lock() around the crypt() call. Without the lock, concurrent AUTHENTICATE requests caused a segfault during testing.

Libcrypt maintenance

libcrypt.so.1 is provided by libxcrypt (Ubuntu core package). This is unrelated to Python's removed crypt stdlib module or the crypt_r pypi replacement - we call the C library directly via ctypes, bypassing that issue entirely. libxcrypt is actively maintained and ships on all modern Ubuntu/Debian systems.

Tests

  • Ran cmdsrv manually
  • Confirmed wrongpass); echo 0 # returns "User or Password Incorrect" with no server-side execution
  • Confirmed legitimate password change succeeds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant