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

Re: [MiNT] [PATCH] symlink attributes on ramfs



very useful, thankyou, ta for the explanation too

2011/12/9 Vincent Rivière <vincent.riviere@freesbee.fr>:
> Hello.
>
> Some people noticed that tar 1.26 was unable to create an archive from
> symlinks stored on FreeMiNT's ramdisk. It failed with "Range error".
>
> After investigation, this problem comes from tar's src/create.c, in function
> dump_file0():
>      size_t linklen = st->stat.st_size;
>      ...
>      buffer = (char *) alloca (linklen + 1);
>      size = readlinkat (parentfd, name, buffer, linklen + 1);
>
> Actually, stat.st_size was always 0 for symlinks stored on /ram, while it
> should be the length of the target. This can be easily verified using the ls
> -l command and looking at the size of the symlinks.
>
> Additionally, the permissions of the ramdisk symlinks were l--------- while
> they should be lrwxrwxrwx. There was no trouble with that, but this was
> ugly.
>
> I fixed both issues.
>
> Alan or Helmut, please commit in the FreeMiNT tree!
>
> statram.patch
> Fixed file size and permissions of symlinks stored on ramfs. Contributed by
> Vincent Riviere.
>
> --
> Vincent Rivière