Skip to content

Commit 38bab91

Browse files
author
Rob Sanders
committed
The full name of a command is generated now in 'cli_register_command' rather than on the fly
Note that the 'cli->commandname' structure member no longer exists
1 parent 8ecddd5 commit 38bab91

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

libcli.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ struct cli_def {
7171
/* internal buffers */
7272
void *conn;
7373
void *service;
74-
char *commandname; // temporary buffer for cli_command_name() to prevent leak
74+
// char *commandname; // temporary buffer for cli_command_name() to prevent leak
7575
char *buffer;
7676
unsigned buf_size;
7777
struct timeval timeout_tm;
@@ -102,6 +102,7 @@ enum command_types {
102102

103103
struct cli_command {
104104
char *command;
105+
char *full_command_name;
105106
int (*callback)(struct cli_def *, const char *, char **, int);
106107
unsigned int unique_len;
107108
char *help;

libcli.spec

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ rm -rf $RPM_BUILD_ROOT
6767
%defattr(-, root, root)
6868

6969
%changelog
70+
* Wed Jan 27 2021 Rob Sa ders <rsanders@forcepoint.com> 1.10.5
71+
- Fix possible error where cli_command_name() returns a NULL by
72+
generating full command name when a command is registered.
73+
Note - removed cli->commandname member
74+
7075
* Thu Jan 14 2021 Rob Sanders <rsanders@forcepoint.com> 1.10.5
7176
- Fix issue where the help for 'long command name' winds up running into
7277
the actual help text w/o any spaces. Now a long command will be on a line

0 commit comments

Comments
 (0)