From 71db0a036d786143578946602afaa313b9f9d709 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Tue, 20 Sep 2005 12:36:00 +0000 Subject: [PATCH] Tweak daemon.c berrno, copyright. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2399 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/kernstodo | 1 + bacula/kes-1.37 | 2 ++ bacula/src/lib/daemon.c | 30 +++++++++++++----------------- bacula/src/version.h | 4 ++-- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/bacula/kernstodo b/bacula/kernstodo index c30214aefb..63aeb67e3e 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -11,6 +11,7 @@ Final items for 1.37 before release: 1. Fix bugs - Look at fixing restore status stats in SD. - Mount after manually unloading changer causes hang in SD +- Close STDOUT if debug_level == 0 - Check if ANSI tape labeling works with drive in read-only mode. > > btape: label.c:299 write_volume_label() diff --git a/bacula/kes-1.37 b/bacula/kes-1.37 index 1deda0081c..f38aaae9f4 100644 --- a/bacula/kes-1.37 +++ b/bacula/kes-1.37 @@ -4,6 +4,8 @@ General: Changes to 1.37.39: +20Sep05 +- Tweak daemon.c berrno, copyright. 19Sep05 - Fix handling of temp file in mtx_changer.in, reported as a security bug, but it is not really. Bug #422 diff --git a/bacula/src/lib/daemon.c b/bacula/src/lib/daemon.c index 55ce00b6bc..871a25e169 100644 --- a/bacula/src/lib/daemon.c +++ b/bacula/src/lib/daemon.c @@ -12,24 +12,18 @@ * any terminal processes. * */ - /* - Copyright (C) 2000-2004 Kern Sibbald and John Walker + Copyright (C) 2000-2005 Kern Sibbald 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. + modify it under the terms of the GNU General Public License + version 2 as amended with additional clauses defined in the + file LICENSE in the main source directory. 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. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + the file LICENSE for additional details. */ @@ -54,10 +48,12 @@ daemon_start() */ Dmsg0(900, "Enter daemon_start\n"); - if ( (cpid = fork() ) < 0) - Emsg1(M_ABORT, 0, _("Cannot fork to become daemon: %s\n"), strerror(errno)); - else if (cpid > 0) - exit(0); /* parent exits */ + if ( (cpid = fork() ) < 0) { + berrno be; + Emsg1(M_ABORT, 0, _("Cannot fork to become daemon: %s\n"), be.strerror()); + } else if (cpid > 0) { + exit(0); /* parent exits */ + } /* Child continues */ setsid(); @@ -101,7 +97,7 @@ daemon_start() close(fd); } else { for(i=1; fd + i <= 2; i++) { - dup2(fd, fd+i); + dup2(fd, fd+i); } } diff --git a/bacula/src/version.h b/bacula/src/version.h index ce9c0a4584..5d8d3a1a93 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -4,8 +4,8 @@ #undef VERSION #define VERSION "1.37.39" -#define BDATE "19 September 2005" -#define LSMDATE "19Sep05" +#define BDATE "20 September 2005" +#define LSMDATE "20Sep05" /* Debug flags */ #undef DEBUG -- 2.39.5