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();
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));
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