#1044 Incorrect variable assignment in create_socket_symlink
Closed: Fixed None Opened 12 years ago by sgallagh.

 95static errno_t
  96create_socket_symlink(const char *filename, const char *symlink_filename)
  97{
  98    errno_t ret;
  99
 100    DEBUG(7, ("Symlinking the dbus path %s to a link %s\n",
 101              filename, symlink_filename));
 102    errno = 0;
 103    ret = symlink(filename, symlink_filename);
 104    if (ret != 0 && errno == EEXIST) {
 105        /* Perhaps cruft after a previous server? */
CID 11048: Argument cannot be negative (NEGATIVE_RETURNS)Function "unlink(symlink_filename)" returns a negative number.
Assigning: signed variable "ret" = "unlink".
 106        ret = unlink(symlink_filename);
At conditional (1): "ret != 0" taking the true branch.
 107        if (ret != 0) {
At conditional (2): "debug_level & __debug_macro_newlevel" taking the true branch.
At conditional (3): "debug_timestamps" taking the true branch.
At conditional (4): "debug_microseconds" taking the true branch.
"ret" is passed to a parameter that cannot be negative.
 108            DEBUG(1, ("Cannot remove old symlink: [%d][%s].\n",
 109                      ret, strerror(ret)));
 110            return EIO;
 111        }

Fixed by:
- 8cfaeff (master)
- 3deb85e (sssd-1-6)
- d62db6e (sssd-1-5)

resolution: => fixed
status: new => closed

Fields changed

rhbz: => 0

Metadata Update from @sgallagh:
- Issue assigned to jhrozek
- Issue set to the milestone: SSSD 1.5.14

7 years ago

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

This issue has been cloned to Github and is available here:
- https://github.com/SSSD/sssd/issues/2086

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.

Login to comment on this ticket.

Metadata