summaryrefslogtreecommitdiff
path: root/source3/web/startstop.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-12-03 17:17:05 -0800
committerJeremy Allison <jra@samba.org>2007-12-03 17:17:05 -0800
commit6f46f75dfc2c80b99a6a5fb277bab456a5fd247b (patch)
tree7fb83fb23d7cdb81efb63de88d92ffe5d032a5f1 /source3/web/startstop.c
parenta22487025d20c6683f24fe3c5bb35b555d064523 (diff)
downloadsamba-6f46f75dfc2c80b99a6a5fb277bab456a5fd247b.tar.gz
samba-6f46f75dfc2c80b99a6a5fb277bab456a5fd247b.tar.bz2
samba-6f46f75dfc2c80b99a6a5fb277bab456a5fd247b.zip
Make strhex_to_str clear on string limits. Remove pstring from web/*.c
Jeremy. (This used to be commit f9c8d62389f8cb47837e5360209936176537df13)
Diffstat (limited to 'source3/web/startstop.c')
-rw-r--r--source3/web/startstop.c48
1 files changed, 24 insertions, 24 deletions
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);
}