From 563da005dc0099c95bbfd532fe6f82f26d4ad7c7 Mon Sep 17 00:00:00 2001 From: Tommy Nguyen Date: Wed, 18 Aug 2021 00:39:36 -0400 Subject: [PATCH 1/6] docs: clarify user_id vs uid for fuse Fixes: #5723 --- docs/usage/mount.rst.inc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/usage/mount.rst.inc b/docs/usage/mount.rst.inc index bcf7358bfe..29a819bff5 100644 --- a/docs/usage/mount.rst.inc +++ b/docs/usage/mount.rst.inc @@ -124,6 +124,16 @@ To allow a regular user to use fstab entries, add the ``user`` option: For FUSE configuration and mount options, see the mount.fuse(8) manual page. +The man page references ``user_id`` and ``uid``, which are not the same thing. +``user_id`` is set by libfuse (or the filesystem) and contains the effective +user id of the mount owner. ``uid`` on the other hand refers to the actual +owner of the file. While you can pass ``uid`` as a mount option to borg to +change the owner of all of the files (i.e, ``borg mount -o uid=1000,gid=1000``) +it is recommended you use the ``--numeric-ids`` switch instead. + +``numeric-ids`` will use the ``uid``s and ``gid``s from the archive instead of +attempting to map username and groupnames to local ids. + Additional mount options supported by borg: - versions: when used with a repository mount, this gives a merged, versioned @@ -145,4 +155,4 @@ Unmounting in these cases could cause an active rsync or similar process to unintentionally delete data. When running in the foreground ^C/SIGINT unmounts cleanly, but other -signals or crashes do not. \ No newline at end of file +signals or crashes do not. From 4e26e174f3fea2727519f6514f2b467a9379b1c6 Mon Sep 17 00:00:00 2001 From: Tommy Nguyen Date: Wed, 18 Aug 2021 20:27:47 -0400 Subject: [PATCH 2/6] Revert "docs: clarify user_id vs uid for fuse" This reverts commit 563da005dc0099c95bbfd532fe6f82f26d4ad7c7. --- docs/usage/mount.rst.inc | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/docs/usage/mount.rst.inc b/docs/usage/mount.rst.inc index 29a819bff5..bcf7358bfe 100644 --- a/docs/usage/mount.rst.inc +++ b/docs/usage/mount.rst.inc @@ -124,16 +124,6 @@ To allow a regular user to use fstab entries, add the ``user`` option: For FUSE configuration and mount options, see the mount.fuse(8) manual page. -The man page references ``user_id`` and ``uid``, which are not the same thing. -``user_id`` is set by libfuse (or the filesystem) and contains the effective -user id of the mount owner. ``uid`` on the other hand refers to the actual -owner of the file. While you can pass ``uid`` as a mount option to borg to -change the owner of all of the files (i.e, ``borg mount -o uid=1000,gid=1000``) -it is recommended you use the ``--numeric-ids`` switch instead. - -``numeric-ids`` will use the ``uid``s and ``gid``s from the archive instead of -attempting to map username and groupnames to local ids. - Additional mount options supported by borg: - versions: when used with a repository mount, this gives a merged, versioned @@ -155,4 +145,4 @@ Unmounting in these cases could cause an active rsync or similar process to unintentionally delete data. When running in the foreground ^C/SIGINT unmounts cleanly, but other -signals or crashes do not. +signals or crashes do not. \ No newline at end of file From de3652c782aaf56fa761fc25b5ddd70bc4eb950f Mon Sep 17 00:00:00 2001 From: Tommy Nguyen Date: Wed, 18 Aug 2021 20:29:17 -0400 Subject: [PATCH 3/6] Address review comments. --- src/borg/archiver.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/borg/archiver.py b/src/borg/archiver.py index 393fe7b834..a73dc4df08 100644 --- a/src/borg/archiver.py +++ b/src/borg/archiver.py @@ -2916,6 +2916,17 @@ def define_borg_mount(parser): For FUSE configuration and mount options, see the mount.fuse(8) manual page. + The man page references ``user_id`` and ``uid``, which are not the same + thing. ``user_id`` is set by libfuse (or the filesystem) and contains + the effective user id of the mount owner. ``uid`` on the other hand + refers to the actual owner of the file. While you can pass ``uid`` as a + mount option to borg to change the owner of all of the files (i.e, + ``borg mount -o uid=1000,gid=1000``) you can use the ``--numeric-ids`` + switch instead. + + ``numeric-ids`` will use the ``uid``s and ``gid``s from the archive + instead of attempting to map username and groupnames to local ids. + Additional mount options supported by borg: - versions: when used with a repository mount, this gives a merged, versioned From 128cccd84071dfd6d51e58ebd4de58acfadf4e98 Mon Sep 17 00:00:00 2001 From: Tommy Nguyen Date: Thu, 19 Aug 2021 21:25:51 -0400 Subject: [PATCH 4/6] Add additional clarity. --- src/borg/archiver.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/borg/archiver.py b/src/borg/archiver.py index a73dc4df08..271ac43fbf 100644 --- a/src/borg/archiver.py +++ b/src/borg/archiver.py @@ -2916,16 +2916,19 @@ def define_borg_mount(parser): For FUSE configuration and mount options, see the mount.fuse(8) manual page. - The man page references ``user_id`` and ``uid``, which are not the same - thing. ``user_id`` is set by libfuse (or the filesystem) and contains - the effective user id of the mount owner. ``uid`` on the other hand - refers to the actual owner of the file. While you can pass ``uid`` as a - mount option to borg to change the owner of all of the files (i.e, - ``borg mount -o uid=1000,gid=1000``) you can use the ``--numeric-ids`` - switch instead. - - ``numeric-ids`` will use the ``uid``s and ``gid``s from the archive - instead of attempting to map username and groupnames to local ids. + Borg's default behavior is use the archived user and group names of each file + and map them to the system's respective user and group ids. Alternatively, using + ``numeric-ids`` will instead used the archived user and group ids without any + mapping. + + The ``uid`` and ``gid`` mount options (implemented by Borg) can be used to + override the user and group ids of all files (i.e, ``borg mount -o + uid=1000,gid=1000``). + + The man page references ``user_id`` and ``group_id`` mount options (implemented + by fuse) which specify the user and group id of the mount owner (aka, the user + who does the mounting). It is set automatically by libfuse (or the filesystem if + libfuse is not used). However, you should not specify these manually. Additional mount options supported by borg: From 324c99a69a5216cff8cadc1082318806f25225fe Mon Sep 17 00:00:00 2001 From: Tommy Nguyen Date: Tue, 24 Aug 2021 16:30:46 -0400 Subject: [PATCH 5/6] Fix typos. Add clarity. --- src/borg/archiver.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/borg/archiver.py b/src/borg/archiver.py index 271ac43fbf..cb359cba24 100644 --- a/src/borg/archiver.py +++ b/src/borg/archiver.py @@ -2916,19 +2916,22 @@ def define_borg_mount(parser): For FUSE configuration and mount options, see the mount.fuse(8) manual page. - Borg's default behavior is use the archived user and group names of each file - and map them to the system's respective user and group ids. Alternatively, using - ``numeric-ids`` will instead used the archived user and group ids without any - mapping. + Borg's default behavior is to use the archived user and group names of + each file and map them to the system's respective user and group ids. + Alternatively, using ``numeric-ids`` will instead use the archived user + and group ids without any mapping. - The ``uid`` and ``gid`` mount options (implemented by Borg) can be used to - override the user and group ids of all files (i.e, ``borg mount -o + The ``uid`` and ``gid`` mount options (implemented by Borg) can be used + to override the user and group ids of all files (i.e., ``borg mount -o uid=1000,gid=1000``). - The man page references ``user_id`` and ``group_id`` mount options (implemented - by fuse) which specify the user and group id of the mount owner (aka, the user - who does the mounting). It is set automatically by libfuse (or the filesystem if - libfuse is not used). However, you should not specify these manually. + The man page references ``user_id`` and ``group_id`` mount options + (implemented by fuse) which specify the user and group id of the mount + owner (aka, the user who does the mounting). It is set automatically by + libfuse (or the filesystem if libfuse is not used). However, you should + not specify these manually. Unlike the ``uid`` and ``gid`` mount + options which affect all files, ``user_id`` and ``group_id`` affect the + user and group id of the mounted (base) directory. Additional mount options supported by borg: From 5d6e9c84b631c1aef178b96d4fa410812e549937 Mon Sep 17 00:00:00 2001 From: Tommy Nguyen Date: Tue, 24 Aug 2021 16:33:21 -0400 Subject: [PATCH 6/6] Fix text width. --- src/borg/archiver.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/borg/archiver.py b/src/borg/archiver.py index cb359cba24..a5acd6d0a6 100644 --- a/src/borg/archiver.py +++ b/src/borg/archiver.py @@ -2916,22 +2916,22 @@ def define_borg_mount(parser): For FUSE configuration and mount options, see the mount.fuse(8) manual page. - Borg's default behavior is to use the archived user and group names of - each file and map them to the system's respective user and group ids. - Alternatively, using ``numeric-ids`` will instead use the archived user - and group ids without any mapping. + Borg's default behavior is to use the archived user and group names of each + file and map them to the system's respective user and group ids. + Alternatively, using ``numeric-ids`` will instead use the archived user and + group ids without any mapping. - The ``uid`` and ``gid`` mount options (implemented by Borg) can be used - to override the user and group ids of all files (i.e., ``borg mount -o + The ``uid`` and ``gid`` mount options (implemented by Borg) can be used to + override the user and group ids of all files (i.e., ``borg mount -o uid=1000,gid=1000``). The man page references ``user_id`` and ``group_id`` mount options - (implemented by fuse) which specify the user and group id of the mount - owner (aka, the user who does the mounting). It is set automatically by - libfuse (or the filesystem if libfuse is not used). However, you should - not specify these manually. Unlike the ``uid`` and ``gid`` mount - options which affect all files, ``user_id`` and ``group_id`` affect the - user and group id of the mounted (base) directory. + (implemented by fuse) which specify the user and group id of the mount owner + (aka, the user who does the mounting). It is set automatically by libfuse (or + the filesystem if libfuse is not used). However, you should not specify these + manually. Unlike the ``uid`` and ``gid`` mount options which affect all files, + ``user_id`` and ``group_id`` affect the user and group id of the mounted + (base) directory. Additional mount options supported by borg: