-
Notifications
You must be signed in to change notification settings - Fork 546
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
103 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
--- libcli.c~ 2021-02-25 10:45:54.000000000 -0600 | ||
+++ libcli.c 2024-01-31 14:30:15.418883824 -0600 | ||
@@ -427,7 +427,7 @@ | ||
struct cli_command *c; | ||
|
||
if (!command) return NULL; | ||
- if (!(c = calloc(sizeof(struct cli_command), 1))) return NULL; | ||
+ if (!(c = calloc(1, sizeof(struct cli_command)))) return NULL; | ||
c->command_type = CLI_REGULAR_COMMAND; | ||
c->callback = callback; | ||
c->next = NULL; | ||
@@ -597,7 +597,7 @@ | ||
struct cli_def *cli; | ||
struct cli_command *c; | ||
|
||
- if (!(cli = calloc(sizeof(struct cli_def), 1))) return 0; | ||
+ if (!(cli = calloc(1, sizeof(struct cli_def)))) return 0; | ||
|
||
cli->buf_size = 1024; | ||
if (!(cli->buffer = calloc(cli->buf_size, 1))) { | ||
@@ -1940,7 +1940,7 @@ | ||
char *search_flags = cli_get_optarg_value(cli, "search_flags", NULL); | ||
|
||
filt->filter = cli_match_filter; | ||
- filt->data = state = calloc(sizeof(struct cli_match_filter_state), 1); | ||
+ filt->data = state = calloc(1, sizeof(struct cli_match_filter_state)); | ||
if (!state) return CLI_ERROR; | ||
|
||
if (!strcmp(cli->pipeline->current_stage->words[0], "include")) { | ||
@@ -2033,7 +2033,7 @@ | ||
// from the command line processing and continue | ||
|
||
filt->filter = cli_range_filter; | ||
- filt->data = state = calloc(sizeof(struct cli_range_filter_state), 1); | ||
+ filt->data = state = calloc(1, sizeof(struct cli_range_filter_state)); | ||
if (state) { | ||
state->from = from; | ||
state->to = to; | ||
@@ -2070,7 +2070,7 @@ | ||
} | ||
|
||
filt->filter = cli_count_filter; | ||
- if (!(filt->data = calloc(sizeof(int), 1))) return CLI_ERROR; | ||
+ if (!(filt->data = calloc(1, sizeof(int)))) return CLI_ERROR; | ||
|
||
return CLI_OK; | ||
} | ||
@@ -2127,7 +2127,7 @@ | ||
struct cli_command *c; | ||
|
||
if (!command) return NULL; | ||
- if (!(c = calloc(sizeof(struct cli_command), 1))) return NULL; | ||
+ if (!(c = calloc(1, sizeof(struct cli_command)))) return NULL; | ||
|
||
c->command_type = CLI_FILTER_COMMAND; | ||
c->init = init; | ||
@@ -2239,7 +2239,7 @@ | ||
goto CLEANUP; | ||
} | ||
} | ||
- if (!(optarg = calloc(sizeof(struct cli_optarg), 1))) goto CLEANUP; | ||
+ if (!(optarg = calloc(1, sizeof(struct cli_optarg)))) goto CLEANUP; | ||
if (!(optarg->name = strdup(name))) goto CLEANUP; | ||
if (help && !(optarg->help = strdup(help))) goto CLEANUP; | ||
|
||
@@ -2505,7 +2505,7 @@ | ||
struct cli_command *c; | ||
|
||
if (!command) return NULL; | ||
- if (!(c = calloc(sizeof(struct cli_command), 1))) return NULL; | ||
+ if (!(c = calloc(1, sizeof(struct cli_command)))) return NULL; | ||
|
||
c->flags = flags; | ||
c->callback = callback; | ||
@@ -3068,7 +3068,7 @@ | ||
struct cli_pipeline_stage *stage = &pipeline->stage[stage_num]; | ||
pipeline->current_stage = stage; | ||
cli->found_optargs = stage->found_optargs; | ||
- *filt = calloc(sizeof(struct cli_filter), 1); | ||
+ *filt = calloc(1, sizeof(struct cli_filter)); | ||
if (*filt) { | ||
if ((rc = stage->command->init(cli, stage->num_words, stage->words, *filt) != CLI_OK)) { | ||
break; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"Signatures": { | ||
"e60d4cca3d0e702c60ad0f9e2eecaa461baa4744.tar.gz": "59d54a197a5ec9aeaf0cde2c8252f27488db96c17286c1fc4aeecd2fc6e1f535" | ||
"libcli-1.10.7.tar.gz": "179f78592f73492c22cc1b544b6f8cb0f6630a2f670430c118b8e084e6562e74" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
Vendor: Microsoft Corporation | ||
Distribution: Azure Linux | ||
%global _hardened_build 1 | ||
%global commit0 e60d4cca3d0e702c60ad0f9e2eecaa461baa4744 | ||
|
||
Name: libcli | ||
Version: 1.9.7 | ||
Version: 1.10.7 | ||
Release: 1%{?dist} | ||
Summary: A shared library for a Cisco-like cli | ||
License: LGPLv2+ | ||
URL: https://github.com/dparrish/libcli | ||
Source0: https://github.com/dparrish/libcli/archives/%{commit0}.tar.gz | ||
Patch0: libcli-win32issue.patch | ||
Source0: https://github.com/dparrish/libcli/archive/refs/tags/V%{version}.tar.gz#/%{name}-%{version}.tar.gz | ||
|
||
Patch0: calloc.patch | ||
|
||
%package devel | ||
Summary: Development files for libcli | ||
Requires: %{name}%{?_isa} = %{version}-%{release} | ||
|
||
BuildRequires: gcc | ||
BuildRequires: make | ||
|
||
%description | ||
Libcli provides a shared library for including a Cisco-like command-line | ||
interface into other software. It's a telnet interface which supports | ||
|
@@ -32,9 +34,9 @@ user-definable function tree. | |
These are the development files. | ||
|
||
%prep | ||
%setup -qn %{name}-%{commit0} | ||
%setup -q | ||
|
||
%patch 0 -p1 | ||
%patch -P 0 -p0 | ||
|
||
%build | ||
|
||
|
@@ -44,22 +46,26 @@ make %{?_smp_mflags} | |
install -d -p %{buildroot}%{_includedir} | ||
install -p -m 644 libcli*.h %{buildroot}%{_includedir}/ | ||
install -d -p %{buildroot}%{_libdir} | ||
install -p -m 755 libcli.so.1.9.7 %{buildroot}%{_libdir}/ | ||
ln -s %{_libdir}/libcli.so.1.9.7 %{buildroot}%{_libdir}/libcli.so.1.9 | ||
ln -s %{_libdir}/libcli.so.1.9 %{buildroot}%{_libdir}/libcli.so | ||
install -p -m 755 libcli.so.%{version} %{buildroot}%{_libdir}/ | ||
ln -s %{_libdir}/libcli.so.%{version} %{buildroot}%{_libdir}/libcli.so.1.10 | ||
ln -s %{_libdir}/libcli.so.1.10 %{buildroot}%{_libdir}/libcli.so | ||
|
||
%ldconfig_scriptlets | ||
|
||
%files | ||
%doc COPYING | ||
%{_libdir}/*.so.* | ||
%{_libdir}/*.so.1.10* | ||
|
||
%files devel | ||
%doc README | ||
%doc README.md | ||
%{_libdir}/*.so | ||
%{_includedir}/*.h | ||
|
||
%changelog | ||
* Mon Nov 11 2024 Jyoti Kanase <[email protected]> - 1.10.7-1 | ||
- Update to 1.10.7 | ||
- License verified | ||
|
||
* Thu Oct 14 2021 Pawel Winogrodzki <[email protected]> - 1.9.7-1 | ||
- Initial CBL-Mariner import from Fedora 32 (license: MIT). | ||
- Converting the 'Release' tag to the '[number].[distribution]' format. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters