source: trunk/server/source3/web/startstop.c

Last change on this file was 745, checked in by Silvan Scherrer, 13 years ago

Samba Server: updated trunk to 3.6.0

File size: 3.7 KB
Line 
1/*
2 Unix SMB/CIFS implementation.
3 start/stop nmbd and smbd
4 Copyright (C) Andrew Tridgell 1998
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#include "includes.h"
21
22#ifdef __OS2__
23 /* fork() in klibc on OS/2 ends all children when parent
24 is closed, therefore we use spawn() */
25#include "process.h"
26#define SWAT_HELPER(WHAT, WHO) \
27 asprintf(&binfile, "%s/swathelp.cmd", getcwd(NULL, _MAX_PATH)); \
28 int rc; \
29 rc=spawnl(P_NOWAIT, binfile, binfile, #WHAT, #WHO, NULL);
30#endif
31
32#include "web/swat_proto.h"
33#include "dynconfig.h"
34
35
36/** Startup smbd from web interface. */
37void start_smbd(void)
38{
39 char *binfile = NULL;
40
41 if (geteuid() != 0) {
42 return;
43 }
44
45#ifdef __OS2__
46 /* fork() in klibc on OS/2 ends all children when parent
47 is closed, therefore we use spawn() */
48 SWAT_HELPER(start, smbd)
49#else