Skip to content

Commit 85948ea

Browse files
become_user() moved to src/monitor
Monitor is the only user of this function and only if built with support of deprecated 'sssd.conf::user' option.
1 parent f3dd66f commit 85948ea

File tree

5 files changed

+8
-9
lines changed

5 files changed

+8
-9
lines changed

Makefile.am

+5-5
Original file line numberDiff line numberDiff line change
@@ -1300,7 +1300,6 @@ libsss_util_la_SOURCES = \
13001300
src/util/util_sss_idmap.c \
13011301
src/util/well_known_sids.c \
13021302
src/util/string_utils.c \
1303-
src/util/become_user.c \
13041303
src/util/capabilities.c \
13051304
src/util/util_watchdog.c \
13061305
src/util/sss_ptr_hash.c \
@@ -1528,6 +1527,11 @@ sssd_SOURCES = \
15281527
src/monitor/nscd.c \
15291528
src/confdb/confdb_setup.c \
15301529
$(NULL)
1530+
1531+
if BUILD_CONF_SERVICE_USER_SUPPORT
1532+
sssd_SOURCES += src/monitor/become_user.c
1533+
endif # BUILD_CONF_SERVICE_USER_SUPPORT
1534+
15311535
sssd_LDADD = \
15321536
$(SSSD_LIBS) \
15331537
$(INOTIFY_LIBS) \
@@ -2208,7 +2212,6 @@ krb5_utils_tests_SOURCES = \
22082212
src/providers/data_provider_fo.c \
22092213
src/providers/data_provider_opts.c \
22102214
src/providers/data_provider_callbacks.c \
2211-
src/util/become_user.c \
22122215
$(SSSD_FAILOVER_OBJ) \
22132216
$(NULL)
22142217
krb5_utils_tests_CFLAGS = \
@@ -4373,7 +4376,6 @@ libsss_krb5_common_la_SOURCES = \
43734376
src/providers/krb5/krb5_ccache.c \
43744377
src/util/sss_krb5.c \
43754378
src/util/sss_iobuf.c \
4376-
src/util/become_user.c \
43774379
src/util/pac_utils.c \
43784380
$(NULL)
43794381
libsss_krb5_common_la_CFLAGS = \
@@ -4684,7 +4686,6 @@ krb5_child_SOURCES = \
46844686
src/util/signal.c \
46854687
src/util/sss_chain_id.c \
46864688
src/util/strtonum.c \
4687-
src/util/become_user.c \
46884689
src/util/util_errors.c \
46894690
src/sss_client/common.c \
46904691
src/krb5_plugin/common/utils.c \
@@ -4727,7 +4728,6 @@ ldap_child_SOURCES = \
47274728
src/util/util_ext.c \
47284729
src/util/capabilities.c \
47294730
src/util/signal.c \
4730-
src/util/become_user.c \
47314731
src/util/util_errors.c \
47324732
$(NULL)
47334733
ldap_child_CFLAGS = \
File renamed without changes.

src/monitor/monitor_bootstrap.c

+2
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ static int check_supplementary_group(gid_t gid)
7878
#endif /* SSSD_NON_ROOT_USER */
7979

8080
#ifdef BUILD_CONF_SERVICE_USER_SUPPORT
81+
errno_t become_user(uid_t uid, gid_t gid, bool keep_set_uid);
82+
8183
int bootstrap_monitor_process(uid_t target_uid, gid_t target_gid)
8284
#else
8385
int bootstrap_monitor_process(void)

src/tests/cwrap/test_become_user.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*/
2222

2323
/* Yes, a .c file. We need to call static functions during the test */
24-
#include "../../../src/util/become_user.c"
24+
#include "../../../src/monitor/become_user.c"
2525

2626
#include <popt.h>
2727
#include "util/util.h"

src/util/util.h

-3
Original file line numberDiff line numberDiff line change
@@ -736,9 +736,6 @@ char **concatenate_string_array(TALLOC_CTX *mem_ctx,
736736
errno_t mod_defaults_list(TALLOC_CTX *mem_ctx, const char **defaults_list,
737737
char **mod_list, char ***_list);
738738

739-
/* from become_user.c */
740-
errno_t become_user(uid_t uid, gid_t gid, bool keep_set_uid);
741-
742739
/* from capabilities.c */
743740
errno_t sss_log_caps_to_str(bool only_non_zero, char **_str);
744741
errno_t sss_set_cap_effective(cap_value_t cap, bool effective);

0 commit comments

Comments
 (0)