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

Misc compiler warnings on Debian sid #2789

Closed
wants to merge 3 commits into from
Closed

Conversation

cgzones
Copy link
Contributor

@cgzones cgzones commented Jan 3, 2021

No description provided.

src/common/ownsql.cpp Outdated Show resolved Hide resolved
@@ -721,41 +721,41 @@ QByteArray encryptStringAsymmetric(EVP_PKEY *publicKey, const QByteArray& data)
auto ctx = PKeyCtx::forKey(publicKey, ENGINE_get_default_RSA());
if (!ctx) {
qCInfo(lcCse()) << "Could not initialize the pkey context.";
exit(1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Callers are not going to handle that change in behavior, so likely needs some error handling up the call stack.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly there seems to be no actual error handling in src/libsync/clientsideencryption.cpp.
So for now the key is just skipped in FolderMetadata::encryptedMetadata().

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, definitely. This needs being addressed otherwise it's too much of a behavior change, this will start trickling up and not being blocked later on while right now it has no risk of trickling up and corrupting things (even though it does so in a super aggressive and less than ideal way indeed).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the error handling in the callers.

test/testfolderwatcher.cpp Outdated Show resolved Hide resolved
test/testinotifywatcher.cpp Outdated Show resolved Hide resolved
test/testhelper.h Outdated Show resolved Hide resolved
@cgzones cgzones force-pushed the misc branch 3 times, most recently from e9d2320 to 081a017 Compare January 5, 2021 18:28
test/testfolderwatcher.cpp Outdated Show resolved Hide resolved
test/testfolderwatcher.cpp Outdated Show resolved Hide resolved
@nextcloud-desktop-bot
Copy link

AppImage file: nextcloud-PR-2789-f4948ff7eed9e81f7cf17700e413739cc67d8af5-x86_64.AppImage

To test this change/fix you can simply download above AppImage file and test it.

Please make sure to quit your existing Nextcloud app and backup your data.

test/testfolderwatcher.cpp: In function 'void touch(const QString&)':
test/testfolderwatcher.cpp:21:11: warning: ignoring return value of 'int system(const char*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   21 |     system(cmd.toLocal8Bit());
      |     ~~~~~~^~~~~~~~~~~~~~~~~~~
test/testfolderwatcher.cpp: In function 'void mkdir(const QString&)':
test/testfolderwatcher.cpp:33:11: warning: ignoring return value of 'int system(const char*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   33 |     system(cmd.toLocal8Bit());
      |     ~~~~~~^~~~~~~~~~~~~~~~~~~
test/testfolderwatcher.cpp: In function 'void rmdir(const QString&)':
test/testfolderwatcher.cpp:45:11: warning: ignoring return value of 'int system(const char*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   45 |     system(cmd.toLocal8Bit());
      |     ~~~~~~^~~~~~~~~~~~~~~~~~~
test/testfolderwatcher.cpp: In function 'void rm(const QString&)':
test/testfolderwatcher.cpp:56:11: warning: ignoring return value of 'int system(const char*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   56 |     system(cmd.toLocal8Bit());
      |     ~~~~~~^~~~~~~~~~~~~~~~~~~
test/testfolderwatcher.cpp: In function 'void mv(const QString&, const QString&)':
test/testfolderwatcher.cpp:67:11: warning: ignoring return value of 'int system(const char*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   67 |     system(cmd.toLocal8Bit());
      |     ~~~~~~^~~~~~~~~~~~~~~~~~~
test/testfolderwatcher.cpp: In member function 'void TestFolderWatcher::testACreate()':
test/testfolderwatcher.cpp:152:15: warning: ignoring return value of 'int system(const char*)' declared with attribute 'warn_unused_result' [-Wunused-result]
  152 |         system(cmd.toLocal8Bit());
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~

test/testinotifywatcher.cpp: In member function 'void TestInotifyWatcher::cleanupTestCase()':
test/testinotifywatcher.cpp:67:18: warning: ignoring return value of 'int system(const char*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   67 |            system( QString("rm -rf %1").arg(_root).toLocal8Bit() );
      |            ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Check for a failure in all callers.

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
@Rello
Copy link
Contributor

Rello commented Dec 3, 2024

Hello,

Thank you for your contribution to the Desktop Client with this pull request.
We are closing this request as it is outdated, no longer relevant (e.g., due to Qt 6), or does not align with the current roadmap.

We truly value your support and hope to see more contributions from you in the future!

Best regards,
Nextcloud Desktop Team

@Rello Rello closed this Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants