cnauroth commented on code in PR #8177:
URL: https://github.com/apache/hadoop/pull/8177#discussion_r2867174275
##########
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);
Review Comment:
[`strdup`](https://man7.org/linux/man-pages/man3/strdup.3.html) can return
`NULL` if there is insufficient memory. Do we need to add more error checking?
(There are pre-existing calls to `strdup` that don't have the error checking.
No expectation that you need to do a mass update of all error handling in scope
of this patch.)
--
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]