diff options
author | Bhavna Sharma <sbhavna@codeaurora.org> | 2018-08-27 15:32:35 -0700 |
---|---|---|
committer | Bhavna Sharma <sbhavna@codeaurora.org> | 2018-08-28 13:47:03 -0700 |
commit | 9831975c767bce45769ad42d916991d2f4caa1dd (patch) | |
tree | 00a893e43ffbbe85cbb7847de70d1dd0a66cda71 /utils/loc_cfg.cpp | |
parent | a190b2c1164a60a2350b5ed53fa4ef3e2d7e7689 (diff) | |
download | gps-9831975c767bce45769ad42d916991d2f4caa1dd.tar.gz |
Fix issue with use of incorrect index in group list
If a group is not found there is a mismatch with group count
and actual number of groups in the list leading to some
groups not getting set correctly.
CRs-Fixed: 2303952
Change-Id: Iafb3aa4e90a79b511f3d36e42583e013fd05391b
Diffstat (limited to 'utils/loc_cfg.cpp')
-rw-r--r-- | utils/loc_cfg.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index 4c3bc58..d319fb4 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -835,11 +835,9 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p for(i=0; i<ngroups; i++) { struct group* grp = getgrnam(split_strings[i]); if (grp) { - child_proc[j].group_list[i] = grp->gr_gid; + child_proc[j].group_list[child_proc[j].num_groups] = grp->gr_gid; child_proc[j].num_groups++; - LOC_LOGD("%s:%d]:Group %s = %d matches child_group: %d\n", - __func__, __LINE__, split_strings[i], - grp->gr_gid,child_proc[j].group_list[i]); + LOC_LOGd("Group %s = %d", split_strings[i], grp->gr_gid); } } |