From e02b05b5658fa50e6f94e604fc518a624211b6de Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 14 Mar 1998 13:00:09 +0000 Subject: new files to support starting/stopping the server (This used to be commit 087981009d57006ff80a0cf50891d4473f86f1bb) --- source3/web/startstop.c | 93 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 source3/web/startstop.c (limited to 'source3/web/startstop.c') diff --git a/source3/web/startstop.c b/source3/web/startstop.c new file mode 100644 index 0000000000..19781cc220 --- /dev/null +++ b/source3/web/startstop.c @@ -0,0 +1,93 @@ +/* + Unix SMB/Netbios implementation. + Version 1.9. + start/stop nmbd and smbd + Copyright (C) Andrew Tridgell 1998 + + 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 2 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., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "includes.h" +#include "smb.h" + +/* need to wait for daemons to startup */ +#define SLEEP_TIME 3 + +/* startup smbd */ +void start_smbd(void) +{ + pstring binfile; + + if (geteuid() != 0) return; + + if (fork()) { + sleep(SLEEP_TIME); + return; + } + + sprintf(binfile,"%s/smbd", SBINDIR); + + become_daemon(); + + execl(binfile, "-D", NULL); + + exit(0); +} + +/* startup nmbd */ +void start_nmbd(void) +{ + pstring binfile; + + if (geteuid() != 0) return; + + if (fork()) { + sleep(SLEEP_TIME); + return; + } + + sprintf(binfile,"%s/nmbd", SBINDIR); + + become_daemon(); + + execl(binfile, "-D", NULL); + + exit(0); +} + + +/* stop smbd */ +void stop_smbd(void) +{ + unsigned pid = pidfile_pid("smbd"); + + if (geteuid() != 0) return; + + if (pid == 0) return; + + kill(pid, SIGTERM); +} + +/* stop nmbd */ +void stop_nmbd(void) +{ + unsigned pid = pidfile_pid("nmbd"); + + if (geteuid() != 0) return; + + if (pid == 0) return; + + kill(pid, SIGTERM); +} -- cgit From d360320618fe3a7f53ac1f05ee3ac54323a03c82 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 15 Mar 1998 02:37:52 +0000 Subject: - added the ability to kill off individual connections from SWAT (from the status page) - split the claim_connection() code into its own file - fixed the claim_connection() code to lock the file when manipulating it - always claim a null connection at startup - fixed a bug in the pidfile code (This used to be commit abd4a17e21d12be3d1747e94ceb1915abaf135e3) --- source3/web/startstop.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source3/web/startstop.c') diff --git a/source3/web/startstop.c b/source3/web/startstop.c index 19781cc220..e60b13ae66 100644 --- a/source3/web/startstop.c +++ b/source3/web/startstop.c @@ -91,3 +91,14 @@ void stop_nmbd(void) kill(pid, SIGTERM); } + +/* kill a specified process */ +void kill_pid(int pid) +{ + if (geteuid() != 0) return; + + if (pid <= 0) return; + + kill(pid, SIGTERM); + sleep(SLEEP_TIME); +} -- cgit From 98034962747589c8066d29f1884ca06974aeb1f1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 17 Mar 1998 00:04:18 +0000 Subject: fixed call to execl() to get argv[0] right (thanks to Herb) (This used to be commit aaa4db4de3eb16d50d0263c8e69ace6217355f11) --- source3/web/startstop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/web/startstop.c') diff --git a/source3/web/startstop.c b/source3/web/startstop.c index e60b13ae66..5f7d2e6206 100644 --- a/source3/web/startstop.c +++ b/source3/web/startstop.c @@ -41,7 +41,7 @@ void start_smbd(void) become_daemon(); - execl(binfile, "-D", NULL); + execl(binfile, "smbd", "-D", NULL); exit(0); } @@ -62,7 +62,7 @@ void start_nmbd(void) become_daemon(); - execl(binfile, "-D", NULL); + execl(binfile, "nmbd", "-D", NULL); exit(0); } -- cgit From 8ffcec16feaced3716554f3885085381815c99bf Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 17 Mar 1998 00:32:34 +0000 Subject: show full path in ps by setting it in argv[0] (This used to be commit 89a4dc6cf9175d5fcdd827d90e4fed26576a4570) --- source3/web/startstop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/web/startstop.c') diff --git a/source3/web/startstop.c b/source3/web/startstop.c index 5f7d2e6206..7ac66f2180 100644 --- a/source3/web/startstop.c +++ b/source3/web/startstop.c @@ -41,7 +41,7 @@ void start_smbd(void) become_daemon(); - execl(binfile, "smbd", "-D", NULL); + execl(binfile, binfile, "-D", NULL); exit(0); } @@ -62,7 +62,7 @@ void start_nmbd(void) become_daemon(); - execl(binfile, "nmbd", "-D", NULL); + execl(binfile, binfile, "-D", NULL); exit(0); } -- cgit From f888868f46a5418bac9ab528497136c152895305 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 12 May 1998 00:55:32 +0000 Subject: This is a security audit change of the main source. It removed all ocurrences of the following functions : sprintf strcpy strcat The replacements are slprintf, safe_strcpy and safe_strcat. It should not be possible to use code in Samba that uses sprintf, strcpy or strcat, only the safe_equivalents. Once Andrew has fixed the slprintf implementation then this code will be moved back to the 1.9.18 code stream. Jeremy. (This used to be commit 2d774454005f0b54e5684cf618da7060594dfcbb) --- source3/web/startstop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/web/startstop.c') diff --git a/source3/web/startstop.c b/source3/web/startstop.c index 7ac66f2180..63e5afead2 100644 --- a/source3/web/startstop.c +++ b/source3/web/startstop.c @@ -37,7 +37,7 @@ void start_smbd(void) return; } - sprintf(binfile,"%s/smbd", SBINDIR); + slprintf(binfile, sizeof(pstring) - 1, "%s/smbd", SBINDIR); become_daemon(); @@ -58,7 +58,7 @@ void start_nmbd(void) return; } - sprintf(binfile,"%s/nmbd", SBINDIR); + slprintf(binfile, sizeof(pstring) - 1, "%s/nmbd", SBINDIR); become_daemon(); -- cgit From cf3a9741dc7427efb97eff09a3c197a906ce6767 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 28 Sep 1998 21:43:48 +0000 Subject: Changes to test in configure if capabilities are enabled on a system. Changes to get Samba to compile cleanly with the IRIX compiler with the options : -fullwarn -woff 1209,1174 (the -woff options are to turn off warnings about unused function parameters and controlling loop expressions being constants). Split prototype generation as we hit a limit in IRIX nawk. Removed "." code in smbd/filename.c (yet again :-). Jeremy. (This used to be commit e0567433bd72aec17bf5a54cc292701095d25f09) --- source3/web/startstop.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/web/startstop.c') diff --git a/source3/web/startstop.c b/source3/web/startstop.c index 63e5afead2..9eeac96cc0 100644 --- a/source3/web/startstop.c +++ b/source3/web/startstop.c @@ -71,7 +71,7 @@ void start_nmbd(void) /* stop smbd */ void stop_smbd(void) { - unsigned pid = pidfile_pid("smbd"); + pid_t pid = pidfile_pid("smbd"); if (geteuid() != 0) return; @@ -83,7 +83,7 @@ void stop_smbd(void) /* stop nmbd */ void stop_nmbd(void) { - unsigned pid = pidfile_pid("nmbd"); + pid_t pid = pidfile_pid("nmbd"); if (geteuid() != 0) return; @@ -93,7 +93,7 @@ void stop_nmbd(void) } /* kill a specified process */ -void kill_pid(int pid) +void kill_pid(pid_t pid) { if (geteuid() != 0) return; -- cgit From a44db4a3284e8eb6065bfedb7f3bf3188e282095 Mon Sep 17 00:00:00 2001 From: Herb Lewis Date: Fri, 20 Nov 1998 00:15:26 +0000 Subject: wrong directory path for smbd and nmbd (This used to be commit a33b4f623f196ca7e8056454b9212fe0ffa389c2) --- source3/web/startstop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/web/startstop.c') diff --git a/source3/web/startstop.c b/source3/web/startstop.c index 9eeac96cc0..6a15e7a46f 100644 --- a/source3/web/startstop.c +++ b/source3/web/startstop.c @@ -37,7 +37,7 @@ void start_smbd(void) return; } - slprintf(binfile, sizeof(pstring) - 1, "%s/smbd", SBINDIR); + slprintf(binfile, sizeof(pstring) - 1, "%s/smbd", BINDIR); become_daemon(); @@ -58,7 +58,7 @@ void start_nmbd(void) return; } - slprintf(binfile, sizeof(pstring) - 1, "%s/nmbd", SBINDIR); + slprintf(binfile, sizeof(pstring) - 1, "%s/nmbd", BINDIR); become_daemon(); -- cgit From 3db52feb1f3b2c07ce0b06ad4a7099fa6efe3fc7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 13 Dec 1999 13:27:58 +0000 Subject: first pass at updating head branch to be to be the same as the SAMBA_2_0 branch (This used to be commit 453a822a76780063dff23526c35408866d0c0154) --- source3/web/startstop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/web/startstop.c') diff --git a/source3/web/startstop.c b/source3/web/startstop.c index 6a15e7a46f..9eeac96cc0 100644 --- a/source3/web/startstop.c +++ b/source3/web/startstop.c @@ -37,7 +37,7 @@ void start_smbd(void) return; } - slprintf(binfile, sizeof(pstring) - 1, "%s/smbd", BINDIR); + slprintf(binfile, sizeof(pstring) - 1, "%s/smbd", SBINDIR); become_daemon(); @@ -58,7 +58,7 @@ void start_nmbd(void) return; } - slprintf(binfile, sizeof(pstring) - 1, "%s/nmbd", BINDIR); + slprintf(binfile, sizeof(pstring) - 1, "%s/nmbd", SBINDIR); become_daemon(); -- cgit From f741f656737f4ec46cd318e986b6bf412ed309d2 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Mon, 19 Nov 2001 02:49:53 +0000 Subject: Store some path names in global variables initialized to configure default, rather than in preprocessor macros. (This used to be commit 79ec88f0da40faebe1e587f1b3e87b5f2b184f58) --- source3/web/startstop.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source3/web/startstop.c') diff --git a/source3/web/startstop.c b/source3/web/startstop.c index 9eeac96cc0..80b5ce7444 100644 --- a/source3/web/startstop.c +++ b/source3/web/startstop.c @@ -21,11 +21,12 @@ #include "includes.h" #include "smb.h" +#include "dynconfig.h" -/* need to wait for daemons to startup */ +/** Need to wait for daemons to startup */ #define SLEEP_TIME 3 -/* startup smbd */ +/** Startup smbd from web interface. */ void start_smbd(void) { pstring binfile; @@ -37,7 +38,7 @@ void start_smbd(void) return; } - slprintf(binfile, sizeof(pstring) - 1, "%s/smbd", SBINDIR); + slprintf(binfile, sizeof(pstring) - 1, "%s/smbd", dyn_SBINDIR); become_daemon(); @@ -58,7 +59,7 @@ void start_nmbd(void) return; } - slprintf(binfile, sizeof(pstring) - 1, "%s/nmbd", SBINDIR); + slprintf(binfile, sizeof(pstring) - 1, "%s/nmbd", dyn_SBINDIR); become_daemon(); -- cgit From cd68afe31256ad60748b34f7318a180cfc2127cc Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Wed, 30 Jan 2002 06:08:46 +0000 Subject: Removed version number from file header. Changed "SMB/Netbios" to "SMB/CIFS" in file header. (This used to be commit 6a58c9bd06d0d7502a24bf5ce5a2faf0a146edfa) --- source3/web/startstop.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/web/startstop.c') diff --git a/source3/web/startstop.c b/source3/web/startstop.c index 80b5ce7444..27ee7dd96e 100644 --- a/source3/web/startstop.c +++ b/source3/web/startstop.c @@ -1,6 +1,5 @@ /* - Unix SMB/Netbios implementation. - Version 1.9. + Unix SMB/CIFS implementation. start/stop nmbd and smbd Copyright (C) Andrew Tridgell 1998 -- cgit From 75722fa183d1678bc7360bc79f9ac8cf17cd62e3 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Wed, 20 Mar 2002 06:57:03 +0000 Subject: Add assertions that kill() is never accidentally passed a non-positive pid. This follows a bug in rsync where it would accidentally kill(-1), removing all the user's processes. I can't see any way this would directly happen in Samba, but having the assertions seems beneficial. http://cvs.samba.org/cgi-bin/cvsweb/rsync/util.c.diff?r1=1.108&r2=1.109&f=h (This used to be commit 098905bea29c7d5b886809d431294ddf2fc1e152) --- source3/web/startstop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/web/startstop.c') diff --git a/source3/web/startstop.c b/source3/web/startstop.c index 27ee7dd96e..c56320c962 100644 --- a/source3/web/startstop.c +++ b/source3/web/startstop.c @@ -75,7 +75,7 @@ void stop_smbd(void) if (geteuid() != 0) return; - if (pid == 0) return; + if (pid <= 0) return; kill(pid, SIGTERM); } @@ -87,7 +87,7 @@ void stop_nmbd(void) if (geteuid() != 0) return; - if (pid == 0) return; + if (pid <= 0) return; kill(pid, SIGTERM); } -- cgit From e90b65284812aaa5ff9e9935ce9bbad7791cbbcd Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 15 Jul 2002 10:35:28 +0000 Subject: updated the 3.0 branch from the head branch - ready for alpha18 (This used to be commit 03ac082dcb375b6f3ca3d810a6a6367542bc23ce) --- source3/web/startstop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/web/startstop.c') diff --git a/source3/web/startstop.c b/source3/web/startstop.c index c56320c962..893784dd55 100644 --- a/source3/web/startstop.c +++ b/source3/web/startstop.c @@ -19,7 +19,7 @@ */ #include "includes.h" -#include "smb.h" +#include "../web/swat_proto.h" #include "dynconfig.h" /** Need to wait for daemons to startup */ -- cgit From fcbb06414d2c8385ce4e68f23905a528c8fbd4e8 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 17 Aug 2002 14:34:48 +0000 Subject: sync 3.0 branch with HEAD (This used to be commit d53d77cc8e21dfbfd376d529661ef299e14e31a0) --- source3/web/startstop.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'source3/web/startstop.c') diff --git a/source3/web/startstop.c b/source3/web/startstop.c index 893784dd55..e10dff4118 100644 --- a/source3/web/startstop.c +++ b/source3/web/startstop.c @@ -67,6 +67,27 @@ void start_nmbd(void) exit(0); } +/** Startup winbindd from web interface. */ +void start_winbindd(void) +{ + pstring binfile; + + if (geteuid() != 0) return; + + if (fork()) { + sleep(SLEEP_TIME); + return; + } + + slprintf(binfile, sizeof(pstring) - 1, "%s/winbindd", dyn_SBINDIR); + + become_daemon(); + + execl(binfile, binfile, NULL); + + exit(0); +} + /* stop smbd */ void stop_smbd(void) @@ -91,7 +112,19 @@ void stop_nmbd(void) kill(pid, SIGTERM); } +#ifdef WITH_WINBIND +/* stop winbindd */ +void stop_winbindd(void) +{ + pid_t pid = pidfile_pid("winbindd"); + if (geteuid() != 0) return; + + if (pid <= 0) return; + + kill(pid, SIGTERM); +} +#endif /* kill a specified process */ void kill_pid(pid_t pid) { -- cgit From f5d5df9644abc08ae1b16a0826eb8cf5c3de54d1 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 3 Jan 2003 17:39:30 +0000 Subject: patch to include support for daemontools from Michael Handler (This used to be commit a8db1b611d83bfd8dcf60f1e6d8fcbf57c798528) --- source3/web/startstop.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/web/startstop.c') diff --git a/source3/web/startstop.c b/source3/web/startstop.c index e10dff4118..c6babff954 100644 --- a/source3/web/startstop.c +++ b/source3/web/startstop.c @@ -39,7 +39,7 @@ void start_smbd(void) slprintf(binfile, sizeof(pstring) - 1, "%s/smbd", dyn_SBINDIR); - become_daemon(); + become_daemon(True); execl(binfile, binfile, "-D", NULL); @@ -60,7 +60,7 @@ void start_nmbd(void) slprintf(binfile, sizeof(pstring) - 1, "%s/nmbd", dyn_SBINDIR); - become_daemon(); + become_daemon(True); execl(binfile, binfile, "-D", NULL); @@ -81,7 +81,7 @@ void start_winbindd(void) slprintf(binfile, sizeof(pstring) - 1, "%s/winbindd", dyn_SBINDIR); - become_daemon(); + become_daemon(True); execl(binfile, binfile, NULL); -- cgit From 8f6e88dbb6936abdb62a90a6bb0ef947ec8c9bb6 Mon Sep 17 00:00:00 2001 From: John Terpstra Date: Thu, 24 Apr 2003 02:35:00 +0000 Subject: Added patch from Stephen Roylance. (This used to be commit 71369f90890eeca399fec55d978a5dd4a13f077f) --- source3/web/startstop.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'source3/web/startstop.c') diff --git a/source3/web/startstop.c b/source3/web/startstop.c index c6babff954..93e8650c2b 100644 --- a/source3/web/startstop.c +++ b/source3/web/startstop.c @@ -22,8 +22,6 @@ #include "../web/swat_proto.h" #include "dynconfig.h" -/** Need to wait for daemons to startup */ -#define SLEEP_TIME 3 /** Startup smbd from web interface. */ void start_smbd(void) @@ -33,7 +31,6 @@ void start_smbd(void) if (geteuid() != 0) return; if (fork()) { - sleep(SLEEP_TIME); return; } @@ -54,7 +51,6 @@ void start_nmbd(void) if (geteuid() != 0) return; if (fork()) { - sleep(SLEEP_TIME); return; } @@ -75,7 +71,6 @@ void start_winbindd(void) if (geteuid() != 0) return; if (fork()) { - sleep(SLEEP_TIME); return; } @@ -133,5 +128,4 @@ void kill_pid(pid_t pid) if (pid <= 0) return; kill(pid, SIGTERM); - sleep(SLEEP_TIME); } -- cgit From b4cf9e95059071df49b34ff8574e48cb96f42da1 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Thu, 7 Oct 2004 04:01:18 +0000 Subject: r2835: Since we always have -I. and -I$(srcdir) in CFLAGS, we can get rid of '..' from all #include preprocessor commands. This fixes bugzilla #1880 where OpenVMS gets confused about the '.' characters. (This used to be commit 7f161702fa4916979602cc0295919b541912acd6) --- source3/web/startstop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/web/startstop.c') diff --git a/source3/web/startstop.c b/source3/web/startstop.c index 93e8650c2b..9ffda5bb94 100644 --- a/source3/web/startstop.c +++ b/source3/web/startstop.c @@ -19,7 +19,7 @@ */ #include "includes.h" -#include "../web/swat_proto.h" +#include "web/swat_proto.h" #include "dynconfig.h" -- cgit From 54abd2aa66069e6baf7769c496f46d9dba18db39 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 30 Sep 2005 17:13:37 +0000 Subject: r10656: BIG merge from trunk. Features not copied over * \PIPE\unixinfo * winbindd's {group,alias}membership new functions * winbindd's lookupsids() functionality * swat (trunk changes to be reverted as per discussion with Deryck) (This used to be commit 939c3cb5d78e3a2236209b296aa8aba8bdce32d3) --- source3/web/startstop.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/web/startstop.c') diff --git a/source3/web/startstop.c b/source3/web/startstop.c index 9ffda5bb94..8f28748918 100644 --- a/source3/web/startstop.c +++ b/source3/web/startstop.c @@ -121,11 +121,11 @@ void stop_winbindd(void) } #endif /* kill a specified process */ -void kill_pid(pid_t pid) +void kill_pid(struct process_id pid) { if (geteuid() != 0) return; - if (pid <= 0) return; + if (procid_to_pid(&pid) <= 0) return; - kill(pid, SIGTERM); + kill(procid_to_pid(&pid), SIGTERM); } -- cgit From 250c02554ec3dd52f33e33406fdd605f5d932d5f Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 21 Mar 2006 13:16:50 +0000 Subject: r14618: add --no-process-group to all server programms to make the following possible: timelimit 20000 bin/nmbd -F -S --no-process-group timelimit 20000 bin/smbd -F -S --no-process-group this is needed to 'make test' working without losing child processes metze (This used to be commit c3a9f30e2a12cc852c9fa3a7d161f5c6ee0694ce) --- source3/web/startstop.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/web/startstop.c') diff --git a/source3/web/startstop.c b/source3/web/startstop.c index 8f28748918..44945cd536 100644 --- a/source3/web/startstop.c +++ b/source3/web/startstop.c @@ -36,7 +36,7 @@ void start_smbd(void) slprintf(binfile, sizeof(pstring) - 1, "%s/smbd", dyn_SBINDIR); - become_daemon(True); + become_daemon(True, False); execl(binfile, binfile, "-D", NULL); @@ -56,7 +56,7 @@ void start_nmbd(void) slprintf(binfile, sizeof(pstring) - 1, "%s/nmbd", dyn_SBINDIR); - become_daemon(True); + become_daemon(True, False); execl(binfile, binfile, "-D", NULL); @@ -76,7 +76,7 @@ void start_winbindd(void) slprintf(binfile, sizeof(pstring) - 1, "%s/winbindd", dyn_SBINDIR); - become_daemon(True); + become_daemon(True, False); execl(binfile, binfile, NULL); -- cgit From e6383f47629368d9dd4e803f17566a24e9d7359e Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 7 May 2007 09:35:35 +0000 Subject: r22736: Start to merge the low-hanging fruit from the now 7000-line cluster patch. This changes "struct process_id" to "struct server_id", keeping both is just too much hassle. No functional change (I hope ;-)) Volker (This used to be commit 0ad4b1226c9d91b72136310d3bbb640d2c5d67b8) --- source3/web/startstop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/web/startstop.c') diff --git a/source3/web/startstop.c b/source3/web/startstop.c index 44945cd536..1485516474 100644 --- a/source3/web/startstop.c +++ b/source3/web/startstop.c @@ -121,7 +121,7 @@ void stop_winbindd(void) } #endif /* kill a specified process */ -void kill_pid(struct process_id pid) +void kill_pid(struct server_id pid) { if (geteuid() != 0) return; -- cgit From d824b98f80ba186030cbb70b3a1e5daf80469ecd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 9 Jul 2007 19:25:36 +0000 Subject: r23779: Change from v2 or later to v3 or later. Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3) --- source3/web/startstop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/web/startstop.c') diff --git a/source3/web/startstop.c b/source3/web/startstop.c index 1485516474..9306d7ba1f 100644 --- a/source3/web/startstop.c +++ b/source3/web/startstop.c @@ -5,7 +5,7 @@ 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 2 of the License, or + 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, -- cgit From 5e54558c6dea67b56bbfaba5698f3a434d3dffb6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 00:52:41 +0000 Subject: r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text (This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07) --- source3/web/startstop.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/web/startstop.c') diff --git a/source3/web/startstop.c b/source3/web/startstop.c index 9306d7ba1f..63a9f298a5 100644 --- a/source3/web/startstop.c +++ b/source3/web/startstop.c @@ -14,8 +14,7 @@ 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., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #include "includes.h" -- cgit From 6f46f75dfc2c80b99a6a5fb277bab456a5fd247b Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 3 Dec 2007 17:17:05 -0800 Subject: Make strhex_to_str clear on string limits. Remove pstring from web/*.c Jeremy. (This used to be commit f9c8d62389f8cb47837e5360209936176537df13) --- source3/web/startstop.c | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'source3/web/startstop.c') diff --git a/source3/web/startstop.c b/source3/web/startstop.c index 63a9f298a5..436666f849 100644 --- a/source3/web/startstop.c +++ b/source3/web/startstop.c @@ -25,60 +25,60 @@ /** Startup smbd from web interface. */ void start_smbd(void) { - pstring binfile; + char *binfile = NULL; - if (geteuid() != 0) return; + if (geteuid() != 0) { + return; + } if (fork()) { return; } - slprintf(binfile, sizeof(pstring) - 1, "%s/smbd", dyn_SBINDIR); - - become_daemon(True, False); - - execl(binfile, binfile, "-D", NULL); - + if (asprintf(&binfile, "%s/smbd", dyn_SBINDIR) > 0) { + become_daemon(true, false); + execl(binfile, binfile, "-D", NULL); + } exit(0); } /* startup nmbd */ void start_nmbd(void) { - pstring binfile; + char *binfile = NULL; - if (geteuid() != 0) return; + if (geteuid() != 0) { + return; + } if (fork()) { return; } - slprintf(binfile, sizeof(pstring) - 1, "%s/nmbd", dyn_SBINDIR); - - become_daemon(True, False); - - execl(binfile, binfile, "-D", NULL); - + if (asprintf(&binfile, "%s/nmbd", dyn_SBINDIR) > 0) { + become_daemon(true, false); + execl(binfile, binfile, "-D", NULL); + } exit(0); } /** Startup winbindd from web interface. */ void start_winbindd(void) { - pstring binfile; + char *binfile = NULL; - if (geteuid() != 0) return; + if (geteuid() != 0) { + return; + } if (fork()) { return; } - slprintf(binfile, sizeof(pstring) - 1, "%s/winbindd", dyn_SBINDIR); - - become_daemon(True, False); - - execl(binfile, binfile, NULL); - + if (asprintf(&binfile, "%s/winbindd", dyn_SBINDIR) > 0) { + become_daemon(true, false); + execl(binfile, binfile, NULL); + } exit(0); } -- cgit From 7faee02d0d351c5c039e8f1be7e82ce3a93cbe96 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 10 Dec 2007 11:30:37 -0800 Subject: Remove the char[1024] strings from dynconfig. Replace them with malloc'ing accessor functions. Should save a lot of static space :-). Jeremy. (This used to be commit 52dc5eaef2106015b3a8b659e818bdb15ad94b05) --- source3/web/startstop.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/web/startstop.c') diff --git a/source3/web/startstop.c b/source3/web/startstop.c index 436666f849..b24410a89f 100644 --- a/source3/web/startstop.c +++ b/source3/web/startstop.c @@ -35,7 +35,7 @@ void start_smbd(void) return; } - if (asprintf(&binfile, "%s/smbd", dyn_SBINDIR) > 0) { + if (asprintf(&binfile, "%s/smbd", get_dyn_SBINDIR()) > 0) { become_daemon(true, false); execl(binfile, binfile, "-D", NULL); } @@ -55,7 +55,7 @@ void start_nmbd(void) return; } - if (asprintf(&binfile, "%s/nmbd", dyn_SBINDIR) > 0) { + if (asprintf(&binfile, "%s/nmbd", get_dyn_SBINDIR()) > 0) { become_daemon(true, false); execl(binfile, binfile, "-D", NULL); } @@ -75,7 +75,7 @@ void start_winbindd(void) return; } - if (asprintf(&binfile, "%s/winbindd", dyn_SBINDIR) > 0) { + if (asprintf(&binfile, "%s/winbindd", get_dyn_SBINDIR()) > 0) { become_daemon(true, false); execl(binfile, binfile, NULL); } -- cgit