diff --git a/src/services/execution/spec/specs_extend.c b/src/services/execution/spec/specs_extend.c index 737069e76d36df858e9beff6e7cdc008656c67ad..2b832cfc46d42ae0185fa287d9adea0651cfa79f 100644 --- a/src/services/execution/spec/specs_extend.c +++ b/src/services/execution/spec/specs_extend.c @@ -589,11 +589,12 @@ static int proc_by_fpasswd(FILE *f_passwd, const char *user, defs_process_user * userfound = b_user_found(user, pwbufp); // Take the first match as valid user if (userfound) { + // oci spec donot use username spec on linux free(puser->username); - puser->username = util_strdup_s(pwbufp->pw_name); + puser->username = NULL; puser->uid = pwbufp->pw_uid; puser->gid = pwbufp->pw_gid; - *matched_username = puser->username; + *matched_username = util_strdup_s(pwbufp->pw_name); break; } errval = fgetpwent_r(f_passwd, &pw, buf, sizeof(buf), &pwbufp); @@ -789,6 +790,7 @@ static int get_exec_user(const char *username, FILE *f_passwd, FILE *f_group, de } cleanup: + free(matched_username); free(tmp); return ret; }