-
Notifications
You must be signed in to change notification settings - Fork 783
GUACAMOLE-2300: Add IPMI Serial-over-LAN protocol support #692
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
Open
ciroiriarte
wants to merge
14
commits into
apache:main
Choose a base branch
from
ciroiriarte:feature/ipmi-protocol
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
a20fff3
GUACAMOLE-2300: Add IPMI Serial-over-LAN protocol with chassis power …
ciroiriarte 49e05b0
GUACAMOLE-2300: IPMI: fix module linking under --as-needed linkers
ciroiriarte 991f6a9
GUACAMOLE-2300: IPMI: multivendor workarounds, encryption policy, eng…
ciroiriarte c93354d
GUACAMOLE-2300: IPMI: add boot-device-persistent and keepalive-interv…
ciroiriarte 3cf11d0
GUACAMOLE-2300: IPMI: add System Event Log viewer and alternate-scree…
ciroiriarte c32d50f
GUACAMOLE-2300: IPMI: run chassis control menu operations asynchronously
ciroiriarte d6ca8f8
GUACAMOLE-2300: IPMI: add ipmi-control pipe channel for client-agnost…
ciroiriarte 737c69e
GUACAMOLE-2300: IPMI: push SOL connection status on establish/teardown
ciroiriarte 64c022d
GUACAMOLE-2300: IPMI: harden SOL input write against partial writes a…
ciroiriarte 8e7cfda
GUACAMOLE-2300: IPMI: add unit tests for the control-channel JSON parser
ciroiriarte 7f566ba
GUACAMOLE-2300: IPMI: avoid NULL dereference freeing a never-created …
ciroiriarte 38c3474
GUACAMOLE-2300: IPMI: fix use-after-free by joining the SOL worker be…
ciroiriarte c451326
GUACAMOLE-2300: IPMI: review hardening — scrub credentials, guard bre…
ciroiriarte c1e4652
GUACAMOLE-2300: IPMI: address review follow-ups
ciroiriarte File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,73 @@ | ||
| # | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
| # | ||
| # NOTE: Parts of this file (Makefile.am) are automatically transcluded verbatim | ||
| # into Makefile.in. Though the build system (GNU Autotools) automatically adds | ||
| # its own license boilerplate to the generated Makefile.in, that boilerplate | ||
| # does not apply to the transcluded portions of Makefile.am which are licensed | ||
| # to you by the ASF under the Apache License, Version 2.0, as described above. | ||
| # | ||
|
|
||
| AUTOMAKE_OPTIONS = foreign | ||
| ACLOCAL_AMFLAGS = -I m4 | ||
|
|
||
| SUBDIRS = . tests | ||
|
|
||
| lib_LTLIBRARIES = libguac-client-ipmi.la | ||
|
|
||
| libguac_client_ipmi_la_SOURCES = \ | ||
| argv.c \ | ||
| chassis.c \ | ||
| client.c \ | ||
| clipboard.c \ | ||
| control.c \ | ||
| input.c \ | ||
| ipmi.c \ | ||
| menu.c \ | ||
| pipe.c \ | ||
| settings.c \ | ||
| user.c | ||
|
|
||
| noinst_HEADERS = \ | ||
| argv.h \ | ||
| chassis.h \ | ||
| client.h \ | ||
| clipboard.h \ | ||
| control.h \ | ||
| input.h \ | ||
| ipmi.h \ | ||
| menu.h \ | ||
| pipe.h \ | ||
| settings.h \ | ||
| user.h | ||
|
|
||
| libguac_client_ipmi_la_CFLAGS = \ | ||
| -Werror -Wall -Iinclude \ | ||
| @LIBGUAC_INCLUDE@ \ | ||
| @IPMI_CFLAGS@ \ | ||
| @TERMINAL_INCLUDE@ | ||
|
|
||
| libguac_client_ipmi_la_LIBADD = \ | ||
| @COMMON_LTLIB@ \ | ||
| @LIBGUAC_LTLIB@ \ | ||
| @TERMINAL_LTLIB@ \ | ||
| @IPMI_LIBS@ | ||
|
|
||
| libguac_client_ipmi_la_LDFLAGS = \ | ||
| -version-info 0:0:0 \ | ||
| @PTHREAD_LIBS@ |
This file contains hidden or 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,96 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| #include "config.h" | ||
| #include "argv.h" | ||
| #include "ipmi.h" | ||
| #include "terminal/terminal.h" | ||
|
|
||
| #include <guacamole/protocol.h> | ||
| #include <guacamole/socket.h> | ||
| #include <guacamole/user.h> | ||
|
|
||
| #include <stdio.h> | ||
| #include <stdlib.h> | ||
| #include <string.h> | ||
|
|
||
| int guac_ipmi_argv_callback(guac_user* user, const char* mimetype, | ||
| const char* name, const char* value, void* data) { | ||
|
|
||
| guac_client* client = user->client; | ||
| guac_ipmi_client* ipmi_client = (guac_ipmi_client*) client->data; | ||
| guac_terminal* terminal = ipmi_client->term; | ||
|
|
||
| /* Skip if terminal not yet ready */ | ||
| if (terminal == NULL) | ||
| return 0; | ||
|
|
||
| /* Update color scheme */ | ||
| if (strcmp(name, GUAC_IPMI_ARGV_COLOR_SCHEME) == 0) | ||
| guac_terminal_apply_color_scheme(terminal, value); | ||
|
|
||
| /* Update font name */ | ||
| else if (strcmp(name, GUAC_IPMI_ARGV_FONT_NAME) == 0) | ||
| guac_terminal_apply_font(terminal, value, -1, 0); | ||
|
|
||
| /* Update only if font size is sane */ | ||
| else if (strcmp(name, GUAC_IPMI_ARGV_FONT_SIZE) == 0) { | ||
| int size = atoi(value); | ||
| if (size > 0) | ||
| guac_terminal_apply_font(terminal, NULL, size, | ||
| ipmi_client->settings->resolution); | ||
| } | ||
|
|
||
| return 0; | ||
|
|
||
| } | ||
|
|
||
| void* guac_ipmi_send_current_argv(guac_user* user, void* data) { | ||
|
|
||
| /* Defer to the batch handler, using the user's socket to send the data */ | ||
| guac_ipmi_send_current_argv_batch(user->client, user->socket); | ||
|
|
||
| return NULL; | ||
|
|
||
| } | ||
|
|
||
| void guac_ipmi_send_current_argv_batch( | ||
| guac_client* client, guac_socket* socket) { | ||
|
|
||
| guac_ipmi_client* ipmi_client = (guac_ipmi_client*) client->data; | ||
| guac_terminal* terminal = ipmi_client->term; | ||
|
|
||
| /* Send current color scheme */ | ||
| guac_client_stream_argv(client, socket, "text/plain", | ||
| GUAC_IPMI_ARGV_COLOR_SCHEME, | ||
| guac_terminal_get_color_scheme(terminal)); | ||
|
|
||
| /* Send current font name */ | ||
| guac_client_stream_argv(client, socket, "text/plain", | ||
| GUAC_IPMI_ARGV_FONT_NAME, | ||
| guac_terminal_get_font_name(terminal)); | ||
|
|
||
| /* Send current font size */ | ||
| char font_size[64]; | ||
| snprintf(font_size, sizeof(font_size), "%i", | ||
| guac_terminal_get_font_size(terminal)); | ||
| guac_client_stream_argv(client, socket, "text/plain", | ||
| GUAC_IPMI_ARGV_FONT_SIZE, font_size); | ||
|
|
||
| } | ||
This file contains hidden or 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,89 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| #ifndef GUAC_IPMI_ARGV_H | ||
| #define GUAC_IPMI_ARGV_H | ||
|
|
||
| #include <guacamole/argv.h> | ||
| #include <guacamole/user.h> | ||
|
|
||
| /** | ||
| * The name of the parameter that specifies/updates the color scheme used by | ||
| * the terminal emulator. | ||
| */ | ||
| #define GUAC_IPMI_ARGV_COLOR_SCHEME "color-scheme" | ||
|
|
||
| /** | ||
| * The name of the parameter that specifies/updates the name of the font used | ||
| * by the terminal emulator. | ||
| */ | ||
| #define GUAC_IPMI_ARGV_FONT_NAME "font-name" | ||
|
|
||
| /** | ||
| * The name of the parameter that specifies/updates the font size used by the | ||
| * terminal emulator. | ||
| */ | ||
| #define GUAC_IPMI_ARGV_FONT_SIZE "font-size" | ||
|
|
||
| /** | ||
| * Handles a received argument value from a Guacamole "argv" instruction, | ||
| * updating the given connection parameter. | ||
| */ | ||
| guac_argv_callback guac_ipmi_argv_callback; | ||
|
|
||
| /** | ||
| * Sends the current values of all non-sensitive parameters which may be set | ||
| * while the connection is running to the given user. Note that the user | ||
| * receiving these values will not necessarily be able to set new values | ||
| * themselves if their connection is read-only. This function can be used as | ||
| * the callback for guac_client_foreach_user() and guac_client_for_owner() | ||
| * | ||
| * @param user | ||
| * The user that should receive the values of all non-sensitive parameters | ||
| * which may be set while the connection is running. | ||
| * | ||
| * @param data | ||
| * The guac_ipmi_client instance associated with the current connection. | ||
| * | ||
| * @return | ||
| * Always NULL. | ||
| */ | ||
| void* guac_ipmi_send_current_argv(guac_user* user, void* data); | ||
|
|
||
| /** | ||
| * Sends the current values of all non-sensitive parameters which may be set | ||
| * while the connection is running to the users associated with the provided | ||
| * socket. Note that the users receiving these values will not necessarily be | ||
| * able to set new values themselves if their connection is read-only. | ||
| * | ||
| * @param client | ||
| * The client associated with the users that should receive the values of | ||
| * all non-sensitive parameters which may be set while the connection is | ||
| * running. | ||
| * | ||
| * @param socket | ||
| * The socket to send the arguments to the batch of users along. | ||
| * | ||
| * @return | ||
| * Always NULL. | ||
| */ | ||
| void guac_ipmi_send_current_argv_batch( | ||
| guac_client* client, guac_socket* socket); | ||
|
|
||
| #endif |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mike recently submitted a PR that makes including
config.hunnecessary - see #691.