Ensure consistent struct stat definition
Subsystems (2)
PATCH 1/1 Ensure consistent struct stat definition
Although 2fbc62e2a13fc ("Fix include order between config.h and stat.h") reorganized those files that were already including config.h, not all files were including config.h.
Fixes at least stack smashing crashes in mountd on 32-bit systems.
Signed-off-by Doug Nazar <[email protected]>
--- support/junction/junction.c | 4 ++++ support/misc/file.c | 4 ++++ support/misc/mountpoint.c | 4 ++++ support/nfs/cacheio.c | 4 ++++ utils/mount/fstab.c | 4 ++++ utils/nfsdcld/legacy.c | 4 ++++ 6 files changed, 24 insertions(+)
support/junction/junction.c +4 -0
@@ -23,6 +23,10 @@* http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif +#include <sys/types.h> #include <sys/stat.h>
support/misc/file.c +4 -0
@@ -18,6 +18,10 @@* along with nfs-utils. If not, see <http://www.gnu.org/licenses/>. */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif +#include <sys/stat.h> #include <string.h>
support/misc/mountpoint.c +4 -0
@@ -3,6 +3,10 @@* check if a given path is a mountpoint */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif +#include <string.h> #include "xcommon.h" #include <sys/stat.h>
support/nfs/cacheio.c +4 -0
@@ -15,6 +15,10 @@* */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif +#include <nfslib.h> #include <stdio.h> #include <stdio_ext.h>
utils/mount/fstab.c +4 -0
@@ -7,6 +7,10 @@* - Moved code to nfs-utils/support/nfs from util-linux/mount. */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif +#include <errno.h> #include <stdio.h> #include <fcntl.h>
utils/nfsdcld/legacy.c +4 -0
@@ -15,6 +15,10 @@* Boston, MA 02110-1301, USA. */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif +#include <stdio.h> #include <dirent.h> #include <string.h>
Signature · 1 line
2.23.0
Quoted 7 lines · Doug Nazar
Although
2fbc62e2a13fc("Fix include order betweenconfig.handstat.h") reorganized those files that were already includingconfig.h, not all files were includingconfig.h.Fixes at least stack smashing crashes in mountd on 32-bit systems.
Signed-off-by Doug Nazar <[email protected]>
Quoted 8 lines
--- support/junction/junction.c | 4 ++++ support/misc/file.c | 4 ++++ support/misc/mountpoint.c | 4 ++++ support/nfs/cacheio.c | 4 ++++ utils/mount/fstab.c | 4 ++++ utils/nfsdcld/legacy.c | 4 ++++ 6 files changed, 24 insertions(+)
Committed!
steved.
Quoted 92 lines
support/junction/junction.c +4
-0@@ -23,6 +23,10 @@* http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif +#include <sys/types.h> #include <sys/stat.h> support/misc/file.c +4
-0@@ -18,6 +18,10 @@* along with nfs-utils. If not, see <http://www.gnu.org/licenses/>. */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif +#include <sys/stat.h> #include <string.h> support/misc/mountpoint.c +4
-0@@ -3,6 +3,10 @@* check if a given path is a mountpoint */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif +#include <string.h> #include "xcommon.h" #include <sys/stat.h> support/nfs/cacheio.c +4
-0@@ -15,6 +15,10 @@* */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif +#include <nfslib.h> #include <stdio.h> #include <stdio_ext.h> utils/mount/fstab.c +4
-0@@ -7,6 +7,10 @@* - Moved code to nfs-utils/support/nfs from util-linux/mount. */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif +#include <errno.h> #include <stdio.h> #include <fcntl.h> utils/nfsdcld/legacy.c +4
-0@@ -15,6 +15,10 @@* Boston, MA 02110-1301, USA. */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif +#include <stdio.h> #include <dirent.h> #include <string.h>