summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Roskin <plroskin@gmail.com>2016-02-14 10:27:17 -0800
committerPavel Roskin <plroskin@gmail.com>2016-02-14 10:27:17 -0800
commit50cbf01044474b6828a772b2d45dc8c661a6ccb7 (patch)
tree082cda5e9cb181cd5159032343de2e92ce739e9e
parent92a6833e9b808301bb3435bc1290f4b8d6242be5 (diff)
downloadxrdp-proprietary-50cbf01044474b6828a772b2d45dc8c661a6ccb7.tar.gz
xrdp-proprietary-50cbf01044474b6828a772b2d45dc8c661a6ccb7.zip
xrdp-sesadmin: show help and exit if mandatory arguments are not given
Don't mark password as mandatory, it's asked if not provided on the command line.
-rw-r--r--sesman/tools/sesadmin.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sesman/tools/sesadmin.c b/sesman/tools/sesadmin.c
index fcf995d8..3415b75b 100644
--- a/sesman/tools/sesadmin.c
+++ b/sesman/tools/sesadmin.c
@@ -101,7 +101,14 @@ int main(int argc, char **argv)
if (0 == g_strncmp(user, "", 1))
{
- g_strncpy(user, "root", 256);
+ cmndHelp();
+ return 0;
+ }
+
+ if (0 == g_strncmp(cmnd, "", 1))
+ {
+ cmndHelp();
+ return 0;
}
if (0 == g_strncmp(pass, "", 1))
@@ -171,7 +178,7 @@ void cmndHelp()
fprintf(stderr, "sesadmin - a console sesman administration tool\n");
fprintf(stderr, "syntax: sesadmin [] COMMAND [OPTIONS]\n\n");
fprintf(stderr, "-u=<username>: username to connect to sesman [MANDATORY]\n");
- fprintf(stderr, "-p=<password>: password to connect to sesman [MANDATORY]\n");
+ fprintf(stderr, "-p=<password>: password to connect to sesman (asked if not given)\n");
fprintf(stderr, "-s=<hostname>: sesman host (default is localhost)\n");
fprintf(stderr, "-i=<port> : sesman port (default 3350)\n");
fprintf(stderr, "-c=<command> : command to execute on the server [MANDATORY]\n");