1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/lib
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
..
addns lib/addns: remove unused kerberos/gssapi includes in dns.h 2024-06-06 02:13:32 +00:00
afs auth: Make more liberal use of SID index constants 2023-02-08 00:03:39 +00:00
async_req lib: Remove an obsolete comment 2024-04-17 09:01:34 +00:00
audit_logging lib:audit_logging: Initialize ‘tm’ structure 2023-09-27 02:43:28 +00:00
cmdline cmdline:burn: list commands to always burn; warn on unknown 2024-07-10 06:28:08 +00:00
compression lib:compression: Update my name 2024-02-16 02:41:36 +00:00
crypto lib:crypto: Remove unused macro definitions 2024-07-02 03:39:35 +00:00
dbwrap lib: Fix dbwrap_tdb.h prerequisites 2024-03-28 08:05:35 +00:00
fuzzing fuzzing: fix fuzz_stable_sort_r_unstable comparison 2024-05-31 05:29:08 +00:00
krb5_wrap lib:krb5_wrap: Fix code spelling 2024-07-02 03:39:35 +00:00
ldb ldb: Attach appropriate ldb context to returned result 2024-06-11 04:32:30 +00:00
ldb-samba ldb-samba:pytest: remove unused variable 2024-05-31 00:25:33 +00:00
messaging lib:messaging: Fix code spelling 2023-04-11 09:06:36 +00:00
mscat lib:mscat: Remove unnecessary casts 2023-09-14 21:35:28 +00:00
param docs-xml: Add smb.conf option 'dns hostname' 2024-05-22 20:33:36 +00:00
printer_driver lib:printer_driver: Check return value of gp_inifile_enum_section() (CID 1444835) 2023-10-13 02:18:30 +00:00
pthreadpool lib:pthreadpool: Fix code spelling 2023-04-11 09:06:36 +00:00
replace lib/replace: make sure krb5_cc_default[_name]() is no longer used directly 2024-05-14 11:22:28 +00:00
smbconf Use python.h from libreplace 2023-11-20 15:37:33 +00:00
socket lib/socket: rearrange iface_comp() to use NUMERIC_CMP 2024-04-23 01:33:29 +00:00
talloc talloc:pytest: remove tests that only test Python 2 2024-05-31 00:25:33 +00:00
tdb tdb: Update times in tdb_transaction_commit per fd, not per name 2024-06-24 16:21:32 +00:00
tdb_wrap lib: Open tdb files with O_CLOEXEC 2021-06-04 16:47:34 +00:00
tdr util/charset: Rename utf16_len_n() to utf16_null_terminated_len_n() 2023-11-15 22:07:36 +00:00
tevent tevent: release 0.16.1 2024-01-29 14:39:32 +00:00
texpect texpect: don't ignore unknown options 2021-09-10 15:10:30 +00:00
torture lib/torture: add assert_int_{less,greater} macros 2024-04-10 22:56:33 +00:00
tsocket lib/tsocket: add tstream_bsd_fail_readv_first_error() 2023-10-24 09:36:37 +00:00
util lib:util: Move open() of /dev/null into the if-clause 2024-07-16 11:41:33 +00:00
README various: Remove references to about to be deleted thirdparty/dnspython 2018-12-11 20:07:18 +01:00
wscript_build

compression - Various compression algorithms (MSZIP, lzxpress)
popt - Command-line option parsing library
replace - Provides replacements for standard (POSIX, C99) functions 
          not provided by the host platform.
subunit - Utilities and bindings for working with the Subunit test result 
          reporting protocol.
talloc - Hierarchical pool based memory allocator 
tdb - Simple but fast key/value database library, supporting multiple writers
torture - Simple unit testing helper library