[PR #149] [MERGED] fix: scp: abort early if host is not found to avoid a warn() #275

Closed
opened 2026-05-07 00:20:08 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/ovh/the-bastion/pull/149
Author: @speed47
Created: 2/23/2021
Status: Merged
Merged: 3/1/2021
Merged by: @speed47

Base: masterHead: scp


📝 Commits (1)

  • f604ec5 fix: scp: abort early if host is not found to avoid a warn()

📊 Changes

2 files changed (+13 additions, -0 deletions)

View changed files

📝 bin/plugin/open/scp (+9 -0)
📝 tests/functional/tests.d/340-selfaccesses.sh (+4 -0)

📄 Description

The following warn would happen if the scp wrapper was called with an invalid hostname:

Use of uninitialized value  in bitwise and (&) at /usr/share/perl5/Net/Netmask.pm line 699.
 at /opt/bastion/bin/plugin/open/../../../lib/perl/OVH/Bastion.pm line 41.
 OVH::Bastion::__ANON__("Use of uninitialized value \ in bitwise and (&) at /usr/shar"...) called at /usr/share/perl5/Net/Netmask.pm line 697
 Net::Netmask::match(Net::Netmask=HASH(0x55b1d5f11860), undef) called at /opt/bastion/lib/perl/OVH/Bastion/allowdeny.inc line 214
 OVH::Bastion::is_access_way_granted("port", 22, "exactUserMatch", 1, "ipfrom", "X.X.X.X", "ip", undef, ...) called at /opt/bastion/lib/perl/OVH/Bastion/allowdeny.inc line 688
 OVH::Bastion::is_access_granted(\"account\", \"johndoe\", \"user\", \"!scpupload\", \"ipfrom\", \"X.X.X.X\", \"ip\", undef, ...) called at /opt/bastion/bin/plugin/open/scp line 136

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ovh/the-bastion/pull/149 **Author:** [@speed47](https://github.com/speed47) **Created:** 2/23/2021 **Status:** ✅ Merged **Merged:** 3/1/2021 **Merged by:** [@speed47](https://github.com/speed47) **Base:** `master` ← **Head:** `scp` --- ### 📝 Commits (1) - [`f604ec5`](https://github.com/ovh/the-bastion/commit/f604ec5fb117fa83403ae40992bf4ac1d02dc83c) fix: scp: abort early if host is not found to avoid a warn() ### 📊 Changes **2 files changed** (+13 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `bin/plugin/open/scp` (+9 -0) 📝 `tests/functional/tests.d/340-selfaccesses.sh` (+4 -0) </details> ### 📄 Description The following warn would happen if the scp wrapper was called with an invalid hostname: ``` Use of uninitialized value in bitwise and (&) at /usr/share/perl5/Net/Netmask.pm line 699. at /opt/bastion/bin/plugin/open/../../../lib/perl/OVH/Bastion.pm line 41. OVH::Bastion::__ANON__("Use of uninitialized value \ in bitwise and (&) at /usr/shar"...) called at /usr/share/perl5/Net/Netmask.pm line 697 Net::Netmask::match(Net::Netmask=HASH(0x55b1d5f11860), undef) called at /opt/bastion/lib/perl/OVH/Bastion/allowdeny.inc line 214 OVH::Bastion::is_access_way_granted("port", 22, "exactUserMatch", 1, "ipfrom", "X.X.X.X", "ip", undef, ...) called at /opt/bastion/lib/perl/OVH/Bastion/allowdeny.inc line 688 OVH::Bastion::is_access_granted(\"account\", \"johndoe\", \"user\", \"!scpupload\", \"ipfrom\", \"X.X.X.X\", \"ip\", undef, ...) called at /opt/bastion/bin/plugin/open/scp line 136 ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-07 00:20:08 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/the-bastion#275
No description provided.