aboutsummaryrefslogtreecommitdiffstats
path: root/asterisk.c
diff options
context:
space:
mode:
authorroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-03-02 23:03:50 +0000
committerroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-03-02 23:03:50 +0000
commit6d36526d5f47c4f5331f24966c0c42f479fd60bb (patch)
tree3f2db70a039dbd9de73df1973b11c0283c4a52e0 /asterisk.c
parentf73af332115659aa163dca10e7add481ef5d73ee (diff)
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@11633 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'asterisk.c')
-rw-r--r--asterisk.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/asterisk.c b/asterisk.c
index 42feb9f0f..f29d7e182 100644
--- a/asterisk.c
+++ b/asterisk.c
@@ -83,6 +83,9 @@
#if defined(__FreeBSD__) || defined( __NetBSD__ ) || defined(SOLARIS)
#include <netdb.h>
+#if defined(SOLARIS)
+extern int daemon(int, int); /* defined in libresolv of all places */
+#endif
#endif
#include "asterisk.h"
@@ -2175,7 +2178,7 @@ int main(int argc, char *argv[])
exit(1);
}
if (setgid(gr->gr_gid)) {
- ast_log(LOG_WARNING, "Unable to setgid to %d (%s)\n", gr->gr_gid, rungroup);
+ ast_log(LOG_WARNING, "Unable to setgid to %d (%s)\n", (int)gr->gr_gid, rungroup);
exit(1);
}
if (setgroups(0, NULL)) {
@@ -2195,7 +2198,7 @@ int main(int argc, char *argv[])
}
if (!rungroup) {
if (setgid(pw->pw_gid)) {
- ast_log(LOG_WARNING, "Unable to setgid to %d!\n", pw->pw_gid);
+ ast_log(LOG_WARNING, "Unable to setgid to %d!\n", (int)pw->pw_gid);
exit(1);
}
if (initgroups(pw->pw_name, pw->pw_gid)) {
@@ -2204,7 +2207,7 @@ int main(int argc, char *argv[])
}
}
if (setuid(pw->pw_uid)) {
- ast_log(LOG_WARNING, "Unable to setuid to %d (%s)\n", pw->pw_uid, runuser);
+ ast_log(LOG_WARNING, "Unable to setuid to %d (%s)\n", (int)pw->pw_uid, runuser);
exit(1);
}
setenv("ASTERISK_ALREADY_NONROOT","yes",1);
@@ -2271,7 +2274,7 @@ int main(int argc, char *argv[])
unlink((char *)ast_config_AST_PID);
f = fopen((char *)ast_config_AST_PID, "w");
if (f) {
- fprintf(f, "%d\n", getpid());
+ fprintf(f, "%d\n", (int)getpid());
fclose(f);
} else
ast_log(LOG_WARNING, "Unable to open pid file '%s': %s\n", (char *)ast_config_AST_PID, strerror(errno));
@@ -2282,7 +2285,7 @@ int main(int argc, char *argv[])
unlink((char *)ast_config_AST_PID);
f = fopen((char *)ast_config_AST_PID, "w");
if (f) {
- fprintf(f, "%d\n", getpid());
+ fprintf(f, "%d\n", (int)getpid());
fclose(f);
} else
ast_log(LOG_WARNING, "Unable to open pid file '%s': %s\n", (char *)ast_config_AST_PID, strerror(errno));