Skip to content

Fix coverity Y2K38_SAFTY issues in smbpasswd backend

This changelist address coverity issue pertaining to Y2K38_SAFTY in smbpasswd backend and fixes issues#1509031 and 1509040. https://scan5.scan.coverity.com/#/project-view/64750/10100?selectedIssue=1509031 https://scan5.scan.coverity.com/#/project-view/64750/10100?selectedIssue=1509040

Following changes are done.

  1. Updates record format to deal with 64-bit time_t value as 16-byte hex string. Old format: username:uid:[32hex bytes]:[32hex bytes]:[attributes]:LCT-XXXXXXXX New format: username:uid:[32hex bytes]:[32hex bytes]:[attributes]:LCT-XXXXXXXXXXXXXXXX
  2. Updates add, modify and get functions to work with new format.
  3. Checks for old records in init and writes them in new format.

Unit testing:

  1. Verify detection of old records.
  2. Verify conversion of records from old to new format.
  3. verify addition of new record.
  4. verify modification of new record.
  5. verify deletion on record.

Checklist

  • [*] Commits have Signed-off-by: with name/author being identical to the commit author
  • (optional) This MR is just one part towards a larger feature.
  • (optional, if backport required) Bugzilla bug filed and BUG: tag added
  • Test suite updated with functionality tests
  • Test suite updated with negative tests
  • Documentation updated
  • CI timeout is 3h or higher (see Settings/CICD/General pipelines/ Timeout)

Reviewer's checklist:

  • There is a test suite reasonably covering new functionality or modifications
  • Function naming, parameters, return values, types, etc., are consistent and according to README.Coding.md
  • This feature/change has adequate documentation added
  • No obvious mistakes in the code

Merge request reports

Loading