/*
* $Id$
*
- * Citadel "system dependent" stuff.
- * See copyright.txt for copyright information.
+ * WebCit "system dependent" code.
*
- * Here's where we (hopefully) have most parts of the Citadel server that
- * would need to be altered to run the server in a non-POSIX environment.
- *
- * If we ever port to a different platform and either have multiple
- * variants of this file or simply load it up with #ifdefs.
+ * Copyright (c) 1996-2010 by the citadel.org team
*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+
#include "sysdep.h"
#include <stdlib.h>
#include <unistd.h>
}
-
-
/*
* Shut us down the regular way.
* signum is the signal we want to forward
exit(WEXITSTATUS(status));
}
+
/*
* Spawn an additional worker thread into the pool.
*/
* otherwise the MIME parser crashes on FreeBSD.
*/
if ((ret = pthread_attr_setstacksize(&attr, 1024 * 1024))) {
- lprintf(1, "pthread_attr_setstacksize: %s\n",
- strerror(ret));
+ lprintf(1, "pthread_attr_setstacksize: %s\n", strerror(ret));
pthread_attr_destroy(&attr);
}
/* now create the thread */
- if (pthread_create(&SessThread, &attr,
- (void *(*)(void *)) worker_entry, NULL)
- != 0) {
+ if (pthread_create(&SessThread, &attr, (void *(*)(void *)) worker_entry, NULL) != 0) {
lprintf(1, "Can't create thread: %s\n", strerror(errno));
}
perror("chdir");
}
}
+
void drop_root(uid_t UID)
{
struct passwd pw, *pwp = NULL;