On Monday 14 November 2005 20:58, David Duchscher wrote:
...
>
> Here is the patch to fix ACLs on Solaris systems.  I have tested the
> code on a Solaris 2.6 system and have tested template of the code on
> these systems and filesystems:
>
>    SunOS 5.6 Generic_105181-16        UFS
>    SunOS 5.8 Generic_108528-08        NFS (to SunOS 5.9 Generic_117171-08)
>    SunOS 5.8 Generic_108528-23        UFS
>    SunOS 5.8 Generic_108528-23        VxFS
>    SunOS 5.9 Generic_112233-05        UFS
>    SunOS 5.10 Generic_118822-19       UFS

Impressive testing!  :-)

>
> Please give it look.

This looks concervative enough that I can include it in 1.38.1.  However, cut 
and paste just doesn't work from email, so I had to apply it by hand.  Please 
check the CVS (revision 1.11) to make sure I didn't botch it up.  It may take 
a few hours for the developer's CVS to filter down ...

>
> Index: src/filed/acl.c
> ===================================================================
> RCS file: /cvsroot/bacula/bacula/src/filed/acl.c,v
> retrieving revision 1.10
> diff -u -r1.10 acl.c
> --- src/filed/acl.c     6 Aug 2005 14:48:19 -0000       1.10
> +++ src/filed/acl.c     14 Nov 2005 19:58:16 -0000
> @@ -47,10 +47,6 @@
> #include "bacula.h"
> #include "filed.h"
> -/* So we can free system allocated memory */
> -#undef free
> -#undef malloc
> -#define malloc &* dont use malloc in this routine
> #else
> /*
> @@ -117,6 +113,9 @@
>
>      || !( defined(HAVE_LINUX_OS) \
>      ||
>         || defined(HAVE_FREEBSD_OS) \
>         || defined(HAVE_DARWIN_OS) \
>
> +      || defined(HAVE_IRIX_OS) \
> +      || defined(HAVE_OSF1_OS) \
> +      || defined(HAVE_SUN_OS) \
>          )
> /* bacl_get() returns the lenght of the string, or -1 on error. */
> @@ -318,7 +317,7 @@
>      if (acl(jcr->last_fname, GETACL, n, acls) == n) {
>         if ((acl_text = acltotext(acls, n)) != NULL) {
>            len = pm_strcpy(jcr->acl_text, acl_text);
> -         free(acl_text);
> +         actuallyfree(acl_text);
>            free(acls);
>            return len;
>         }
> @@ -336,11 +335,11 @@
>      if (!acls) {
>         return -1;
>      }
> -   if (acl(jcr->last_fname, SETACL, n, acls) != 0) {
> -      free(acls);
> +   if (acl(jcr->last_fname, SETACL, n, acls) == -1) {
> +      actuallyfree(acls);
>         return -1;
>      }
> -   free(acls);
> +   actuallyfree(acls);
>      return 0;
> }
>
> --
> DaveD

-- 
Best regards,

Kern

  (">
  /\
  V_V


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to