Bug 54588 - univention-ssh --help is wrong
univention-ssh --help is wrong
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: SSH
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 5.0-1-errata
Assigned To: Èric Monné Mesalles
Philipp Hahn
https://git.knut.univention.de/univen...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2022-03-24 16:15 CET by Philipp Hahn
Modified: 2022-06-08 16:50 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.034
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): bitesize
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2022-03-24 16:15:12 CET
> Syntax:
>   univention-ssh [-timeout timeout] <pwd_file> [options] [user@]host <command>
...
> Parameters:
>   pwd_file                         file containing the password
>   options                          optional options to univention-ssh
...
> Options:
>   -timeout:                        timeout for operation in seconds
>   --no-split:                      don't word-split command


Actually '--no-split' must be *before* <pwd_file>.

Example:
/usr/sbin/univention-ssh --no-split <(echo -n univention) root@localhost "univention-ldapsearch -LLL '(&(objectClass=person)(uid=$HOSTNAME\$)(!(univentionServerRole=masterXXX)))' 1.1"
Comment 1 Èric Monné Mesalles univentionstaff 2022-05-11 10:42:36 CEST
Updated the `--help` information. With the new displayed text, the `--no-split` appears before the `<pwd_file>` to advise of the variable order.

This is fixed with version 11.0.0-4A of the package univention-ssh.
See commit 2d10e0c0.
Comment 2 Philipp Hahn univentionstaff 2022-05-12 13:14:18 CEST
univention-ssh.yaml
745455a17f9f | Bug #54588: update YAML for univention-ssh
2d10e0c0e41d | Bug #54588: Fix wrong ssh description. Add --no-split option before password file.

univention-ssh (11.0.0-4)
2d10e0c0e41d | Bug #54588: Fix wrong ssh description. Add --no-split option before password file.

Package: univention-ssh
Version: 11.0.0-4A~5.0.0.202205111018
Branch: ucs_5.0-0
Scope: errata5.0-1

OK: univention-ssh.yaml
OK: errata-announce  -V --only univention-ssh.yaml
OK: apt install univention-ssh -t apt
OK: univention-ssh --help
FAIL: univention-scp --help
FAIL: univention-ssh-rsync --help

The usage text for all 3 commands is confusing; compare it to `man -l doc/univention-ssh.8`:

> univention-ssh: internal managing tool for UCS clients

→ Internal command to use SSH with plain text password authentication

> Copyright (c) 2001-2022 Univention GmbH, Germany
> 
> Syntax:
>   univention-ssh [-timeout timeout] [--no-split] <pwd_file> [options] [user@]host <command>

→ univention-ssh [-timeout <seconds>] [--no-split] <pwd_file> [ssh-options] [<user>@]<host> <command> [<arguments>...]

>   univention-ssh [--help] [--version]
> 
> Parameters:

Python argparse names this section "positional arguments".

>   pwd_file                         file containing the password
>   options                          optional options to univention-ssh

→ ssh-options  additional options to ssh

>   user                             user to log in as on the remote system
>   host                             name or ip address of the remote system
>   command                          command to be executed on remote system

argumemts  additional arguments to remote command

> Options:
>   -timeout:                        timeout for operation in seconds

-timeout SECONDS:      …

>   --no-split:                      don't word-split command
>   -h | --help | -?:                print this usage message
>   --version:                       print version information
> 
> Description:
>   univention-ssh is an internal managing tool which is used to

univention-ssh is an internal command to use SSH with plain text password authentication, which is used to

>   execute commands on remote computer systems,
>   e.g. univention-ssh /tmp/pwd root@192.168.0.31 ls -la /


Similar for `univention-scp --help` and `univention-ssh-rsync --help`:

> univention-scp: internal managing tool for UCS clients

similar to above

> Syntax:
>   univention-scp [-timeout timeout] <pwd_file> [options] files [user@]host:[path]

here `scp-options` or `rsync-options` are correct, which requires duplicating the template.

>   univention-scp [--help] [--version]
> 
> Parameters:
>   pwd_file                         file containing the password
>   options                          optional options to univention-scp

s.o.

>   files                            source files or directories
>   user                             user to log in as on the remote system
>   host                             name or ip address of the remote system
>   path                             destination on the remote system
> 
> Options:
>   -timeout:                        timeout for operation in seconds
>   --no-split:                      don't word-split command

Technical univention-scp/…-ssh-rsync accepts this option too, but the old "split" semantics is even stranger for them.
Nevertheless we should also add [--no-split] to Syntax above.

>   -h | --help | -?:                print this usage message
>   --version:                       print version information
> 
> Description:
>   univention-scp is an internal managing tool which is used to

univention-ssh is an internal command to use SCP/rsync with plain text password authentication, which is used to

>   copy files from/to remote computer systems,
>   e.g. univention-scp /tmp/pwd file.txt root@192.168.0.31:


TODO: While you are at it please also fix the spelling mistake in doc/univention-ssh.8: rsyn{v → c} and convert ssh to \fBssh\fP in the Note: line.
PS: You're free to replace the local function `trim` with `from textwrap import dedent` and then use dedent(text).strip("\n") instead.
Comment 3 Èric Monné Mesalles univentionstaff 2022-05-31 11:25:01 CEST
The purposed changes were updated on the following commits:

4bf672b074 Bug #54588: add errata file
215532222e Bug #54588: fix consinsistency of help messages
0a41f67e58 Bug #54588: add --no-split to scp and rsync too
b2bf75e9b2 Bug #54588: change trim function to dedent
ad53046d3f Bug #54588: change trim function to dedent
65f230c117 Bug #54588: Fix spelling mistake rsynv to rsync, and bold to ssh on note section
745455a17f Bug #54588: update YAML for univention-ssh
2d10e0c0e4 Bug #54588: Fix wrong ssh description. Add --no-split option before password file.
Comment 4 Èric Monné Mesalles univentionstaff 2022-06-07 11:54:15 CEST
Fixed on version 11.0.0-5A~5.0.0.202206071147

* Updated the description message for `univention-scp` and `univention-rsync`
*Fix spelling mistake rsyn{v->c}
* Change local trim function to imported `dedent` function
Comment 5 Philipp Hahn univentionstaff 2022-06-08 16:14:50 CEST
OK: univention-ssh.yaml
OK: errata-announce  -V --only univention-ssh.yaml
OK: apt install univention-ssh -t apt
OK: univention-ssh --help
OK: univention-scp --help
OK: univention-ssh-rsync --help
OK: spelling mistake in doc/univention-ssh.8
OK:
c128810bf9 Bug #54588: update YAML for univention-ssh
f1660ce3c7 Bug #54588: Improve univention scp and rsync help description
745455a17f Bug #54588: update YAML for univention-ssh
2d10e0c0e4 Bug #54588: Fix wrong ssh description. Add --no-split option before password file.