1
1

* vfs/tar.c (OLDGNU_MAGIC): New macro definition.

(TMAGIC): Set to the ustar format magic. It was erronously set to the gnu
format magic value.
(tar_fill_stat): Try to use the `uname' and `gname' fields if operating on
either ustar or gnu archive.
Этот коммит содержится в:
Pavel Tsekov 2006-04-14 13:28:09 +00:00
родитель b1069b32eb
Коммит 488ac0c5f9
2 изменённых файлов: 15 добавлений и 2 удалений

Просмотреть файл

@ -1,3 +1,11 @@
2006-04-14 Pavel Tsekov <ptsekov@gmx.net>
* tar.c (OLDGNU_MAGIC): New macro definition.
(TMAGIC): Set to the ustar format magic. It was erronously set
to the gnu format magic value.
(tar_fill_stat): Try to use the `uname' and `gname' fields if
operating on either ustar or gnu archive.
2006-04-04 Pavel Tsekov <ptsekov@gmx.net>
* sfs.c (sfs_uptodate): Eliminate - it is a noop.

Просмотреть файл

@ -105,7 +105,8 @@ union record {
#define CHKBLANKS " " /* 8 blanks, no null */
/* The magic field is filled with this if uname and gname are valid. */
#define TMAGIC "ustar " /* 7 chars and a null */
#define TMAGIC "ustar" /* ustar and a null */
#define OLDGNU_MAGIC "ustar " /* 7 chars and a null */
/* The linkflag defines the type of file */
#define LF_OLDNORMAL '\0' /* Normal disk file, Unix compat */
@ -287,8 +288,12 @@ static void
tar_fill_stat (struct vfs_class *me, struct stat *st, union record *header,
size_t h_size)
{
int is_gnu;
(void) me;
is_gnu = !strcmp (header->header.magic, OLDGNU_MAGIC);
st->st_mode = tar_from_oct (8, header->header.mode);
/* Adjust st->st_mode because there are tar-files with
@ -310,7 +315,7 @@ tar_fill_stat (struct vfs_class *me, struct stat *st, union record *header,
st->st_mode |= S_IFREG;
st->st_rdev = 0;
if (!strcmp (header->header.magic, TMAGIC)) {
if (!strcmp (header->header.magic, TMAGIC) || is_gnu != 0) {
st->st_uid =
*header->header.uname ? vfs_finduid (header->header.
uname) : tar_from_oct (8,