From 87190269c708cb3278922aacb9a5f2d3e7f2630f Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Thu, 1 Jun 2006 08:08:30 +0000 Subject: [PATCH] - Implement partial error messages for src/filed/acl.c - Fix return code to fail when doing update barcodes and Pool resource is not found. This previously caused Volumes to be labeled as cleaning tapes. - Small updates to projects. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3039 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/kernstodo | 2 + bacula/kes-1.39 | 6 +++ bacula/projects | 12 +++--- bacula/src/dird/ua_label.c | 5 ++- bacula/src/filed/acl.c | 87 ++++++++++++++++++++++---------------- bacula/src/version.h | 4 +- 6 files changed, 71 insertions(+), 45 deletions(-) diff --git a/bacula/kernstodo b/bacula/kernstodo index 5a908f46cf..40d967f3a0 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -1544,3 +1544,5 @@ Block Position: 0 accept time qualifiers. - Does ClientRunAfterJob fail the job on a bad return code? - Make hardlink code at line 240 of find_one.c use binary search. +- Add ACL error messages in src/filed/acl.c. + diff --git a/bacula/kes-1.39 b/bacula/kes-1.39 index 368f1af702..83aa5031d2 100644 --- a/bacula/kes-1.39 +++ b/bacula/kes-1.39 @@ -2,6 +2,12 @@ Kern Sibbald General: +01Jun06 +- Implement partial error messages for src/filed/acl.c +- Fix return code to fail when doing update barcodes and + Pool resource is not found. This previously caused Volumes + to be labeled as cleaning tapes. +- Small updates to projects. 27May06 - Add Eric Bollengier patch for new RunScript directive. It breaks compatibility between dird and fd. diff --git a/bacula/projects b/bacula/projects index d3e2f9c2f6..3bc11156a6 100644 --- a/bacula/projects +++ b/bacula/projects @@ -487,7 +487,8 @@ Item 13: Multiple threads in file daemon for the same job Item 14: Implement red/black binary tree routines. Date: 28 October 2005 Origin: Kern - Status: + Status: Class code is complete. Code needs to be integrated into + restore tree code. What: Implement a red/black binary tree class. This could then replace the current binary insert/search routines @@ -499,7 +500,8 @@ Item 14: Implement red/black binary tree routines. Item 15: Add support for FileSets in user directories CACHEDIR.TAG Origin: Norbert Kiesel Date: 21 November 2005 - Status: + Status: (I think this is better done using a Python event that I + will implement in version 1.39.x). What: CACHDIR.TAG is a proposal for identifying directories which should be ignored for archiving/backup. It works by ignoring @@ -530,7 +532,7 @@ Item 15: Add support for FileSets in user directories CACHEDIR.TAG Item 16: Implement extraction of Win32 BackupWrite data. Origin: Thorsten Engel Date: 28 October 2005 - Status: Assigned to Thorsten. Implemented in current CVS + Status: Done. Assigned to Thorsten. Implemented in current CVS What: This provides the Bacula File daemon with code that can pick apart the stream output that Microsoft writes @@ -660,7 +662,7 @@ Item 21: Quick release of FD-SD connection after backup. Item 22: Permit multiple Media Types in an Autochanger Origin: Kern - Status: Now implemented + Status: Done. Implemented in 1.38.9 (I think). What: Modify the Storage daemon so that multiple Media Types can be specified in an autochanger. This would be somewhat @@ -769,7 +771,7 @@ Item n: Allow skipping execution of Jobs Item n: archive data - Origin: calvin streeting calvin@absentdream.com + Origin: calvin streeting calvin at absentdream dot com Date: 15/5/2006 What: The abilty to archive to media (dvd/cd) in a uncompressd format diff --git a/bacula/src/dird/ua_label.c b/bacula/src/dird/ua_label.c index 8869dcdcc0..9e2b7f46b5 100644 --- a/bacula/src/dird/ua_label.c +++ b/bacula/src/dird/ua_label.c @@ -953,8 +953,9 @@ static bool is_cleaning_tape(UAContext *ua, MEDIA_DBR *mr, POOL_DBR *pr) /* Find Pool resource */ ua->jcr->pool = (POOL *)GetResWithName(R_POOL, pr->Name); if (!ua->jcr->pool) { - bsendmsg(ua, _("Pool \"%s\" resource not found!\n"), pr->Name); - return true; + bsendmsg(ua, _("Pool \"%s\" resource not found for volume \"%s\"!\n"), + pr->Name, mr->VolumeName); + return false; } if (ua->jcr->pool->cleaning_prefix == NULL) { return false; diff --git a/bacula/src/filed/acl.c b/bacula/src/filed/acl.c index 39646a5443..d7ad3fdd30 100644 --- a/bacula/src/filed/acl.c +++ b/bacula/src/filed/acl.c @@ -29,7 +29,7 @@ * Version $Id$ */ /* - Copyright (C) 2004-2005 Kern Sibbald + Copyright (C) 2004-2006 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -48,41 +48,6 @@ #include "bacula.h" #include "filed.h" -#else -/* - * Test program setup - * - * Compile and set up with eg. with eg. - * - * $ cc -DTEST_PROGRAM -DHAVE_SUN_OS -lsec -o acl acl.c - * $ ln -s acl aclcp - * - * You can then list ACLs with acl and copy them with aclcp. - * - * For a list of compiler flags, see the list preceding the big #if below. - */ -#include -#include -#include -#include -#include -#include "acl.h" - -#define BACLLEN 65535 -#define pm_strcpy(d,s) (strncpy(d, s, BACLLEN - 1) == NULL ? -1 : (int)strlen(d)) -#define Dmsg0(n,s) fprintf(stderr, s) -#define Dmsg1(n,s,a1) fprintf(stderr, s, a1) -#define Dmsg2(n,s,a1,a2) fprintf(stderr, s, a1, a2) - -int aclls(char *fname); -int aclcp(char *src, char *dst); - -struct JCRstruct { - char *last_fname; - char acl_text[BACLLEN]; -}; -typedef struct JCRstruct JCR; -JCR jcr; #endif /* @@ -121,11 +86,13 @@ JCR jcr; /* bacl_get() returns the lenght of the string, or -1 on error. */ int bacl_get(JCR *jcr, int acltype) { + Jmsg(jcr, M_FATAL, 0, _("ACL support not configured for your machine.\n")); return -1; } int bacl_set(JCR *jcr, int acltype) { + Jmsg(jcr, M_FATAL, 0, _("ACL support not configured for your machine.\n")); return -1; } @@ -224,11 +191,19 @@ int bacl_set(JCR *jcr, int acltype) if (acl_delete_def_file(jcr->last_fname) == 0) { return 0; } + berrno be; + Jmsg2(jcr, M_ERROR, 0, _("acl_delete_def_file error on file \"%s\": ERR=%s\n"), + jcr->last_fname, be.strerror()); return -1; } acl = acl_from_text(jcr->acl_text); if (acl == NULL) { + berrno be; + Jmsg2(jcr, M_ERROR, 0, _("acl_from_text error on file \"%s\": ERR=%s\n"), + jcr->last_fname, be.strerror()); + Dmsg3(100, "acl_from_text error acl=%s file=%s ERR=%s\n"), + jcr->acl_text, jcr->last_fname, be.strerror()); return -1; } @@ -244,6 +219,10 @@ int bacl_set(JCR *jcr, int acltype) #endif if (acl_set_file(jcr->last_fname, ostype, acl) != 0) { + Jmsg2(jcr, M_ERROR, 0, _("acl_set_file error on file \"%s\": ERR=%s\n"), + jcr->last_fname, be.strerror()); + Dmsg3(100, "acl_set_file error acl=%s file=%s ERR=%s\n"), + jcr->acl_text, jcr->last_fname, be.strerror()); acl_free(acl); return -1; } @@ -347,6 +326,42 @@ int bacl_set(JCR *jcr, int acltype) #ifdef TEST_PROGRAM + +/* + * Test program setup + * + * Compile and set up with eg. with eg. + * + * $ cc -DTEST_PROGRAM -DHAVE_SUN_OS -lsec -o acl acl.c + * $ ln -s acl aclcp + * + * You can then list ACLs with acl and copy them with aclcp. + * + * For a list of compiler flags, see the list preceding the big #if below. + */ +#include +#include +#include +#include +#include +#include "acl.h" + +#define BACLLEN 65535 +#define pm_strcpy(d,s) (strncpy(d, s, BACLLEN - 1) == NULL ? -1 : (int)strlen(d)) +#define Dmsg0(n,s) fprintf(stderr, s) +#define Dmsg1(n,s,a1) fprintf(stderr, s, a1) +#define Dmsg2(n,s,a1,a2) fprintf(stderr, s, a1, a2) + +int aclls(char *fname); +int aclcp(char *src, char *dst); + +struct JCRstruct { + char *last_fname; + char acl_text[BACLLEN]; +}; +typedef struct JCRstruct JCR; +JCR jcr; + int main(int argc, char **argv) { char *prgname; diff --git a/bacula/src/version.h b/bacula/src/version.h index 11d554081f..d1d427ed80 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -4,8 +4,8 @@ #undef VERSION #define VERSION "1.39.12" -#define BDATE "26 May 2006" -#define LSMDATE "26May06" +#define BDATE "01 June 2006" +#define LSMDATE "01Jun06" /* Debug flags */ #undef DEBUG -- 2.39.5