Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option parsing should be more strict and only allow supported options and block all others #50

Open
whowutwut opened this issue Sep 19, 2018 · 1 comment

Comments

@whowutwut
Copy link
Member

When trying to delete a console... I was not sure if it was -d or -D and so i tried -D first, the output I saw is:

[root@stratton01 ~]# makegocons -D c910f3zz01
In preprocess_request, request is $VAR1 = {
          '_xcat_clientfqdn' => [
                                  'localhost'
                                ],
          'arg' => [
                     '-D'
                   ],
          '_xcat_authname' => [
                                'root'
                              ],
          '_xcat_clientport' => [
                                  45572
                                ],
          'node' => [
                      'c910f3zz01'
                    ],
          'username' => [
                          'root'
                        ],
          'noderange' => [
                           'c910f3zz01'
                         ],
          '_xcatdest' => '10.6.29.1',
          'cwd' => [
                   '/root'
                 ],
          '_allnodes' => [
                           0
                         ],
          'clienttype' => [
                            'cli'
                          ],
          '_xcat_clienthost' => [
                                  'localhost'
                                ],
          'command' => [
                         'makegocons'
                       ],
          '_xcatpreprocessed' => [
                                   1
                                 ]
        };

c910f3zz01: Created

So seems like some verbose (DEBUG?) data is printed, but the console is "Created"

The correct command is -d

[root@stratton01 ~]# makegocons -d c910f3zz01
c910f3zz01: Deleted
@zet809
Copy link

zet809 commented Sep 21, 2018

Hi, @whowutwut , it seems the -D|--debug means '$::DEBUG' for makegocons, and only used in preprocess_request.
L58-L65: https:/xcat2/xcat-core/blob/64d070b36d8c5279c8fb963539053f9c59dc72ca/xCAT-server/lib/xcat/plugins/goconserver.pm#L58-L65

# makegocons -d c910f3zz01 -D
In preprocess_request, request is $VAR1 = {
          '_xcat_clientfqdn' => [
                                  'localhost'
                                ],
          'arg' => [
                     '-d',
                     '-D'
                   ],
          '_xcat_authname' => [
                                'root'
                              ],
          '_xcat_clientport' => [
                                  48800
                                ],
          'node' => [
                      'c910f3zz01'
                    ],
          'username' => [
                          'root'
                        ],
          'noderange' => [
                           'c910f3zz01'
                         ],
          '_xcatdest' => '10.6.29.1',
          'cwd' => [
                   '/root'
                 ],
          '_allnodes' => [
                           0
                         ],
          'clienttype' => [
                            'cli'
                          ],
          '_xcat_clienthost' => [
                                  'localhost'
                                ],
          'command' => [
                         'makegocons'
                       ],
          '_xcatpreprocessed' => [
                                   1
                                 ]
        };

c910f3zz01: Deleted

But it seems this piece of code is copy from conserver.pm, maybe we shall add '-D|--debug' in the manpage of makegocons and makeconservercf.

@zet809 zet809 self-assigned this Sep 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants