aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2026-09-04 09:27:17 +0100
committerRon Yorston <rmy@pobox.com>2026-09-04 09:27:17 +0100
commita7cfac2b372e21950cf8b9e9defff742b92043d8 (patch)
treea0b292c4c473412c6c1070d46e9b39384cb4a644 /libbb
parentdc703c7272ef1c71c0d43a056e21299d1bb5fea0 (diff)
parent74ac096e895acd6b02976bb010e9b3511234e899 (diff)
downloadbusybox-w32-merge.tar.gz
busybox-w32-merge.tar.bz2
busybox-w32-merge.zip
Merge branch 'busybox' into mergemerge
Signed-off-by: Ron Yorston <rmy@pobox.com>
Diffstat (limited to '')
-rw-r--r--libbb/copy_file.c6
-rw-r--r--libbb/run_shell.c4
-rw-r--r--libbb/selinux_common.c6
-rw-r--r--libbb/update_passwd.c2
4 files changed, 9 insertions, 9 deletions
diff --git a/libbb/copy_file.c b/libbb/copy_file.c
index c0928a5a8..e764deb60 100644
--- a/libbb/copy_file.c
+++ b/libbb/copy_file.c
@@ -124,10 +124,10 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags)
124 124
125#if ENABLE_SELINUX 125#if ENABLE_SELINUX
126 if ((flags & FILEUTILS_PRESERVE_SECURITY_CONTEXT) && is_selinux_enabled() > 0) { 126 if ((flags & FILEUTILS_PRESERVE_SECURITY_CONTEXT) && is_selinux_enabled() > 0) {
127 security_context_t con; 127 char *con;
128 if (lgetfilecon(source, &con) >= 0) { 128 if (lgetfilecon(source, &con) >= 0) {
129 if (setfscreatecon(con) < 0) { 129 if (setfscreatecon(con) < 0) {
130 bb_perror_msg("can't set setfscreatecon %s", con); 130 bb_perror_msg("can't setfscreatecon %s", con);
131 freecon(con); 131 freecon(con);
132 return -1; 132 return -1;
133 } 133 }
@@ -333,7 +333,7 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags)
333 if ((flags & (FILEUTILS_PRESERVE_SECURITY_CONTEXT|FILEUTILS_SET_SECURITY_CONTEXT)) 333 if ((flags & (FILEUTILS_PRESERVE_SECURITY_CONTEXT|FILEUTILS_SET_SECURITY_CONTEXT))
334 && is_selinux_enabled() > 0 334 && is_selinux_enabled() > 0
335 ) { 335 ) {
336 security_context_t con; 336 char *con;
337 if (getfscreatecon(&con) == -1) { 337 if (getfscreatecon(&con) == -1) {
338 bb_simple_perror_msg("getfscreatecon"); 338 bb_simple_perror_msg("getfscreatecon");
339 return -1; 339 return -1;
diff --git a/libbb/run_shell.c b/libbb/run_shell.c
index c22bba87b..1c366d069 100644
--- a/libbb/run_shell.c
+++ b/libbb/run_shell.c
@@ -33,14 +33,14 @@
33#endif 33#endif
34 34
35#if ENABLE_SELINUX 35#if ENABLE_SELINUX
36static security_context_t current_sid; 36static char *current_sid;
37 37
38void FAST_FUNC renew_current_security_context(void) 38void FAST_FUNC renew_current_security_context(void)
39{ 39{
40 freecon(current_sid); /* Release old context */ 40 freecon(current_sid); /* Release old context */
41 getcon(&current_sid); /* update */ 41 getcon(&current_sid); /* update */
42} 42}
43void FAST_FUNC set_current_security_context(security_context_t sid) 43void FAST_FUNC set_current_security_context(char *sid)
44{ 44{
45 freecon(current_sid); /* Release old context */ 45 freecon(current_sid); /* Release old context */
46 current_sid = sid; 46 current_sid = sid;
diff --git a/libbb/selinux_common.c b/libbb/selinux_common.c
index f917a1c6a..8f00f2db5 100644
--- a/libbb/selinux_common.c
+++ b/libbb/selinux_common.c
@@ -9,7 +9,7 @@
9#include "libbb.h" 9#include "libbb.h"
10#include <selinux/context.h> 10#include <selinux/context.h>
11 11
12context_t FAST_FUNC set_security_context_component(security_context_t cur_context, 12context_t FAST_FUNC set_security_context_component(char *cur_context,
13 char *user, char *role, char *type, char *range) 13 char *user, char *role, char *type, char *range)
14{ 14{
15 context_t con = context_new(cur_context); 15 context_t con = context_new(cur_context);
@@ -31,7 +31,7 @@ error:
31 return NULL; 31 return NULL;
32} 32}
33 33
34void FAST_FUNC setfscreatecon_or_die(security_context_t scontext) 34void FAST_FUNC setfscreatecon_or_die(char *scontext)
35{ 35{
36 if (setfscreatecon(scontext) < 0) { 36 if (setfscreatecon(scontext) < 0) {
37 /* Can be NULL. All known printf implementations 37 /* Can be NULL. All known printf implementations
@@ -43,7 +43,7 @@ void FAST_FUNC setfscreatecon_or_die(security_context_t scontext)
43 43
44void FAST_FUNC selinux_preserve_fcontext(int fdesc) 44void FAST_FUNC selinux_preserve_fcontext(int fdesc)
45{ 45{
46 security_context_t context; 46 char *context;
47 47
48 if (fgetfilecon(fdesc, &context) < 0) { 48 if (fgetfilecon(fdesc, &context) < 0) {
49 if (errno == ENODATA || errno == ENOTSUP) 49 if (errno == ENODATA || errno == ENOTSUP)
diff --git a/libbb/update_passwd.c b/libbb/update_passwd.c
index a228075cc..b8a47dc5a 100644
--- a/libbb/update_passwd.c
+++ b/libbb/update_passwd.c
@@ -18,7 +18,7 @@
18#if ENABLE_SELINUX 18#if ENABLE_SELINUX
19static void check_selinux_update_passwd(const char *username) 19static void check_selinux_update_passwd(const char *username)
20{ 20{
21 security_context_t seuser; 21 char *seuser;
22 char *p; 22 char *p;
23 23
24 if (getuid() != (uid_t)0 || is_selinux_enabled() == 0) 24 if (getuid() != (uid_t)0 || is_selinux_enabled() == 0)