diff options
author | Drew DeVault <[email protected]> | 2016-12-04 08:30:40 -0500 |
---|---|---|
committer | GitHub <[email protected]> | 2016-12-04 08:30:40 -0500 |
commit | 5778c59a2f302071fd781683db57a97b51396c87 (patch) | |
tree | e0ec272832e88e6c8d92719efa70c6749452daff /sway/commands/commands.c | |
parent | cd5694fdb5bc9beb575902ea57d037833ad8e85c (diff) | |
parent | e7a764fdf450a8259ddbc17446dd720fa1157b44 (diff) |
Merge pull request #981 from SirCmpwn/security
Security features
Diffstat (limited to 'sway/commands/commands.c')
-rw-r--r-- | sway/commands/commands.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/sway/commands/commands.c b/sway/commands/commands.c new file mode 100644 index 00000000..5d248e30 --- /dev/null +++ b/sway/commands/commands.c @@ -0,0 +1,23 @@ +#include <stdbool.h> +#include <string.h> +#include "sway/commands.h" +#include "sway/config.h" +#include "list.h" +#include "log.h" + +struct cmd_results *cmd_commands(int argc, char **argv) { + struct cmd_results *error = NULL; + if ((error = checkarg(argc, "commands", EXPECTED_EQUAL_TO, 1))) { + return error; + } + + if (strcmp(argv[0], "{") != 0) { + return cmd_results_new(CMD_FAILURE, "commands", "Expected block declaration"); + } + + if (!config->reading) { + return cmd_results_new(CMD_FAILURE, "commands", "Can only be used in config file."); + } + + return cmd_results_new(CMD_BLOCK_COMMANDS, NULL, NULL); +} |