Repository navigation
tacctl 0.2.30 - #49
Merged
Merged
Conversation
Every release ships a rollback target for the release before it. 0.2.30 so far changes no stored file 0.2.29 reads strictly (the only change is a stricter check on the name of a new user, which writes no new form of a file), so the plan of the target converts nothing: no key and no field is removed, no snapshot is taken, no --yes is needed and every file stays, the console's file transfer settings, the limits of the stored reports, the per-tier sudoers drop-in (0.2.29 and 0.2.30 write the same text), the pull records, the reports in the users' homes, the marker of the offer of the PDF tools and every user, whatever the name. None of the steps of rollbackAdditions fires for it. It is refused only while a device's apply is not settled, as every target is. The command ends with the upgrade and has no closing note. 0.2.29 stops being "not a release to roll back to" in the version refusal and becomes the release before this one; 0.2.28 stays a target and converts nothing. The usage, the completion, the top-level help and its golden file list it, the lists of "every target but" in the code comments, the documentation and the manual page name 0.2.29 beside 0.2.28, and the next steps of the 0.2.28 target are those of 0.2.29. rollbackFrom, the release a snapshot's state is of in the note that follows a rollback, is 0.2.30, and the tests that quote the note say so (TestRollbackFromIsTheReleaseOfTheChangelog passes with the new heading). docs/install/upgrading.md gets a "To 0.2.29" section and says sixteen targets; docs/cli/conventions.md, docs/releasing.md, docs/cli/emergency.md, docs/cli/user.md, docs/devices/reports.md and the manual page list the target; the CHANGELOG has item 1 of 0.2.30. Tests: the version check, the plan with and without state (nothing removed, no snapshot, no --yes, console.yaml untouched), --hosts, an unsettled apply, the 0.2.29 tag's console reader and per-tier text (skipped without git or the tag), the command (the dry run, the apply and a second run, the 0.2.27 target told apart, the lockdown, the drop-in, the refusal that names the targets), the completion and the usage golden, and the bats test of the target.
Every new user gets a Linux account, here and on the enrolled hosts, and a name that starts with a digit or '-' is no account name. 'user add' and the new name of 'user rename' now refuse a first character that is not a lower case letter (a to z; a digit, '-' and '_' are refused, '_' because the project does not take it for a new name though Linux does), with one sentence that names the rule and the name, exit status 1, nothing changed. names.RejectNonLetterUsername is the check, next to RejectLongUsername, and names.CheckNewUsername runs the whole creation check in a documented order: the shape, the reserved names, upper case, the length, the first character. So 'Alice' and '1Alice' are told the lower case spelling first and the letter rule follows on the retry. Both verbs call it. ValidateUsername stays what every other verb runs: a user that exists as 9dave, _svc or -x is shown, changed, renamed away, removed, restored and carried by the upgrade as before. config validate warns, under Names:, of an existing user whose name starts with a digit or '-' (no Linux account, here or on a host) and names 'tacctl user rename <name> <new-name>', the rename that must itself pass the creation rules; a name that starts with '_' has an account and gets no warning. The length finding (lengthFindings) becomes userNameFindings and says every fault of a name in its one finding. --fix-names (caseFindings) offers the lower case spelling of a name with upper case only when that spelling passes all the rules of a new name. For '1Alice', 'Alice' followed by 41 characters, '_Alice' or 'Root' it offers nothing and the user has exactly one finding, userNameFindings', with no contradicting fix; --fix-names counts nothing as not offered or failed and exits 0 for it. Tests: names (the check, the order), 'user add' and 'user rename' with every kind of first character, users of any first character kept working through every verb and a restore, config validate in text and --json and --fix-names for 1alice, -x, 1Alice, Alice and 41 characters, 1Alice and 41 characters, _Svc (and a plain Bobby still offered), and the test of a user with no Linux account name and the hosts, which now creates the user in the fixture store directly. Documentation: docs/cli/user.md (user add, user rename, A new name starts with a letter), docs/cli/config.md, docs/cli/maintenance.md, docs/install/upgrading.md, the manual page, and CHANGELOG item 2 of 0.2.30.
The host-notice filter in otherHostsWith (a name that is no Linux account name has no account on any host) lost its test when the 'user add' case became a refusal: 'user passwd' returns at its barrier before the filter. The table now runs the verbs that reach afterUserChange (disable, enable, move, scope, remove, rename away, require-password-change) on a stored '9dave' in the scope of an enrolled host: each must exit 0 and name no host and offer no sync. Dropping the LinuxName check from otherHostsWith makes disable, enable, move, scope and remove fail.
…has no account The comments of the lockdown-on-hosts and firewall rollback steps listed the targets that keep their parts as 0.2.28 and older; 0.2.29 keeps them too (the code does, and a test pins it). The comments on the user-name findings said a user with upper case has an account; a Linux account name is lower case, so such a user has none. Comments only, no behaviour change.
CheckNewUsername put the upper case check first, so '1Alice' was told to
use '1alice', and the retry was refused by the letter rule; the same for
'_Alice', 'Root' (reserved) and an upper case name over 32 characters.
The lower-case message is now given only when the lower-case spelling
passes every other check, so that the suggestion is a name the command
takes. Otherwise the answer is the first check the lower-case spelling
fails, said with the name as typed and with "lower case" among what to
fix: the reserved name ('root', 'tacquito'), the length (plus "Names are
lower case as well."), or "must be lower case and start with a letter".
A name with no upper case is checked in the order it had: shape,
reserved, length, first character.
A stored user whose name starts with '_' and is over 32 characters is
now told the letter rule as well as the length in the 'config validate'
finding, so that a replacement such as '_svc' is not refused next.
Tests: the order table, the suggestion being accepted itself, the user
add and rename refusals, the over-long '_' finding, the findings of a
stored 'Root' and 'Tacquito' (text, json, --fix-names: one finding,
nothing offered), and a stored '-x' through show, passwd, disable, move,
rename away and remove (a bare word works; '--' is not an end-of-options
marker of the user verbs).
CHANGELOG item 2 said a digit, '-' and '_' were refused although Linux itself would take them; only '_' is a valid first character of a Linux account name. Reworded in place: a digit and '-', which no account name starts with, and '_', which Linux would take, are refused. The pages that told an upper case name 'the lower-case spelling first, the letter rule on the retry' (docs/cli/user.md, docs/install/upgrading.md, the manual page, the CHANGELOG item) now say what the code does: the spelling is suggested only when it is accepted, else the first check it fails is the answer. Also said: a stored name over 32 characters that starts with '_' is warned of with the letter rule too, and a stored '-x' is typed as a bare word (the user verbs have no '--'). man/tacctl.1 regenerated with make man.
Whitespace only; fold into the docs commit before it.
The two sentences about 'ssh --login' were added to tierNotes by withSSHNotes in internal/cli/shell_view.go, because the 'ssh' row is an AnySub row. They are now the Note of the 'ssh' and 'device ssh' rows in internal/tier/tier.go, and withSSHNotes is gone: tier.Notes() already keys an AnySub row as "ssh " (empty Sub), the key the man generator trims and the shell help reads. The tier test that kept a Note off AnySub rows now asks only that a row with a Note has a Cmd and a Sub unless it is an AnySub row. No user-visible change: the texts are byte for byte the same, and man/tacctl.1 is unchanged.
On a FAIL, gate-go.sh now prints up to ten 'FAIL: <test>' lines above the verdict line, after the skipped and slowest lines: one for each '--- FAIL:' line of the log (a top-level test or a subtest, a name once, in the order of the log). A package that failed without a failing test (a build failure, a panic, a timeout) is named by its 'FAIL <package>' line instead. This is the form gate-ci.sh already uses for its failures, and the one a tool reading a gate's output for failing test names looks for; before, a FAIL printed only the verdict line and the log path. The verdict line is unchanged and stays the last line. gate_go.bats covers a failing test, subtests and duplicates, the limit of ten, a package without a failing test, the order among the lines above the verdict and a PASS without any. The header of the script and AGENTS.md say so.
On an NFS export with root_squash the three commands that write as root (config render --dry-run, config linux script, remove-script) pass the path check and are refused by the write. The tests pin that each says in one line which path was not written and Permission denied, exits 1 and leaves no new or half-written file and the old one as it was. The refusal is made with a directory its owner cannot write; the tests skip as root.
The conventions page, the manual page and the changelog say that the commands that write as root write nothing into a home that root cannot write, name the path and the cause in one line, and what to do instead.
The console ends a file transfer only when every audit line is logged, one 'logger' process per line, in order. The lines waited in a queue of 256, so a client that did many small requests and then left was held until the console had logged all that was still queued: measured with a fake logger of 5 ms a call and 200 requests, the console returned 1.09 s after the client's close, with 197 lines still to log. The queue holds 32 lines now (sftpAuditQueue): at most that many are left when the client leaves (0.19 s at that speed), and a client that is ahead of the audit is held back by it request by request instead. No line is dropped or reordered and none is logged after the console has ended; a line cannot be logged after the process without losing it, so the bound is on the backlog, not on the drain. TestConsoleSFTPEndsWithABacklogOfAuditLines is the measurement and the regression test: it bounds the lines that had not begun when the last request was answered (a count a loaded host cannot change), checks every line and their order, and only logs the time. CHANGELOG item 3.
tests/README.md, diff corpus section: say that the run against the 0.1.18 baseline is informational (0 stale markers, 17 inert doubled markers, about 281 unmarked differences) and that the gate is the run against the previous release tag. Say that a @known directly followed by another @known is inert, that 17 exist and are kept as a record, and that a new doubled marker is merged into one. No marker, the runner or the policy changes.
# Conflicts: # CHANGELOG.md
gate-go.sh prints up to ten "FAIL: <name>" lines above its FAIL verdict line (a failing test from the "--- FAIL:" lines of the log, else the package of a "FAIL <package>" line). The README described the skipped and slowest lines but not these; add them in the same place and say which tool reads them.
…der and completeness A full queue blocks the goroutine that serves a request, against the contract of sftpd.Config.Audit, and the whole session takes as long as its lines take to log whatever the size. The CHANGELOG item about the queue is dropped and the next one renumbered. The test no longer bounds the backlog by the constant under test.
A home others may not search is refused by the path check; in one they may search the two commands that write as root write nothing. The advice is to write the file on the local disk and copy it as yourself. A test pins the refusal of the home others cannot search.
A run with a failing test and a package that failed to build names only the test; the build failure is counted in failures= and is in the log. The header, AGENTS.md and tests/README.md say so, and a bats case pins the mixed log.
The check fails for a row without Cmd, and also for an AnySub row that has a Sub and for a row that is not AnySub and has none. The old text, 'a row without Cmd and Sub', no longer described that, so the message now names the condition: a note on a row without Cmd, or whose Sub does not match AnySub.
…the caller outPath stat'ed the path as root (Lstat, EvalSymlinks) also for the commands that then write through asCaller: device config plan, device reports export and device support-bundle. On an NFS home with root_squash that others cannot search (0700, 0750) root cannot look at the path, so the check refused it with "cannot be resolved (Permission denied)" although the write, as the caller, would work. outPathAsCaller runs the file-system calls of the check through asCaller; outPath keeps running them as root for the two commands that write as root (config render --dry-run, config linux script|remove-script), where the check must fail where the write would. Both are one function, checkOutPath, so there is one place for the rules. A test replaces the identity switch, which needs root, with hooks.asCallerRun; the switch itself stays covered by TestWithFSIdentity. A "cannot be resolved (<cause>)" refusal is about what the file system says, not about the spelling of the path: it now gives the cause and the path and no longer ends with the hint about ~ and variables, which stays on the refusals about the spelling. The CHANGELOG, the docs page and the man page follow in the next commit.
Describes the change of the previous commit. CHANGELOG item 3 of 0.2.30 (unreleased) is narrowed to the two commands that write as root (config render --dry-run, config linux script|remove-script), which still check the path as root and so still refuse a root_squash home that others cannot search; the new item 4 is the user-visible part: device config plan, device reports export and device support-bundle work in such a home, and a "cannot be resolved" refusal no longer carries the hint about ~ and variables. docs/cli/conventions.md (Paths you name to write) now says which commands check as the caller and which as root, and man/tacctl.1 says it at the device config plan --out spot.
…ns with times count The library drops the attribute flags of an open request, so the handlers could not tell a twelve byte block of the permissions with the times (what the scp of OpenSSH 9 sends with -p) from a size with the permissions, and read only a block of four bytes. The session now reads the client's packets through a filter that frames the stream, passes every packet but an open through as it came, and rewrites the attribute block of an open to the permissions alone (or to nothing) using the flags it finds there. openMode is unchanged and reads the result: a file made by scp -p is created with the permission bits of the request (less the umask of the console) and not 0644, and a size is never read as a mode. An open that is too short or too long to be rewritten is passed on, and gets the default mode. The umask, the owner-write restore and the 4-byte cases are as before. Nothing under vendor/ changes. The tests that pinned the 12 byte block as asking for nothing now pin the permissions.
The console page and the manual page said the open request of scp -p was read as carrying no permissions, so the file was created 0644 (0600 after the umask) and got its mode only from the fsetstat. The open request is now read with its attribute flags, so both pages say the mode is given at creation whatever else the request carries, and the CHANGELOG has the item.
…he type byte The filter read the type byte of every packet before it handed the four length bytes to the library, even when the length was zero or above the limit of the library (256 KiB). A client that sent only the length of a 300 KiB packet and then stayed silent used to end the session at once with "packet too long"; with the filter the session waited for one more byte or for the client to close. The length now decides first: a length of zero or above maxOpenPacket goes through as the four bytes alone and the rest of the packet is passed on as it comes, so the library answers from the length as it did before the filter. Only a length in range reads the type byte, and the type byte test no longer carries the length. The count of bytes to pass is capped at MaxInt32 so that it cannot go negative where an int has 32 bits. The test is the experiment of the review: a raw connection sends the four bytes of the length of a 300 KiB packet and nothing else, and the session must end with the library's error. It fails (the session does not end) on the previous code. The comment of maxOpenPacket said that an open over 64 KiB cannot be a real open because its path is too long. That is not so: the library cleans the path, so one padded with "./" opens the same file, and a block of extended attributes can be long too. Such an open is passed through as it came and openMode gives the new file the default mode, the safe side. The comments now say that.
…heck as the caller in the man page for all three commands The page of the console and the manual page said a new file gets the mode the client asks for in the open request, whatever other attributes it carries. That is exact only up to the length the filter reads whole: an open longer than 64 KiB is passed through as it came and gets the default mode, 0644 before the umask. Both texts now say so, and that such an open is not one real clients send (a path padded with "./", which the library cleans to the same file, or a long block of extended attributes). CHANGELOG item 4 and docs/cli/conventions.md say that the three commands that write as the caller (device config plan, device reports export, device support-bundle) check the path as the caller, so a home exported by NFS with root_squash that others may not search is no obstacle. The manual page said it only at device config plan; the same sentence is now at the entries of device reports export --out and device support-bundle --out. It is hand-written text outside the generated blocks, and make man changes nothing.
The notes tell what the numbered list of the CHANGELOG (0.2.30) holds, checked against the code and the pages: a new user name starts with a lower-case letter (item 2), what a root_squash home does to the commands that write as root and to the three that write as the caller, with the path check run as the caller and no hint for a path that cannot be resolved (items 3 and 4), a file uploaded with scp -p created with the mode of its source less the umask (item 5), and the rollback target 0.2.29, which converts nothing (item 1; sixteen targets). They have the form of the notes of 0.2.29 and are what the release preflight (tests/tools/release-notes-check.sh 0.2.30) asks for.
…p mode The section "To 0.2.29" of the upgrade page said that the check of the name of a new user and the documentation were all that 0.2.30 changed outside the stored files. It also changed the user the check of the path of three commands runs as (item 4) and the mode scp -p creates a file with (item 5), and a rollback to 0.2.29 brings both back: say so, as the sections of the older targets say what the later releases changed. The count of the targets (sixteen) and the lists of "every target but" were checked against internal/lifecycle/rollback.go and the CLI's argument list and stand as they are.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
release 0.2.30