Skip to content

Commit

Permalink
Merge branch 'Azure:master' into front_panel_port_name_regex
Browse files Browse the repository at this point in the history
  • Loading branch information
itamar-talmon authored Jul 26, 2022
2 parents 98ecb21 + d72e5ea commit e85f27a
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 1 deletion.
41 changes: 41 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.7 BLOCK -->

## Security

Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).

If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.

## Reporting Security Issues

**Please do not report security vulnerabilities through public GitHub issues.**

Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).

If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).

You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc).

Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:

* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
* Full paths of source file(s) related to the manifestation of the issue
* The location of the affected source code (tag/branch/commit or direct URL)
* Any special configuration required to reproduce the issue
* Step-by-step instructions to reproduce the issue
* Proof-of-concept or exploit code (if possible)
* Impact of the issue, including how an attacker might exploit the issue

This information will help us triage your report more quickly.

If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.

## Preferred Languages

We prefer all communications to be in English.

## Policy

Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).

<!-- END MICROSOFT SECURITY.MD BLOCK -->
13 changes: 13 additions & 0 deletions common/redisreply.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,19 @@ string RedisReply::formatReply(string command, const char* str, size_t len)
{
return string("True");
}

if (command == "PING")
{
// In redis-py, result for PING was hard coded: https://github.com/redis/redis-py/blob/bedf3c82a55b4b67eed93f686cb17e82f7ab19cd/redis/client.py#L796
if (result == "PONG")
{
return string("True");
}
else
{
return string("False");
}
}

return result;
}
Expand Down
6 changes: 6 additions & 0 deletions pyext/swsscommon.i
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ T castSelectableObj(swss::Selectable *temp)
%template(CastSelectableToRedisSelectObj) castSelectableObj<swss::RedisSelect *>;
%template(CastSelectableToSubscriberTableObj) castSelectableObj<swss::SubscriberStateTable *>;

// Handle object ownership issue with %newobject:
// https://www.swig.org/Doc4.0/SWIGDocumentation.html#Customization_ownership
// %newobject must declared before %include header files
%newobject swss::DBConnector::pubsub;
%newobject swss::DBConnector::newConnector;

%include "schema.h"
%include "dbconnector.h"
%include "sonicv2connector.h"
Expand Down
10 changes: 9 additions & 1 deletion tests/cli_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,20 @@ TEST(sonic_db_cli, test_cli_help)

TEST(sonic_db_cli, test_cli_ping_cmd)
{
char *args[2];
char *args[3];
args[0] = "sonic-db-cli";
args[1] = "PING";

auto output = runCli(2, args);
EXPECT_EQ("PONG\n", output);

// When ping with DB name, result should be 'True'
args[0] = "sonic-db-cli";
args[1] = "TEST_DB";
args[2] = "PING";

output = runCli(3, args);
EXPECT_EQ("True\n", output);
}

TEST(sonic_db_cli, test_cli_save_cmd)
Expand Down

0 comments on commit e85f27a

Please sign in to comment.