edwardcapriolo commented on code in PR #8177:
URL: https://github.com/apache/hadoop/pull/8177#discussion_r2932785270
##########
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:
I think we should avoid this. It is almost impossible. All the downstream
usages check the null status annyway which according to the c docs these can
never be null anyway only empty ""
```
user_detail == NULL || user_detail->pw_name == NULL) {
fprintf(LOGFILE,
```
Unless you object strongly I would leave it as is.
--
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]