#47353 PassSync fails to open changelog
Closed: wontfix None Opened 8 years ago by nkinder.

We have seen some instances of PassSync failing to open it's changelog (passhook.dat) even though it exists. In the PassSync log, you will see looping messages like this:

04/21/13 18:02:49: No entries yet
04/22/13 05:55:49: No entries yet
04/22/13 06:11:24: No entries yet
04/22/13 06:47:02: No entries yet
04/22/13 07:51:44: No entries yet

If you look in the PassSync code, this message only occurs when we attempt to run SyncPasswords(), which is only executed on start-up, or when we receive a notification from passhook.dll. The fact that this message loops without PassSync restarting means that passhook.dll is writing changes to the changelog and properly notifying PassSync that we need to process the changes. If you trace the code further, you will see that "No entries yet" only occurs when loadSet() returns 1. The loadSet() function only returns 1 when the open() fails with ENOENT.

When this problem happens, we know that the changelog file exists since passhook.dll is writing changes there and notifying us. This leads me to believe that PassSync is using an incorrect filename when it tries to open the changelog. The filename is built up dynamically when PassSync is started. It is made of of the "%SystemRoot%" environment variable plus a hard coded path:

ExpandEnvironmentStrings("%SystemRoot%", sysPath, SYNCSERV_BUF_SIZE);
_snprintf(dataFilename, SYNCSERV_BUF_SIZE, "%s\system32\passhook.dat", sysPath);

I believe that "%SystemRoot%" is not being properly expanded when this problem occurs, but I'm not sure what triggers this to happen. Regardless, I think we need to handle things better when this expansion fails. If we can't expand this variable, we should probably fail to start the PassSync service. It would also be helpful to log the filename we are using when we encounter a problem like the ENOENT error.

Bug description: The result of opening the changelog file
"passhook.dat" was checked by errno (_get_errno(&errno)),
which was not updated once an error (ENOENT) was set
although the other error returned from GetLastError.

Fix description: This patch replaces _get_errno with
GetLastError to get the correct error.

In addition, debug logging code is added.

Reviewed by Rich (Thank you!!)

Pushed to master: commit b4c18b3e17685ec1d092b5069253f7300155558

Metadata Update from @nhosoi:
- Issue assigned to nhosoi
- Issue set to the milestone: passsync 1.1.5

4 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/389ds/389-ds-base/issues/690

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata Update from @spichugi:
- Issue close_status updated to: wontfix (was: Fixed)

a year ago

Login to comment on this ticket.