edwardcapriolo commented on code in PR #8177:
URL: https://github.com/apache/hadoop/pull/8177#discussion_r2721241340


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/container-executor.c:
##########
@@ -120,6 +120,25 @@ void set_nm_uid(uid_t user, gid_t group) {
   nm_gid = group;
 }
 
+//function to make a deep clone of passwd to serialized_passwd
+void deep_copy_passwd(const struct passwd *src, struct serialized_passwd 
*dest){
+  dest->pw_name = strdup(src->pw_name);
+  dest->pw_dir = strdup(src->pw_dir);
+  dest->pw_shell = strdup(src->pw_shell);
+  dest->pw_uid = src->pw_uid;
+  dest->pw_gid = src->pw_gid;
+}
+
+void free_serialized_passwd(struct serialized_passwd * passwd){

Review Comment:
   Because we create dynamic memory for this struct we free it. We give users a 
simple clean destructor like method.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to