#1068700 file: wrong MIME type for RAR files

Package:
file
Source:
file
Description:
Recognize the type of data in a file using "magic" numbers
Submitter:
Date:
2025-02-09 13:30:01 UTC
Severity:
normal
Tags:
#1068700#5
Date:
2024-04-09 12:37:15 UTC
From:
To:
Dear Maintainer,

`file -i archive.rar` currently reports a MIME type of: application/x-rar

However, according to sources like https://www.iana.org/assignments/media-types/application/vnd.rar

the correct MIME type should be application/vnd.rar

and the deprecated MIME type was application/x-rar-compressed

It has never been application/x-rar as far as I can tell.

#1068700#10
Date:
2025-02-07 14:19:43 UTC
From:
To:
Dear Maintainer,

this has now led to actual breakage on one system, because `file`
outputs the MIME type differently to other tools.

For illustration:

```
$ python3 -c 'import mimetypes; print(mimetypes.guess_extension("application/x-rar-compressed"))'
None
```

```
$ python3 -c 'import mimetypes; print(mimetypes.guess_extension("application/x-rar"))'
None
```

```
$ python3 -c 'import mimetypes; print(mimetypes.guess_extension("application/vnd.rar"))'
.rar
```

```
$ python3 -c 'import mimetypes; mimetypes.init(); print(mimetypes.types_map[".rar"])'
application/vnd.rar
```

Please try to make `file` output the MIME type as application/vnd.rar in
time for debian trixie.

Thank you.

#1068700#15
Date:
2025-02-07 14:29:59 UTC
From:
To:
also

```
$ grep rar /etc/mime.types
application/vnd.comicbook-rar                   cbr
application/vnd.rar                             rar
```

#1068700#20
Date:
2025-02-09 13:19:07 UTC
From:
To:
cacin@allfreemail.net wrote...

Fixed upstream a while ago, will be part of the next upload.

Regards,

    Christoph