przemoc / metastore

Store and restore metadata from a filesystem.
http://software.przemoc.net/#metastore
GNU General Public License v2.0
174 stars 31 forks source link

metastore -s fails with SIGABRT if necessary permissions are missing #38

Closed krichter722 closed 8 years ago

krichter722 commented 9 years ago

Steps to reproduce:

$ sudo mkdir /tmp/a
$ sudo chown root:root /tmp/a
$ sudo chmod 0700 /tmp/a
$ metastore -s /tmp/a/
getxattr failed for /tmp/a: Permission denied
*** Error in `metastore': free(): invalid pointer: 0x00007f40897e8c58 ***
Abgebrochen (Speicherabzug geschrieben)

experienced with f1e4842

przemoc commented 9 years ago

Thanks for the report, but repeating these steps does not lead to above mentioned error in my case. I simply get.

opendir failed for /tmp/a: Permission denied

I'll surely investigate it later, but could you provide some info about your setup?

dfandrich commented 8 years ago

I was able to reproduce this using the following steps:

mkdir /tmp/a
touch /tmp/a/foo
setfattr -n user.foo -v foo /tmp/a/foo           
chmod 000 /tmp/a/foo
metastore -s /tmp/a/
#0  0x00007ffff784d627 in raise () from /lib64/libc.so.6
#1  0x00007ffff784edba in abort () from /lib64/libc.so.6
#2  0x00007ffff788c423 in __libc_message () from /lib64/libc.so.6
#3  0x00007ffff7894158 in _int_free () from /lib64/libc.so.6
#4  0x00007ffff7897828 in free () from /lib64/libc.so.6
#5  0x0000000000402c00 in mentry_free (m=0x60b5e0) at ./src/metaentry.c:57
#6  0x0000000000403008 in mentry_create (path=0x7fffffffc860 "/var/tmp/d/foo") at ./src/metaentry.c:282
#7  0x00000000004030cf in mentries_recurse (path=0x1ca7 <error: Cannot access memory at address 0x1ca7>, 
    mhash=0x1ca7, st=0x6) at ./src/metaentry.c:336
#8  0x00000000004031c3 in mentries_recurse (path=0x1ca7 <error: Cannot access memory at address 0x1ca7>, 
    path@entry=0x608020 "/var/tmp/d", mhash=0x1ca7, st=0x6, st@entry=0x606400 <settings>)
    at ./src/metaentry.c:357
#9  0x000000000040329c in mentries_recurse_path (opath=<optimized out>, mhash=0x7fffffffd8d0, 
    st=0x606400 <settings>) at ./src/metaentry.c:372
#10 0x00000000004017ea in main (argc=3, argv=0x7fffffffd9f8) at ./src/metastore.c:522
przemoc commented 8 years ago

Thank you, @dfandrich, for refined reproduction steps. I'll look into it this week.