Re: mtree acl support

2014-01-16 Thread Tim Kientzle

On Jan 16, 2014, at 12:36 PM, Mark Felder  wrote:

> On Wed, Jan 15, 2014, at 23:11, Tim Kientzle wrote:
>> 
>> On Jan 14, 2014, at 6:47 AM, Mark Felder  wrote:
>> 
>>> I was recently talking to someone about how one would backup / restore
>>> ACLs reliably. I didn't see any mention of ACLs in the mtree man page
>>> and after a quick google I came upon this old mailing list post:
>>> 
>>> http://lists.freebsd.org/pipermail/freebsd-hackers/2008-April/024173.html
>>> 
>>> patch in list is here: http://heka.cenkes.org/sat/diffs/mtree_acl.diff
>>> I've mirrored it here: https://feld.me/freebsd/mtree_acl.diff
>>> 
>>> This old patch appears to still apply cleanly. I hate to see a patch die
>>> and be forgotten.
>> 
>> One problem that ‘tar’ has addressed (inspired by Joerg Schilling’s
>> work on star) is to permit ACLs to be restored even if the user database
>> is out of date.
>> 
>> This is done by including a fourth field in each ACE with the
>> numeric user ID.
>> 
>> I suspect you want to do the same for mtree.  I thought
>> I remembered acl_to_text having an option to use
>> an extended text format, so it might be a trivial change.
>> 
> 
> As long as it's not default. One of the most convenient ways to change a
> user's UID (or multiple users!) is to do an mtree backup, change
> UID/GID, and then re-apply mtree backup. Every file that the user(s)
> previously owned will be automatically changed to the new UID/GID for
> you :-)

The extended format stores both name and numeric ID.

It tries to restore by name first (looking up as necessary), then falls back on 
ID if that fails.

So this does correctly handle your case.

This also lets you restore trees when user lookups are unavailable.  For 
example, user lookups may be broken because of permission problems that you’re 
trying to fix with mtree.  ;-)

Tim

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: mtree acl support

2014-01-16 Thread Edward Tomasz Napierała
Wiadomość napisana przez Mark Felder w dniu 16 sty 2014, o godz. 21:36:
> On Wed, Jan 15, 2014, at 23:11, Tim Kientzle wrote:
>> 
>> On Jan 14, 2014, at 6:47 AM, Mark Felder  wrote:
>> 
>>> I was recently talking to someone about how one would backup / restore
>>> ACLs reliably. I didn't see any mention of ACLs in the mtree man page
>>> and after a quick google I came upon this old mailing list post:
>>> 
>>> http://lists.freebsd.org/pipermail/freebsd-hackers/2008-April/024173.html
>>> 
>>> patch in list is here: http://heka.cenkes.org/sat/diffs/mtree_acl.diff
>>> I've mirrored it here: https://feld.me/freebsd/mtree_acl.diff
>>> 
>>> This old patch appears to still apply cleanly. I hate to see a patch die
>>> and be forgotten.
>> 
>> One problem that ‘tar’ has addressed (inspired by Joerg Schilling’s
>> work on star) is to permit ACLs to be restored even if the user database
>> is out of date.
>> 
>> This is done by including a fourth field in each ACE with the
>> numeric user ID.
>> 
>> I suspect you want to do the same for mtree.  I thought
>> I remembered acl_to_text having an option to use
>> an extended text format, so it might be a trivial change.
>> 
> 
> As long as it's not default. One of the most convenient ways to change a
> user's UID (or multiple users!) is to do an mtree backup, change
> UID/GID, and then re-apply mtree backup. Every file that the user(s)
> previously owned will be automatically changed to the new UID/GID for
> you :-)

I don't think the functionality above would interfere with that in any way.
The owner entries ("user:" for POSIX, "owner@" for NFSv4 ACLs) are stored
in a different way, and they never have the appended ID.

(Besides, why not just "find ./ -user XXX -print0 | xargs -0 chown YYY"?)

-- 
If you cut off my head, what would I say?  Me and my head, or me and my body?

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Re: mtree acl support

2014-01-16 Thread Mark Felder
On Wed, Jan 15, 2014, at 23:11, Tim Kientzle wrote:
> 
> On Jan 14, 2014, at 6:47 AM, Mark Felder  wrote:
> 
> > I was recently talking to someone about how one would backup / restore
> > ACLs reliably. I didn't see any mention of ACLs in the mtree man page
> > and after a quick google I came upon this old mailing list post:
> > 
> > http://lists.freebsd.org/pipermail/freebsd-hackers/2008-April/024173.html
> > 
> > patch in list is here: http://heka.cenkes.org/sat/diffs/mtree_acl.diff
> > I've mirrored it here: https://feld.me/freebsd/mtree_acl.diff
> > 
> > This old patch appears to still apply cleanly. I hate to see a patch die
> > and be forgotten.
> 
> One problem that ‘tar’ has addressed (inspired by Joerg Schilling’s
> work on star) is to permit ACLs to be restored even if the user database
> is out of date.
> 
> This is done by including a fourth field in each ACE with the
> numeric user ID.
> 
> I suspect you want to do the same for mtree.  I thought
> I remembered acl_to_text having an option to use
> an extended text format, so it might be a trivial change.
> 

