Skip to content

Add RFC 9271 attachment command aliases - #3710

Draft
user01010111 wants to merge 4 commits into
networkupstools:masterfrom
user01010111:fix/issue-3637-attachment-aliases
Draft

user01010111 wants to merge 4 commits into
networkupstools:masterfrom
user01010111:fix/issue-3637-attachment-aliases

Conversation

@user01010111

@user01010111 user01010111 commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Add ATTACH, DETACH and GET NUMATTACH while retaining LOGIN, LOGOUT and GET NUMLOGINS. The aliases share the existing authentication and attachment accounting; duplicate errors follow the requested spelling, and HELP lists the preferred names. DETACH closes the entire connection.

Add preferred C/C++, Python and Perl API names and update upsmon to use the new attachment and count commands. Legacy fallback requires an exact unsupported-command reply; count queries also accept the INVALID-ARGUMENT response returned by older servers. Existing C++ subclasses and library SONAMEs are preserved. Implicit C and Python cleanup retains LOGOUT for prompt compatibility with older servers; explicit detach APIs negotiate the preferred command.

Draft implementation for #3637 while the protocol discussion continues.

Validation:

  • Strict GCC and Clang builds; OpenSSL, NSS and no-TLS client paths.
  • Real old/new server and upsmon combinations, attachment accounting and shutdown ordering using a dummy UPS and a harmless shutdown command.
  • Preferred and legacy APIs, exact fallback, malformed and lost replies, and TLS cleanup checks.
  • An old-header binary with the new library and a subclass compiled against the old C++ interface; no removed exports and unchanged SONAMEs.
  • Python: 19 tests; Perl: 268 checks, existing unit suites, and the NUT integration suite with TLS required (37 passed, 0 failed at case level).
  • Real manual-page build, spellcheck, source style/ASCII checks and make distcheck-light including build, tests, install and uninstall.

Native Windows builds and client/server tests also passed, including immediate attachment release on old and new servers. Five existing Windows CppUnit branches are unimplemented, and the unrelated become_user() subcheck requires root; all affected attachment and cleanup checks ran. Hosted CI has not run.

Prepared with assistance from OpenAI Codex (GPT-6).

Prepared with assistance from OpenAI Codex (GPT-6).

Signed-off-by: user01010111 <12504630+user01010111@users.noreply.github.com>
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

A ZIP file with standard source tarball and another tarball with pre-built docs for commit 869c691 is temporarily available: NUT-tarballs-PR-3710.zip.

Comment thread tests/attachment-client.cpp Dismissed
Comment thread tests/attachment-client.cpp Dismissed
Replace "subclasses" with "derived classes" in libnutclient_misc(3)
without changing the C++ API compatibility explanation.

AppVeyor and the tarball build reject "subclasses". The newer local
English dictionary accepts it; the tarball job's aspell-en 2020.12.07
dictionary reproduces the failure with the same local Aspell executable.

The focused project spellcheck target fails before this change and passes
after it with the CI dictionary, including the non-ASCII check. The
affected manual builds and renders with the replacement wording.

Signed-off-by: user01010111 <12504630+user01010111@users.noreply.github.com>
@jimklimov jimklimov added documentation C++ refactor/fightwarn PR or issue proposal to improve code maintainability without functional changes, or to fix warnings python NUT protocols perl Perl binding code for NUT portability We want NUT to build and run everywhere possible labels Sep 29, 2026
@jimklimov jimklimov added this to the 2.8.7 milestone Oct 1, 2026
@github-actions github-actions Bot deleted a comment from AppVeyorBot Oct 18, 2026
@github-actions github-actions Bot deleted a comment from AppVeyorBot Oct 18, 2026
@github-actions github-actions Bot deleted a comment from AppVeyorBot Oct 18, 2026
@github-actions github-actions Bot deleted a comment from AppVeyorBot Oct 18, 2026
@github-actions github-actions Bot deleted a comment from AppVeyorBot Oct 26, 2026
@AppVeyorBot

Copy link
Copy Markdown

✅ Build nut 2.8.5.5911-master completed (commit 066adae1f4 by @jimklimov)

@AppVeyorBot

Copy link
Copy Markdown

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

Labels

C++ documentation NUT protocols perl Perl binding code for NUT portability We want NUT to build and run everywhere possible python refactor/fightwarn PR or issue proposal to improve code maintainability without functional changes, or to fix warnings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants