bug-xorriso
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-xorriso] bug with handling symbolic links?


From: Thomas Schmitt
Subject: Re: [Bug-xorriso] bug with handling symbolic links?
Date: Mon, 09 Mar 2015 14:03:55 +0100

Hi,

> >  getfattr -d fattr_xxl.txt

> It's lexicographically ordered by the attribute number...

Probably getfattr sorts its result before printing.

Here is a sketch which shows how libisofs inquires
the attribute name list of a file in a mounted Linux
filesystem.
Store the text between the "---...---" lines as file
listxattr.c and execute

  cc -g -Wall -o listxattr listxattr.c

to get the binary for

  ./listxattr ...somewhere.../fattr_xxl.txt

----------------------------------------------------------------------

#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <attr/xattr.h>

int main(int argc, char **argv)
{
 char *list= NULL;
 ssize_t list_size= 0;
 int i;

 if(argc < 2) {
   fprintf(stderr, "usage: %s filepath\n", argv[0]);
   exit(1);
 }
   
 list_size= listxattr(argv[1], list, 0);
 if(list_size == -1) {
   perror("listxattr()");
   exit(2);
 }
 if(list_size <= 0)
   exit(0); /* ok, no attributes are attached to path */

 list= calloc(list_size, 1);
 list_size= listxattr(argv[1], list, list_size);
 if(list_size == -1) {
   perror("listxattr()");
   exit(3);
 }
 for(i= 0; i < list_size; i+= strlen(list + i) + 1)
   printf("%s\n", list + i);

 exit(0);
}

----------------------------------------------------------------------

I expect that you get to see an garbled sequence of names.


Have a nice day :)

Thomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]