#1146 Case-insensitivity patches break case-sensitive proxy ID provider
Closed: Fixed None Opened 12 years ago by sgallagh.

 128static int save_user(struct sysdb_ctx *sysdb, bool lowercase,
 129                     struct passwd *pwd, uint64_t cache_timeout)
 130{
 131    const char *shell;
 132    char *lower;
CID 12467: Uninitialized pointer read (UNINIT)Declaring variable "attrs" without initializer.
 133    struct sysdb_attrs *attrs;
 134    errno_t ret;
 135
At conditional (1): "pwd->pw_shell" taking the true branch.
At conditional (2): "pwd->pw_shell[0] != 0" taking the true branch.
 136    if (pwd->pw_shell && pwd->pw_shell[0] != '\0') {
 137        shell = pwd->pw_shell;
 138    } else {
 139        shell = NULL;
 140    }
 141
At conditional (3): "lowercase" taking the false branch.
 142    if (lowercase) {
 143        attrs = sysdb_new_attrs(NULL);
 144        if (!attrs) {
 145            DEBUG(SSSDBG_CRIT_FAILURE, ("Allocation error ?!\n"));
 146            return ENOMEM;
 147        }
 148
 149        lower = sss_tc_utf8_str_tolower(attrs, pwd->pw_name);
 150        if (!lower) {
 151            DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot convert name to lowercase\n"));
 152            talloc_zfree(attrs);
 153            return ENOMEM;
 154        }
 155
 156        ret = sysdb_attrs_add_string(attrs, SYSDB_NAME_ALIAS, lower);
 157        if (ret) {
 158            DEBUG(SSSDBG_OP_FAILURE, ("Could not add name alias\n"));
 159            talloc_zfree(attrs);
 160            return ret;
 161        }
 162    }
 163
Using uninitialized value "attrs" when calling "sysdb_store_user". [show details]
 164    ret = sysdb_store_user(sysdb,
 165                           pwd->pw_name,
 166                           pwd->pw_passwd,
 167                           pwd->pw_uid,
 168                           pwd->pw_gid,
 169                           pwd->pw_gecos,
 170                           pwd->pw_dir,
 171                           shell,
 172                           attrs,
 173                           NULL,
 174                           cache_timeout,
 175                           0);

Fields changed

milestone: NEEDS_TRIAGE => SSSD 1.8.0
rhbz: => 0

Fields changed

feature_milestone: =>
owner: jhrozek => sgallagh
status: new => assigned

Fixed by:
- de5dcfd (master)
- b8c8811 (sssd-1-8)

resolution: => fixed
status: assigned => closed

Metadata Update from @sgallagh:
- Issue assigned to sgallagh
- Issue set to the milestone: SSSD 1.8.0 (LTM)

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/2188

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