Closed Bug 1360307 Opened 7 years ago Closed 5 years ago

improve the arguments to mozilla::psm::InitializeNSS

Categories

(Core :: Security: PSM, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: keeler, Assigned: mbirghan)

Details

(Whiteboard: [psm-assigned])

Attachments

(1 file)

mozilla::psm::InitializeNSS takes two bool arguments. bool arguments aren't great because they aren't descriptive (what's the difference between InitializeNSS(profilePath, true, true) and Initialize(profilePath, true, false)? How can we be confident we got the order of the arguments correct? etc.) We should give the function enum class arguments or something:

InitializeNSS(profilePath, DBMutability::ReadOnly, PKCS11DB::LoadModules)

vs

InitializeNSS(profilePath, DBMutability::ReadWrite, PKCS11DB::DoNotLoadModules)

or something - those names maybe aren't the best, but you get the idea.

Also the const char* dir argument could be an nsACString&.
Priority: -- → P3
Assignee: nobody → mbirghan
Priority: P3 → P1
Whiteboard: [psm-cleanup] → [psm-assigned]
Pushed by dkeeler@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4a66bfcbaca5
Improves the arguments to mozilla::psm::InitializeNSS r=keeler

Backed out changeset 4a66bfcbaca5 (bug 1360307) for build bustage at Logging.h on a CLOSED TREE.

Backout link: https://hg.mozilla.org/integration/autoland/rev/be4f2ee635fc9f5e7a845617658eb45fbe4d718a

**Push with failures:**https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception&revision=4a66bfcbaca59d9aa9352431941773a91b77deee&selectedJob=259216276

Log link: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=259216276&repo=autoland&lineNumber=12544

Log snippet:
[task 2019-07-31T17:00:58.405Z] 17:00:58 INFO - In file included from /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/BlockingResourceBase.h:10:0,
[task 2019-07-31T17:00:58.405Z] 17:00:58 INFO - from /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/Mutex.h:10,
[task 2019-07-31T17:00:58.405Z] 17:00:58 INFO - from /builds/worker/workspace/build/src/security/certverifier/OCSPCache.h:29,
[task 2019-07-31T17:00:58.406Z] 17:00:58 INFO - from /builds/worker/workspace/build/src/security/certverifier/CertVerifier.h:14,
[task 2019-07-31T17:00:58.407Z] 17:00:58 INFO - from /builds/worker/workspace/build/src/security/certverifier/CertVerifier.cpp:7,
[task 2019-07-31T17:00:58.407Z] 17:00:58 INFO - from /builds/worker/workspace/build/src/obj-firefox/security/certverifier/Unified_cpp_certverifier0.cpp:11:
[task 2019-07-31T17:00:58.407Z] 17:00:58 INFO - /builds/worker/workspace/build/src/security/certverifier/NSSCertDBTrustDomain.cpp: In function 'SECStatus mozilla::psm::InitializeNSS(const nsACString&, mozilla::psm::NSSDBConfig, mozilla::psm::PKCS11DBConfig)':
[task 2019-07-31T17:00:58.407Z] 17:00:58 ERROR - /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/Logging.h:267:61: error: format '%d' expects argument of type 'int', but argument 5 has type 'mozilla::psm::NSSDBConfig' [-Werror=format=]
[task 2019-07-31T17:00:58.407Z] 17:00:58 INFO - MOZ_LOG_EXPAND_ARGS _args);
[task 2019-07-31T17:00:58.407Z] 17:00:58 INFO - ^
[task 2019-07-31T17:00:58.407Z] 17:00:58 INFO - /builds/worker/workspace/build/src/security/certverifier/NSSCertDBTrustDomain.cpp:1302:3: note: in expansion of macro 'MOZ_LOG'
[task 2019-07-31T17:00:58.407Z] 17:00:58 INFO - MOZ_LOG(gCertVerifierLog, LogLevel::Debug,
[task 2019-07-31T17:00:58.408Z] 17:00:58 INFO - ^
[task 2019-07-31T17:00:58.408Z] 17:00:58 ERROR - /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/Logging.h:267:61: error: format '%d' expects argument of type 'int', but argument 6 has type 'mozilla::psm::PKCS11DBConfig' [-Werror=format=]
[task 2019-07-31T17:00:58.408Z] 17:00:58 INFO - MOZ_LOG_EXPAND_ARGS _args);
[task 2019-07-31T17:00:58.408Z] 17:00:58 INFO - ^
[task 2019-07-31T17:00:58.408Z] 17:00:58 INFO - /builds/worker/workspace/build/src/security/certverifier/NSSCertDBTrustDomain.cpp:1302:3: note: in expansion of macro 'MOZ_LOG'
[task 2019-07-31T17:00:58.408Z] 17:00:58 INFO - MOZ_LOG(gCertVerifierLog, LogLevel::Debug,
[task 2019-07-31T17:00:58.408Z] 17:00:58 INFO - ^
[task 2019-07-31T17:00:58.408Z] 17:00:58 INFO - cc1plus: all warnings being treated as errors
[task 2019-07-31T17:00:58.408Z] 17:00:58 INFO - /builds/worker/workspace/build/src/config/rules.mk:786: recipe for target 'Unified_cpp_certverifier0.o' failed
[task 2019-07-31T17:00:58.409Z] 17:00:58 ERROR - make[4]: *** [Unified_cpp_certverifier0.o] Error 1

Flags: needinfo?(mbirghan)

Please update the revision with the latest diff.

Flags: needinfo?(mbirghan)
Pushed by dkeeler@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a0e4af8d788f
Improves the arguments to mozilla::psm::InitializeNSS r=keeler
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
Flags: needinfo?(mbirghan)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: