projects
/
paraslash.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update documentation of activate_grab_client().
[paraslash.git]
/
daemon.c
diff --git
a/daemon.c
b/daemon.c
index c790c17ba5c6bfd124db576fa6b60e96732054e6..bb75478adae6f639b314fa7aa98a7ad2c3501e72 100644
(file)
--- a/
daemon.c
+++ b/
daemon.c
@@
-88,7
+88,7
@@
void close_log(FILE* logfile)
{
if (!logfile)
return;
{
if (!logfile)
return;
- PARA_INFO_LOG("
%s", "
closing logfile\n");
+ PARA_INFO_LOG("closing logfile\n");
fclose(logfile);
}
fclose(logfile);
}
@@
-126,27
+126,28
@@
void para_drop_privileges(const char *username, const char *groupname)
if (groupname) {
struct group *g = getgrnam(groupname);
if (!g) {
if (groupname) {
struct group *g = getgrnam(groupname);
if (!g) {
- PARA_EMERG_LOG("failed to get group %s\n", groupname);
+ PARA_EMERG_LOG("failed to get group %s: %s\n",
+ groupname, strerror(errno));
exit(EXIT_FAILURE);
}
if (setgid(g->gr_gid) < 0) {
exit(EXIT_FAILURE);
}
if (setgid(g->gr_gid) < 0) {
- PARA_EMERG_LOG("failed to set group id %d
(%s)
\n",
+ PARA_EMERG_LOG("failed to set group id %d
: %s
\n",
(int)g->gr_gid, strerror(errno));
exit(EXIT_FAILURE);
}
}
if (!username) {
(int)g->gr_gid, strerror(errno));
exit(EXIT_FAILURE);
}
}
if (!username) {
- PARA_EMERG_LOG("
%s", "
root privileges, but no user option given\n");
+ PARA_EMERG_LOG("root privileges, but no user option given\n");
exit(EXIT_FAILURE);
}
tmp = para_strdup(username);
p = getpwnam(tmp);
free(tmp);
if (!p) {
exit(EXIT_FAILURE);
}
tmp = para_strdup(username);
p = getpwnam(tmp);
free(tmp);
if (!p) {
- PARA_EMERG_LOG("%s
", "no such user\n"
);
+ PARA_EMERG_LOG("%s
: no such user\n", username
);
exit(EXIT_FAILURE);
}
exit(EXIT_FAILURE);
}
- PARA_INFO_LOG("
%s", "
dropping root privileges\n");
+ PARA_INFO_LOG("dropping root privileges\n");
setuid(p->pw_uid);
PARA_DEBUG_LOG("uid: %d, euid: %d\n", (int)getuid(), (int)geteuid());
}
setuid(p->pw_uid);
PARA_DEBUG_LOG("uid: %d, euid: %d\n", (int)getuid(), (int)geteuid());
}