From 54fead963b90b5d912a08a0da84000501017052b Mon Sep 17 00:00:00 2001 From: Jiwoong Im Date: Mon, 13 Mar 2017 22:37:34 +0900 Subject: [PATCH] Remove changing user in buxton2ctl Change-Id: Ieacdd64643458068f556b20d67664c2e7a5c77bf Signed-off-by: Jiwoong Im --- client/c_direct.c | 40 ---------------------------------------- packaging/buxton2.spec | 5 +++++ 2 files changed, 5 insertions(+), 40 deletions(-) diff --git a/client/c_direct.c b/client/c_direct.c index 86b95bc..1029aac 100644 --- a/client/c_direct.c +++ b/client/c_direct.c @@ -44,43 +44,6 @@ void c_direct_set_conf(const char *conf) confpath = conf; } -static void change_user(const char *name) -{ - struct passwd pwd; - struct passwd *result; - char *buf; - size_t bufsize; - int r; - - bufsize = sysconf(_SC_GETPW_R_SIZE_MAX); - if (bufsize == -1) { - bxt_err("sysconf: _SC_GETPW_R_SIZE_MAX errno %d", errno); - return; - } - - buf = malloc(bufsize); - if (buf == NULL) - return; - - r = getpwnam_r(name, &pwd, buf, bufsize, &result); - - free(buf); - - if (r != 0) { - bxt_err("getpwnam_r: '%s' errno %d", name, errno); - return; - } - - if (result == NULL) { - bxt_err("getpwnam_r: '%s' not exist", name); - return; - } - - r = setuid(pwd.pw_uid); - if (r == -1) - bxt_err("setuid: errno %d", errno); -} - static void c_exit(void) { direct_exit(); @@ -91,9 +54,6 @@ static int c_init(void) int r; char err_buf[BUFFER_SIZE]; - /* TODO: configurable */ - change_user("buxton"); - r = direct_init(MODULE_DIR, confpath ? confpath : CONFPATH); if (r == -1) { strerror_r(errno, err_buf, sizeof(err_buf)); diff --git a/packaging/buxton2.spec b/packaging/buxton2.spec index bccfac4..e881af5 100644 --- a/packaging/buxton2.spec +++ b/packaging/buxton2.spec @@ -161,9 +161,14 @@ chsmack -a System "%{dbdir}" chsmack -t "%{dbdir}" %posttrans +chown -R buxton:buxton "%{basedbdir}" chmod 0600 %{basedbdir}/* chsmack -a System %{basedbdir}/* +chown -R buxton:buxton "%{dbdir}" +chmod 0600 %{dbdir}/* +chsmack -a System %{dbdir}/* + %postun -p /sbin/ldconfig %post -n vconf-compat -p /sbin/ldconfig -- 2.7.4