Re: [Bacula-users] File ACLs with FreeBSD and Solaris

2005-11-14 Thread David Duchscher

On Nov 10, 2005, at 2:39 PM, Kern Sibbald wrote:


On Thursday 10 November 2005 21:22, Attila Fülöp wrote:

Referring to the thread [Bacula-users] ACL's with Bacula on FreeBSD
(resend) started by Tony Lambregts on 20.07.2005 20:15 I need some
clarifications.

Is the patch mentioned in this thread integrated into 1.38, that is
do ACLs work with FreeBSD? And second, even more important to me,
do ACLs work with Solaris clients?



Skimming over sys/acl.h on
Solaris 2.9 it seems this is quite a different API.

Yes, so are some of the others ...


I'm forced to use ACLs soon, and need a way to back them up. So I
would try to patch in support for Solaris ACLs if it's needed.


To the best of my knowledge with that patch integrated, ACLs
should now work on:

AIX
FreeBSD
Darwin
Irix
OSF1
Linux
HPUX
Solaris

Linux, Darwin, and FreeBSD have been pretty well tested.  The  
others *should*
work, but I don't recall anyone giving definitive feedback (correct  
me if I

am mistaken).


I can confirm that Solaris doesn't work.  Their is code for Solaris  
ACLs but the configure script does not detect ACL support on  
Solaris.  I helped with Darwin and FreeBSD but I have not had time to  
really look at Solaris fully until yesterday.  Seems disaster  
recovery is now top priority for the next few weeks.  Ah, the life of  
changing priorities.


--
DaveD




---
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


Re: [Bacula-users] File ACLs with FreeBSD and Solaris

2005-11-14 Thread David Duchscher

On Nov 11, 2005, at 3:55 PM, Kern Sibbald wrote:


On Friday 11 November 2005 22:33, David Duchscher wrote:

On Nov 11, 2005, at 11:23 AM, Attila Fülöp wrote:

Kern Sibbald wrote:

On Friday 11 November 2005 15:33, Attila Fülöp wrote:

David Duchscher wrote:

On Nov 10, 2005, at 2:39 PM, Kern Sibbald wrote:

On Thursday 10 November 2005 21:22, Attila Fülöp wrote:


snip/


Is the patch mentioned in this thread integrated into 1.38,
that is
do ACLs work with FreeBSD? And second, even more important  
to me,

do ACLs work with Solaris clients?


snip/

I can confirm that Solaris doesn't work.  Their is code for  
Solaris

ACLs but the configure script does not detect ACL support on
Solaris.
I helped with Darwin and FreeBSD but I have not had time to
really look
at Solaris fully until yesterday.  Seems disaster  recovery is
now top
priority for the next few weeks.  Ah, the life of  changing
priorities.


Ok, than I will try to patch configure.in to detect ACL support
on solaris.


That would be very kind of you ... :-)


All right, I'll do. That said, it may take some time since I've  
no sun

at home and are not that familiar with autoconf.


autoconf is easy to fix.  I have detection working now.  There is
also an issue with a ifdef in src/filed/acl.c that now that I look at
the code again, limits 1.38.0 to FreeBSD, Darwin, and Linux.  I had
just added FreeBSD and Darwin to the ifdef when I made my changes.  I
was trying not to change too many things and I had only tested those
platforms.  I am thinking that we should remove the ifdef or at least
enable the POSIX platforms.  Thoughts?


I probably won't have any problems moving a #ifdef, but I'll need  
to see it. I
consider such changes low impact if it just adds code for another  
platform.




As for Solaris, I have things mostly working on Solaris.  There is at
least one bug in the code currently in 1.38.0 and I am seeing another
strangeness when ACLs are restored.  I also have to figure out the
best way to bypass smartalloc to free the system call memory since I
am very new to smartalloc.  The good news is that we have lots of
Sun's around here that the admins have graciously given me access so
I can test things.  Hopefully I will have things working by the end
of the weekend.


Try: actuallyfree(void *);


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

Please give it look.

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 -   1.10
+++ src/filed/acl.c 14 Nov 2005 19:58:16 -
@@ -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



---
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


Re: [Bacula-users] ACL's with Bacula on FreeBSD (resend)

2005-08-01 Thread David Duchscher


--
DaveD

On Aug 1, 2005, at 11:59 AM, David Duchscher wrote:



On Jul 20, 2005, at 1:15 PM, Tony Lambregts wrote:



I have ACL's working on our FreeBSD Server using Samba but when I
tried to backup and restore the files using Bacula I was unable to
restore the ACL's. When I investigated I discovered that Bacula
configured itself to have  ACL support: no. I compiled it from
soure using ports (bacula-1.36.2) The relevant portion of the
configure check is as follows.

checking sys/acl.h usability... yes
checking sys/acl.h presence... yes
checking for sys/acl.h... yes
checking for acl_get_file in -lacl... no

From my research that last test is only really valid on linux.

I would really like to know how to get Bacula to backup and restore
ACL's on FreeBSD. Is this a known issue that has a simple fix or have
I missed something?

Thank you for your time.



acl_get_file is in libc on FreeBSD. The acl library does exists on  
freebsd and is why the test fails.  Removing the -lacl from the  
test will cause it to succeed.  Here is a replacement patch for / 
usr/ports/sysutils/bacula-server/files/patch-configure.   I haven't  
tested things completely yet so I am very interested in your  
results.  If it works for both of us, I will submit the patch to  
the port maintainer and we can see about getting the test fixed in  
future releases.  In case the mailer mangles the patch, you can  
also get it here:  http://freebsd.tamu.edu/bacula/


After poking around some more, there is some linux only calls and  
headers that get added in when ACLs are enabled.  I fixed those up  
and things will compile but being that is a lot of changes, I decided  
to check what changes went into 1.37.30.  Things are much better in  
1.37.30 and I would suggest looking at it for ACL support.  I also  
think testing the beta is probably best since any bugs found might be  
fixed before it becomes stable.   One thing that still needs fixing  
is the configure check for ACLs.  Its the same as in 1.36.3.   
Removing the -lacl will cause the test to pass on FreeBSD.


--
DaveD



---
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477alloc_id=16492op=click
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users