automerge commit

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@11633 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Automerge script
2006-03-02 23:03:50 +00:00
parent 0840844421
commit 7f9c385052
2 changed files with 10 additions and 5 deletions

View File

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