X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Fsrc%2Ffiled%2Facl.c;h=9eb017ebb00e99bb0f86ea4c986e5f575fad85cb;hb=6e637fce30a1fdbc2da43552f513f529db4d4e87;hp=0c9ce046c702a9d18816af16e5665dfbc9871948;hpb=39912304e77f5f344d9e5312c07ae27b45c90095;p=bacula%2Fbacula diff --git a/bacula/src/filed/acl.c b/bacula/src/filed/acl.c index 0c9ce046c7..9eb017ebb0 100644 --- a/bacula/src/filed/acl.c +++ b/bacula/src/filed/acl.c @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2004-2007 Free Software Foundation Europe e.V. + Copyright (C) 2004-2008 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -176,6 +176,24 @@ int bacl_get(JCR *jcr, int acltype) acl = acl_get_file(jcr->last_fname, ostype); if (acl) { +#if defined(HAVE_IRIX_OS) + /* + * From observation, IRIX's acl_get_file() seems to return a + * non-NULL acl with a count field of -1 when a file has no ACL + * defined, while IRIX's acl_to_text() returns NULL when presented + * with such an ACL. + * + * Checking the count in the acl structure before calling + * acl_to_text() lets us avoid error messages about files + * with no ACLs, without modifying the flow of the code used for + * other operating systems, and it saves making some calls + * to acl_to_text() besides. + */ + if (acl->acl_cnt <= 0) { + acl_free(acl); + return 0; + } +#endif if ((acl_text = acl_to_text(acl, NULL)) != NULL) { len = pm_strcpy(jcr->acl_text, acl_text); acl_free(acl);