The .tar
format most commonly used by Linux stores user/group in the metadata.
The most common use formats are tar, 7-Zip, and zip formats for archiving.
The .7z
format and the .zip
format does not natively store Unix-style user and group ownership information in the same way that the tar format does as they focus primarily on compression. They only show the user/group of the user that extracted them not the author/user of the person that made the archive.
This is a privacy risk that users may not be aware of when using FileRoller to make an archive in the .tar
formats.
tar format stores your user and its group in the archive.
Make an archive with tar (or find one) then extract it like this:
tar -zvtf archive-name.tar.gz | head -n 10
The output will look like something like this:
-rw-r--r-- frank/volunteer 290 2023-09-11 03:10 file1
-rw-r--r-- joseph/volunteer 23558 2024-07-30 11:45 file2
-rw-r--r-- bob/admin 10958 2024-07-30 12:54 file3
-rw-r--r-- shelia/staff 110 2023-07-04 11:45 file4
--owner="user" --group="user"
will mitigate this regardless of what the user logged in as is when creating a archive with tar.
I don’t have access to the GNOME gitlab nor do I know much code but it would be greatly beneficial to add such an option to set the user group with a GNOME Schema setting/s.
The best option for a privacy based setting would be to set the user and group to user/user
when creating archives in the tar format so this setting would call those options when creating a tar based archive.
Heres are some schema settings that could point to this feature:
- Example schema 1
gsettings set org.gnome.file-roller.archive-creation default-user "user"
gsettings set org.gnome.file-roller.archive-creation default-group "user"
gsettings set org.gnome.file-roller.archive-creation preserve-ownership "false"
<schemalist>
<schema id="org.gnome.file-roller.archive-creation" path="/org/gnome/file-roller/archive-creation/">
<key name="default-user" type="s">
<default value=""/>
<summary>Default user for created archives</summary>
<description>The username to set for files in newly created archives. Ignored if preserve-ownership is true.</description>
</key>
<key name="default-group" type="s">
<default value=""/>
<summary>Default group for created archives</summary>
<description>The group name to set for files in newly created archives. Ignored if preserve-ownership is true.</description>
</key>
<key name="preserve-ownership" type="b">
<default value="false"/>
<summary>Preserve user and group ownership</summary>
<description>Whether to preserve user and group ownership when creating archives. If true, default-user and default-group are ignored.</description>
</key>
</schema>
</schemalist>
- Example schema 2
gsettings set org.gnome.file-roller.archive-creation privacy "true"
gsettings set org.gnome.file-roller.archive-creation preserve-ownership "false"
<schemalist>
<schema id="org.gnome.file-roller.archive-creation" path="/org/gnome/file-roller/archive-creation/">
<key name="default-user" type="s">
<default value=""/>
<summary>Default user for created archives</summary>
<description>Username for files in newly created archives. Set to 'user' if privacy is true.</description>
</key>
<key name="default-group" type="s">
<default value=""/>
<summary>Default group for created archives</summary>
<description>Group name for files in newly created archives. Set to 'user' if privacy is true.</description>
</key>
<key name="privacy" type="b">
<default value="false"/>
<summary>Enable privacy mode</summary>
<description>Automatically sets default-user and default-group to 'user' when true. Ignored if preserve-ownership is true.</description>
</key>
<key name="preserve-ownership" type="b">
<default value="false"/>
<summary>Preserve user and group ownership</summary>
<description>Preserves ownership when creating archives. If true, default-user and default-group are ignored.</description>
</key>
</schema>
</schemalist>