9
0
Fork 0
Commit Graph

15 Commits

Author SHA1 Message Date
Andrey Smirnov 04d8c2541d common/parser.c: Do not treat zero return code as error
Run_command() would return zero to indicated success so treating it as
error case would completely break command repetition logic, so change
comparinson operator from "less or equal" to "less then"

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-15 08:56:21 +02:00
Andrey Smirnov 822ad01d5d common/parser.c: Do not conflate error reporting disciplines
Run_command() uses 0 to indicate success and negative values to
indicate errors, whereas execute_command() uses 0 for success and
positive integers to represent error codes. Conflating the two breaks
the code that calls run_command and then checks for error code sign to
detect problems, so avoid that by doing a very simple transformation
on the result of execute_command

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-15 08:56:21 +02:00
Sascha Hauer 90e766a78f login: rework login mechanism
We used to have the login functionality in the /env/bin/init script.
This is hard to review and it's too easy to break the login functionality
with changes to this script. Move the places to ask for a password to
C code where we have only a few places where we have to ask for a password.
Mainly these are run_shell() and the menutree command.

This patch introduces a login() function which will only return if the correct
password has been entered. Following calls will return immediately without
asking for a password again.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-28 08:00:27 +02:00
Antony Pavlov 177cab00ce treewide: fix 'new blank line at EOF' formatting error
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-02 09:39:58 +02:00
Sascha Hauer 93578fb233 run_command: remove unused flag parameter
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-07 07:41:26 +01:00
Jean-Christophe PLAGNIOL-VILLARD 56ee5d3aac process_escape_sequence: add support to \$?
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-18 09:17:13 +02:00
Sascha Hauer a01e54d201 treewide: fix format specifiers
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-27 14:24:10 +01:00
Robert Schwebel c84a37d52b parser: use debug macros
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-01 11:44:48 +01:00
Sascha Hauer ef7ff70ca4 consolidate command calling in execute_command
Signed-off-by: Sascha Hauer <sha@pengutronix.de>
2009-10-19 10:18:51 +02:00
Menon, Nishanth d005435609 Remove part #ifdefed with #if (CONFIG_COMMANDS & CFG_CMD_BOOTD) which is
false everytime
2008-05-12 15:55:55 +02:00
Sascha Hauer d27e123c53 make simple parser compile again 2007-10-01 09:54:10 +02:00
Sascha Hauer 14b5c2a647 - teach hush to honour PATH variable
- remove common/main.c. This is now handled in the different shells.
2007-09-24 01:40:06 +02:00
Sascha Hauer 98432d3925 svn_rev_683
more cleanups, fix compiler warnings
2007-07-05 18:02:16 +02:00
Sascha Hauer 005ce6fef6 svn_rev_412
remove repeatable commands
2007-07-05 18:01:51 +02:00
Sascha Hauer 798de5071d svn_rev_307
some main.c cleanup:
- move the parser used when hush is disabled to parser.c
- move readline related functions to readline.c (with cmdline editing)
  and readline_simple.c (no cmdline editing)
2007-07-05 18:01:42 +02:00