Title: #5827: A number of fixes around `strto*()` usage
There are few more places where `strtouint*()` is called with 2nd
parameter set to NULL:
I don't have very strong justification but will try my best to explain why I missed
74: ret = strtouint32(error->message, NULL, 10);
This is a case `dbus_error_has_name(error, SBUS_ERROR_ERRNO)`, i.e. (IIUC)
`error->message` is set by another SSSD process, i.e. can be treated as a more or less
But imagine we want to be prudent and catch a case "123abc". How are we going to
This is a helper function that translates `error` to error code. So instead of `123` in
this case of malformed error text we can return, for example, `ERR_INTERNAL`. Does it make
some sense? Perhaps. Much sense? Imo, no.
846: uid = strtouint32(uid_list[i], NULL, 10);
`uid_list` originates from sssd-kcm ccache DB, so again, more or less reliable.
79: tmp = strtouint32(buf, NULL, 10);
That's a test.
266: port = strtouint16(state->name, NULL, 10);
Again, internal stuff. But ok, to be consistent I will add checks here...
1859: duration = strtouint32(pwdAccountLockedDurationTime, NULL, 0);
This value is from LDAP - "pwdLockoutDuration" . I just wasn't sure what
weird format it might have...
But it looks https://ldapwiki.com/wiki/PwdLockoutDuration
says "Integer" so ok,
I will update this as well.
If those are outside of the scope of this PR?
See the full comment at https://github.com/SSSD/sssd/pull/5827#issuecomment-946114494