selinux/libselinux
Christian Göttsche 88d43a8dc2 libselinux: preserve errno in selinux_log()
selinux_log() is used in many error branches, where the caller might
expect errno to bet set, e.g. label_file.c::lookup_all():

    if (match_count) {
		*match_count = 0;
		result = calloc(data->nspec, sizeof(struct spec*));
	} else {
		result = calloc(1, sizeof(struct spec*));
	}
	if (!result) {
		selinux_log(SELINUX_ERROR, "Failed to allocate %zu bytes of data\n",
			    data->nspec * sizeof(struct spec*));
		goto finish;
	}

Preserve errno in the macro wrapper itself, also preventing accidental
errno modifications in client specified SELINUX_CB_LOG callbacks.

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Acked-by: James Carter <jwcart2@gmail.com>
2022-05-16 10:28:35 -04:00
..
include selinux_restorecon: introduce SELINUX_RESTORECON_COUNT_ERRORS 2022-05-04 10:31:42 +02:00
man libselinux: emulate O_PATH support in fgetfilecon/fsetfilecon 2022-05-16 10:21:47 -04:00
src libselinux: preserve errno in selinux_log() 2022-05-16 10:28:35 -04:00
utils libselinux/utils: check for valid contexts to improve error causes 2022-04-12 13:09:27 -04:00
LICENSE
Makefile libselinux: use PCRE2 by default 2021-12-09 11:07:00 -05:00
VERSION Update VERSIONs to 3.4-rc3 for release. 2022-05-04 19:20:37 +02:00