bsp: Allow for arguments in passwd function #119

Closed
fbl wants to merge 1 commits from fbl/firmware:passwd into master
Owner

Previously, we have added a passwd function to our shell which executes
passwd and restarts uhttpd afterwards, so the WebUI password is updated.

This adds the ability to still pass command-line arguments to passwd.

Fixes: #117
Signed-off-by: Fabian Bläse fabian@blaese.de

Previously, we have added a passwd function to our shell which executes passwd and restarts uhttpd afterwards, so the WebUI password is updated. This adds the ability to still pass command-line arguments to passwd. Fixes: #117 Signed-off-by: Fabian Bläse <fabian@blaese.de>
fbl added this to the 20210218 milestone 2021-02-13 18:51:56 +01:00
fbl added the
bug
label 2021-02-13 18:51:56 +01:00
fbl self-assigned this 2021-02-13 18:51:56 +01:00
fbl added 1 commit 2021-02-13 18:51:56 +01:00
4dfc57bc3f bsp: Allow for arguments in passwd function
Previously, we have added a passwd function to our shell which executes
passwd and restarts uhttpd afterwards, so the WebUI password is updated.

This adds the ability to still pass command-line arguments to passwd.

Fixes: #117
Signed-off-by: Fabian Bläse <fabian@blaese.de>
rohammer approved these changes 2021-02-13 19:34:50 +01:00
rohammer left a comment
Member

Das ist wichtig.

Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Das ist wichtig. ``` Reviewed-by: Robert Langhammer <rlanghammer@web.de> ```
Owner

Auch noch ins stable release?

Auch noch ins stable release?
adschm reviewed 2021-02-13 20:39:58 +01:00
@ -15,3 +15,3 @@
# update uhttpd passwd on passwd-change
[ -e /etc/rc.d/S50uhttpd ] && passwd() { /bin/passwd && /etc/init.d/uhttpd restart; }
[ -e /etc/rc.d/S50uhttpd ] && passwd() { /bin/passwd "$@" && /etc/init.d/uhttpd restart; }
Owner

Machen die Anführungszeichen nicht aus mehreren Argumenten eines?

Machen die Anführungszeichen nicht aus mehreren Argumenten eines?
Author
Owner

Erstaunlicherweise: nein.

Würde sich das $@ "normal" verhalten, wärs sowohl mit als auch ohne falsch:

  • Mit würde alles ein Argument werden
  • Ohne würden Argumente mit Leerzeichen zu mehreren werden

$@ ist aber ein "Special Parameter", für den besondere Regeln gelten:

When the expansion occurs within double quotes, each parameter expands to a separate word. That is, "$@" is equivalent to "$1" "$2" ...

(Aus der bash man-page)

Erstaunlicherweise: nein. Würde sich das $@ "normal" verhalten, wärs sowohl mit als auch ohne falsch: * Mit würde alles ein Argument werden * Ohne würden Argumente mit Leerzeichen zu mehreren werden $@ ist aber ein "Special Parameter", für den besondere Regeln gelten: > When the expansion occurs within double quotes, each parameter expands to a separate word. That is, "$@" is equivalent to "$1" "$2" ... (Aus der bash man-page)
Author
Owner

Hinweis auf das besondere Quoting von $@ hinzugefügt und applied.

Hinweis auf das besondere Quoting von $@ hinzugefügt und applied.
fbl closed this pull request 2021-02-18 01:22:16 +01:00

Pull request closed

Sign in to join this conversation.
No description provided.