]>
git.ipfire.org Git - thirdparty/shadow.git/commit
useradd: check return value from chmod and log it
covscan was complaining abot calling chmod and ignoring the return
value:
Error: CHECKED_RETURN (CWE-252):
shadow-4.6/src/useradd.c:2084: check_return: Calling
"chmod(prefix_user_home, mode)" without checking return value. This
library function may fail and return an error code.
2082| mode_t mode = getdef_num ("HOME_MODE",
2083| 0777 & ~getdef_num ("UMASK", GETDEF_DEFAULT_UMASK));
2084|-> chmod (prefix_user_home, mode);
2085| home_added = true;
2086| #ifdef WITH_AUDIT