-
Notifications
You must be signed in to change notification settings - Fork 815
use an explicit 'mimetype' argument for getclipboard #11632
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
Conversation
ebb4634
to
8a86e52
Compare
@@ -1563,8 +1572,8 @@ | |||
std::vector<char> output; | |||
output.reserve(outGuess); | |||
|
|||
// FIXME: extra 'content' is necessary for Message parsing. | |||
Util::vectorAppend(output, "clipboardcontent: content\n"); | |||
//// FIXME: extra 'content' is necessary for Message parsing. |
Check notice
Code scanning / CodeQL
FIXME comment Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 1 month ago
To address the issue, we need to ensure that the extra 'content' is included in the output when building the clipboard content. This involves uncommenting the line Util::vectorAppend(output, "clipboardcontent: content\n");
and ensuring it is placed correctly in the code. The fix should maintain the existing functionality while resolving the issue described in the FIXME
comment.
Steps to fix:
- Uncomment the line
Util::vectorAppend(output, "clipboardcontent: content\n");
. - Place it before the loop that processes
outCount
items, as it seems to be a preparatory step for message parsing. - Remove the
FIXME
comment, as the issue will be resolved.
-
Copy modified line R1576
@@ -1575,4 +1575,3 @@ | ||
|
||
//// FIXME: extra 'content' is necessary for Message parsing. | ||
//Util::vectorAppend(output, "clipboardcontent: content\n"); | ||
Util::vectorAppend(output, "clipboardcontent: content\n"); | ||
bool json = !specifics.empty(); |
LOG_TRC("Sending clipboardcontent of size " << output.size() << " bytes"); | ||
sendBinaryFrame(output.data(), output.size()); | ||
// sendBinaryFrame(output.data(), output.size()); |
Check notice
Code scanning / CodeQL
Commented-out code Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 1 month ago
To fix the issue, we need to either remove the commented-out code or reinstate it if it is still relevant. Since the context does not indicate that the commented-out code is actively used or necessary, the best course of action is to remove it. This will improve code clarity and maintainability. If the functionality is required in the future, it can be reintroduced with proper testing and documentation.
-
Copy modified line R1633
@@ -1632,3 +1632,3 @@ | ||
LOG_TRC("Sending clipboardcontent of size " << output.size() << " bytes"); | ||
// sendBinaryFrame(output.data(), output.size()); | ||
// (Line removed as it contained commented-out code that was not in use) | ||
|
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com> Change-Id: I6e985983b1caf955864ff0dfe8af1fd2f35b79b7
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com> Change-Id: I5e2e797870d559a362b8642b40fce7d063116125
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com> Change-Id: Ibd3947d3fff28dcc1e50a76e1d19daafca3061bf
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com> Change-Id: Ie83344607c8c8eb63f6826a3e2a38016a1346476
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com> Change-Id: I5b8453fddb102ce5762fa82397158dd3eed3da36
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com> Change-Id: If7be4ef1283e581bcd04a9be36634750bb4f6a73
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com> Change-Id: Iab6773b56335869f53265292824bb8abc15d95be
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com> Change-Id: I01164e5139e3c6d67ae5f7a53caf6caee937d94a
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com> Change-Id: I09751326ca75be47e738d3ff4db950dfa7f6b17a
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com> Change-Id: I3dad2652a9c8dc346bf3bf465e3c6c2ad23c5450
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com> Change-Id: I35d6e7f28c4103eb9b14f1a470c6153b2a0241df
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com> Change-Id: Iad451816b424af1ff24d49527720085bf0ac30ae
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com> Change-Id: Ied6e71b1d2a9cc4533c982f029a8422655b033a4
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com> Change-Id: Ib098dc4755b4c1464f516d67d78e3a5733764207
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com> Change-Id: Ibebe40260d95eb20c1a0efe13478bd2707fea492
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com> Change-Id: I61cee5fcbcbbae4595ddcefb970e344ed5ee3bce
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com> Change-Id: I0a32478b74576fcb11a42d7bcf5eebfcf5698409
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com> Change-Id: I419b208478ed84193fa81da49f8fddb8c01b0e57
8a86e52
to
57038cf
Compare
_postFileDir = FileUtil::createRandomTmpDir(COOLWSD::ChildRoot + | ||
JailUtil::CHILDROOT_TMP_INCOMING_PATH) + '/'; | ||
std::string postFilename = _postFileDir + "poststream"; | ||
_postStream.open(postFilename.c_str()); |
Check failure
Code scanning / CodeQL
Uncontrolled data used in path expression High
user input (an environment variable)
This argument to a file access function is derived from
user input (an environment variable)
This argument to a file access function is derived from
user input (an environment variable)
This argument to a file access function is derived from
user input (an environment variable)
This argument to a file access function is derived from
user input (an environment variable)
This argument to a file access function is derived from
user input (an environment variable)
Copilot Autofix
AI about 1 month ago
Copilot could not generate an autofix suggestion
Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.
RequestDetails requestDetails(request, COOLWSD::ServiceRoot); | ||
// LOG_TRC("Request details " << requestDetails.toString()); | ||
|
||
//fprintf(stderr, "size of message is %ld for %s\n", socket->getInBuffer().size(), requestDetails.toString().c_str()); |
Check notice
Code scanning / CodeQL
Commented-out code Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 1 month ago
To fix the issue, we should either remove the commented-out fprintf
statement entirely or reinstate it if it is still relevant. Since there is no indication that this code is actively used or needed, the best course of action is to remove it. This will clean up the code and eliminate any potential confusion for future developers.
@@ -896,4 +896,2 @@ | ||
|
||
//fprintf(stderr, "size of message is %ld for %s\n", socket->getInBuffer().size(), requestDetails.toString().c_str()); | ||
|
||
// Config & security ... |
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com> Change-Id: I3b9243c8fae5de5f36563a46561194c04ed4d41c
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com> Change-Id: I0f5f2c3fd9439cb5a2ba5c8b26ef32b5adc3b795
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com> Change-Id: I6306fc48f266327e952466fe0c82ae2a8de47308
} | ||
~ClipFile() | ||
{ | ||
// FileUtil::removeFile(_file); |
Check notice
Code scanning / CodeQL
Commented-out code Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 1 month ago
To address the issue, we need to either remove the commented-out code or reinstate it. Since the code appears in a destructor, it is likely intended to clean up resources (e.g., removing a file). If this functionality is still required, the line should be reinstated. Otherwise, it should be removed entirely to avoid confusion. For this fix, we will reinstate the line, assuming that the cleanup operation is necessary.
-
Copy modified line R137
@@ -136,3 +136,3 @@ | ||
{ | ||
// FileUtil::removeFile(_file); | ||
FileUtil::removeFile(_file); | ||
} |
~RemoveClipFile() | ||
{ | ||
fprintf(stderr, "remove clip %s\n", _clipFile.c_str()); | ||
// FileUtil::removeFile(_clipFile); |
Check notice
Code scanning / CodeQL
Commented-out code Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 1 month ago
The best way to fix this issue is to either remove the commented-out code entirely or reinstate it if it is still relevant and necessary. If the functionality of FileUtil::removeFile
is required, the line should be uncommented and tested to ensure it works as intended. If the line is no longer needed, it should be deleted to avoid confusion and maintain code clarity.
In this case, since there is no indication that the commented-out code is required, the most appropriate fix is to remove it.
@@ -2201,3 +2201,2 @@ | ||
fprintf(stderr, "remove clip %s\n", _clipFile.c_str()); | ||
// FileUtil::removeFile(_clipFile); | ||
} |
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com> Change-Id: I9f1336859f725cba8650b71860f1923a55860bf4
Change-Id: I6e985983b1caf955864ff0dfe8af1fd2f35b79b7
Summary
TODO
Checklist
make prettier-write
and formatted the code.make check
make run
and manually verified that everything looks okay