1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-18 06:04:06 +03:00
Andreas Schneider d21b8e057c lib:util: Move open() of /dev/null into the if-clause
"Error: RESOURCE_LEAK (CWE-772):
samba-4.20.0rc2/lib/util/close_low_fd.c:40: open_fn: Returning handle opened by ""open"". [Note: The source code implementation of the function has been overridden by a user model.]
samba-4.20.0rc2/lib/util/close_low_fd.c:40: var_assign: Assigning: ""dev_null"" = handle returned from ""open(""/dev/null"", 2, 0)"".
samba-4.20.0rc2/lib/util/close_low_fd.c:52: overwrite_var: Overwriting handle ""dev_null"" in ""dev_null = open(""/dev/null"", 2, 0)"" leaks the handle.
   50|   	}
   51|
   52|-> 	dev_null = open(""/dev/null"", O_RDWR, 0);
   53|   	if (dev_null == -1) {
   54|   		dev_null = open(""/dev/null"", O_WRONLY, 0);"

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2024-07-16 11:41:33 +00:00
..
2024-07-04 15:26:36 +00:00
2023-04-14 05:25:33 +00:00
2016-11-16 12:41:09 +01:00
2024-06-04 08:16:58 +00:00
2016-05-04 01:28:23 +02:00
2021-04-27 13:24:35 +00:00
2024-04-30 22:44:32 +00:00
2023-12-08 02:28:33 +00:00
2023-10-27 05:54:33 +00:00
2023-10-27 05:54:33 +00:00
2017-11-20 21:41:14 +01:00
2023-04-14 05:25:33 +00:00
2023-04-14 05:25:33 +00:00
2016-06-07 14:34:10 +02:00
2023-04-14 05:25:33 +00:00
2021-12-15 19:32:30 +00:00
2023-04-14 05:25:33 +00:00
2017-03-20 12:20:08 +01:00
2015-07-07 23:51:23 +02:00
2019-09-17 22:49:36 +00:00
2021-12-13 16:22:28 +00:00
2023-04-14 05:25:33 +00:00
2022-12-01 22:56:39 +00:00
2022-12-01 22:56:39 +00:00
2023-04-14 05:25:33 +00:00
2018-11-30 08:12:31 +01:00
2021-04-19 18:18:31 +00:00
2015-10-13 01:23:07 +02:00
2021-10-08 19:28:32 +00:00
2021-10-08 19:28:32 +00:00
2015-02-13 23:32:07 +01:00
2024-06-24 16:21:32 +00:00
2015-07-07 23:51:23 +02:00
2015-07-07 23:51:23 +02:00
2023-04-14 05:25:33 +00:00
2023-04-14 05:25:33 +00:00
2019-01-28 15:44:18 +01:00
2024-05-22 04:23:29 +00:00
2024-03-22 06:07:42 +00:00
2019-08-07 06:07:28 +00:00
2024-04-16 23:51:45 +00:00
2024-04-16 23:51:45 +00:00
2020-05-15 13:18:38 +00:00
2023-10-25 22:23:37 +00:00
2017-03-28 17:45:19 +02:00
2021-01-25 09:48:09 +00:00
2023-03-09 18:10:33 +00:00
2021-05-11 22:56:37 +00:00
2024-06-13 12:25:37 +00:00
2023-03-09 18:10:33 +00:00

This directory contains libutil (until we can think of a better name)

The idea is that this library contains simple but useful data structures 
and support functions that are generally useful; not just for Samba but for 
other projects as well. Functions here should not depend on any external 
libraries, just on libc (perhaps partially provided by libreplace).