As long as it's not default. One of the most convenient ways to change a
user's UID (or multiple users!) is to do an mtree backup, change
UID/GID, and then re-apply mtree backup. Every file that the user(s)
previously owned will be automatically changed to the new UID/GID for
you :-)
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Re: mtree acl support

2014-01-16 Thread Edward Tomasz Napierała
Wiadomość napisana przez Tim Kientzle w dniu 16 sty 2014, o godz. 06:11:
> On Jan 14, 2014, at 6:47 AM, Mark Felder  wrote:
> 
>> I was recently talking to someone about how one would backup / restore
>> ACLs reliably. I didn't see any mention of ACLs in the mtree man page
>> and after a quick google I came upon this old mailing list post:
>> 
>> http://lists.freebsd.org/pipermail/freebsd-hackers/2008-April/024173.html
>> 
>> patch in list is here: http://heka.cenkes.org/sat/diffs/mtree_acl.diff
>> I've mirrored it here: https://feld.me/freebsd/mtree_acl.diff
>> 
>> This old patch appears to still apply cleanly. I hate to see a patch die
>> and be forgotten.
> 
> One problem that ‘tar’ has addressed (inspired by Joerg Schilling’s
> work on star) is to permit ACLs to be restored even if the user database
> is out of date.
> 
> This is done by including a fourth field in each ACE with the
> numeric user ID.
> 
> I suspect you want to do the same for mtree.  I thought
> I remembered acl_to_text having an option to use
> an extended text format, so it might be a trivial change.

It's ACL_TEXT_APPEND_ID, used with acl_to_text_np(3).  The other side,
acl_from_text(3), already does the right thing when appended IDs are present
in the textual form.

-- 
If you cut off my head, what would I say?  Me and my head, or me and my body?

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Re: mtree acl support

2014-01-15 Thread Tim Kientzle

On Jan 14, 2014, at 6:47 AM, Mark Felder  wrote:

> I was recently talking to someone about how one would backup / restore
> ACLs reliably. I didn't see any mention of ACLs in the mtree man page
> and after a quick google I came upon this old mailing list post:
> 
> http://lists.freebsd.org/pipermail/freebsd-hackers/2008-April/024173.html
> 
> patch in list is here: http://heka.cenkes.org/sat/diffs/mtree_acl.diff
> I've mirrored it here: https://feld.me/freebsd/mtree_acl.diff
> 
> This old patch appears to still apply cleanly. I hate to see a patch die
> and be forgotten.

One problem that ‘tar’ has addressed (inspired by Joerg Schilling’s
work on star) is to permit ACLs to be restored even if the user database
is out of date.

This is done by including a fourth field in each ACE with the
numeric user ID.

I suspect you want to do the same for mtree.  I thought
I remembered acl_to_text having an option to use
an extended text format, so it might be a trivial change.

Tim


___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: mtree acl support

2014-01-15 Thread Tim Kientzle

On Jan 15, 2014, at 9:11 PM, Tim Kientzle  wrote:

> 
> On Jan 14, 2014, at 6:47 AM, Mark Felder  wrote:
> 
>> I was recently talking to someone about how one would backup / restore
>> ACLs reliably. I didn't see any mention of ACLs in the mtree man page
>> and after a quick google I came upon this old mailing list post:
>> 
>> http://lists.freebsd.org/pipermail/freebsd-hackers/2008-April/024173.html
>> 
>> patch in list is here: http://heka.cenkes.org/sat/diffs/mtree_acl.diff
>> I've mirrored it here: https://feld.me/freebsd/mtree_acl.diff
>> 
>> This old patch appears to still apply cleanly. I hate to see a patch die
>> and be forgotten.
> 
> One problem that ‘tar’ has addressed (inspired by Joerg Schilling’s
> work on star) is to permit ACLs to be restored even if the user database
> is out of date.
> 
> This is done by including a fourth field in each ACE with the
> numeric user ID.
> 
> I suspect you want to do the same for mtree.  I thought
> I remembered acl_to_text having an option to use
> an extended text format, so it might be a trivial change.

Also, comparing ACLs using strcmp() seems a little odd to me.

Tim

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


mtree acl support

2014-01-14 Thread Mark Felder
I was recently talking to someone about how one would backup / restore
ACLs reliably. I didn't see any mention of ACLs in the mtree man page
and after a quick google I came upon this old mailing list post:

http://lists.freebsd.org/pipermail/freebsd-hackers/2008-April/024173.html

patch in list is here: http://heka.cenkes.org/sat/diffs/mtree_acl.diff
I've mirrored it here: https://feld.me/freebsd/mtree_acl.diff

This old patch appears to still apply cleanly. I hate to see a patch die
and be forgotten.
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"