]> git.ipfire.org Git - thirdparty/shadow.git/commit
useradd: check return value from chmod and log it 272/head
authorikerexxe <ipedrosa@redhat.com>
Mon, 10 Aug 2020 09:44:00 +0000 (11:44 +0200)
committerikerexxe <ipedrosa@redhat.com>
Mon, 10 Aug 2020 09:44:00 +0000 (11:44 +0200)
commit508b968cb1862a42ed7e2d4e4f9fa90af30f517f
tree3d3e16ee95f5e97bef627fb20cac79537bf95370
parent7ea342579ee5a99caa9c3e3e91afe9ec204f83ed
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
src/useradd.c