View | Details | Raw Unified | Return to bug 37077
Collapse All | Expand All

(-)a/nss_role.c (-2 / +2 lines)
Lines 17-25 enum nss_status _nss_role_initgroups_dyn(char *user, gid_t main_group, Link Here
17
    enum nss_status ret = NSS_STATUS_SUCCESS;
17
    enum nss_status ret = NSS_STATUS_SUCCESS;
18
    pthread_mutex_lock(&mutex);
18
    pthread_mutex_lock(&mutex);
19
19
20
    struct librole_graph G;
20
    struct librole_graph G = {};
21
    int i, result;
21
    int i, result;
22
    librole_group_collector col, ans;
22
    librole_group_collector col = {}, ans = {};
23
23
24
    result = librole_graph_init(&G);
24
    result = librole_graph_init(&G);
25
    if (result != LIBROLE_OK) {
25
    if (result != LIBROLE_OK) {
(-)a/parser.c (-4 / +7 lines)
Lines 204-210 static int parse_line(char *line, struct librole_graph *G) Link Here
204
    comment = select_line_part(line, len, &last, &i, ':');
204
    comment = select_line_part(line, len, &last, &i, ':');
205
205
206
    if (comment && *last == '\0')
206
    if (comment && *last == '\0')
207
        return result;
207
        goto libnss_role_parse_line_error;
208
208
209
    drop_quotes(&last);
209
    drop_quotes(&last);
210
    result = librole_get_gid(last, &role.gid);
210
    result = librole_get_gid(last, &role.gid);
Lines 255-262 int librole_reading(const char *s, struct librole_graph *G) Link Here
255
        return LIBROLE_OUT_OF_RANGE;
255
        return LIBROLE_OUT_OF_RANGE;
256
256
257
    f = fopen(s, "r");
257
    f = fopen(s, "r");
258
    if (!f)
258
    if (!f) {
259
        return LIBROLE_IO_ERROR;
259
        result = LIBROLE_IO_ERROR;
260
        goto libnss_role_reading_out_free;
261
    }
260
    
262
    
261
    while(1) {
263
    while(1) {
262
        c = fgetc(f);
264
        c = fgetc(f);
Lines 287-294 int librole_reading(const char *s, struct librole_graph *G) Link Here
287
    }
289
    }
288
    
290
    
289
libnss_role_reading_out:
291
libnss_role_reading_out:
290
    free(str);
291
    fclose(f);
292
    fclose(f);
293
libnss_role_reading_out_free:
294
    free(str);
292
    return result;
295
    return result;
293
}
296
}
294
297

Return to bug 37077