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

fix solaris command #5035

Merged
merged 3 commits into from
Dec 22, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ All notable changes to the Wazuh app project will be documented in this file.
- Fixed agent deployment instructions for HP-UX and Solaris. [#4943](https:/wazuh/wazuh-kibana-app/pull/4943)
- Fixed Inventory checks table filters by stats [#4999](https:/wazuh/wazuh-kibana-app/pull/4999)
- Fixed vulnerabilities default last scan date formatter [#4975](https:/wazuh/wazuh-kibana-app/pull/4975)
- A solaris command has been fixed [5035](https:/wazuh/wazuh-kibana-app/pull/5035)

### Removed

Expand Down
22 changes: 14 additions & 8 deletions public/controllers/agent/components/register-agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,14 +305,16 @@ export const RegisterAgent = withErrorBoundary(

setAgentName(event) {
const validation = /^[a-z0-9-_.]+$/i;
if ((validation.test(event.target.value) && event.target.value.length >= 2)
|| event.target.value.length <= 0) {
if (
(validation.test(event.target.value) &&
event.target.value.length >= 2) ||
event.target.value.length <= 0
) {
this.setState({
agentName: event.target.value,
agentNameError: false,
badCharacters: []
badCharacters: [],
});

} else {
let badCharacters = event.target.value
.split('')
Expand All @@ -325,7 +327,7 @@ export const RegisterAgent = withErrorBoundary(
this.setState({
agentName: event.target.value,
badCharacters: characters,
agentNameError: true
agentNameError: true,
});
}
}
Expand Down Expand Up @@ -909,8 +911,12 @@ export const RegisterAgent = withErrorBoundary(
<EuiForm>
<EuiFormRow
isInvalid={this.state.agentNameError}
error={[this.state.badCharacters.length < 1 ? 'The minimum length is 2 characters.' :
`The character${this.state.badCharacters.length <= 1 ? ('') : ('s')}
error={[
this.state.badCharacters.length < 1
? 'The minimum length is 2 characters.'
: `The character${
this.state.badCharacters.length <= 1 ? '' : 's'
}
${this.state.badCharacters.map(char => ` "${char}"`)}
${this.state.badCharacters.length <= 1 ? 'is' : 'are'}
not valid. Allowed characters are A-Z, a-z, ".", "-", "_"`,
Expand Down Expand Up @@ -1003,7 +1009,7 @@ apk add wazuh-agent`,
this.state.selectedVersion == 'solaris11'
? 'wazuh-agent.p5p'
: 'wazuh-agent.pkg'
} ${this.optionalPackages()}${this.agentNameVariable()} && ${
} ${this.optionalPackages()} && ${
this.state.selectedVersion == 'solaris11'
? 'pkg install -g wazuh-agent.p5p wazuh-agent'
: 'pkgadd -d wazuh-agent.pkg'
Expand Down