Fixed bug introduced in 6.67.02 in gam <UserTypeEntity> claim ownership that caused a trap.

This commit is contained in:
Ross Scroggs
2024-01-02 12:32:13 -08:00
parent 7596215bbe
commit 293e1c1d9a
11 changed files with 49 additions and 16 deletions

View File

@@ -1,3 +1,4 @@
# Update GAMADV-XTD3 to latest version # Update GAMADV-XTD3 to latest version
Automatic update to the latest version on Linux/Mac OS/Google Cloud Shell/Raspberry Pi/ChromeOS: Automatic update to the latest version on Linux/Mac OS/Google Cloud Shell/Raspberry Pi/ChromeOS:
- Do not create project or authorizations, default path `$HOME/bin` - Do not create project or authorizations, default path `$HOME/bin`
@@ -10,6 +11,26 @@ Add the `-s` option to the end of the above commands to suppress creating the `g
See [Downloads](https://github.com/taers232c/GAMADV-XTD3/wiki/Downloads) for Windows or other options, including manual installation See [Downloads](https://github.com/taers232c/GAMADV-XTD3/wiki/Downloads) for Windows or other options, including manual installation
### 6.67.03
Fixed bug introduced in 6.67.02 in `gam <UserTypeEntity> claim ownership` that caused a trap.
### 6.67.02
Added option `skipids <DriveFileEntity>` to `gam <UserTypeEntity> transfer drive` that handles special cases
where you want to prevent ownership from being transferred for selected files/folders.
Added option `skipids <DriveFileEntity>` to `gam <UserTypeEntity> copy drivefile` that handles special cases
where you want to prevent selected files/folders from being copied.
Updated commands that create files/folders on Shared Drives to handle the following errors:
```
storageQuotaExceeded
teamDriveFileLimitExceeded
teamDriveHierarchyTooDeep
```
* See: https://support.google.com/a/users/answer/7338880#shared_drives_file_folder_limits
### 6.67.01 ### 6.67.01
Fixed bug in `gam print vaultcounts` that caused a trap. Fixed bug in `gam print vaultcounts` that caused a trap.

View File

@@ -334,7 +334,7 @@ writes the credentials into the file oauth2.txt.
admin@server:/Users/admin/bin/gamadv-xtd3$ rm -f /Users/admin/GAMConfig/oauth2.txt admin@server:/Users/admin/bin/gamadv-xtd3$ rm -f /Users/admin/GAMConfig/oauth2.txt
admin@server:/Users/admin/bin/gamadv-xtd3$ ./gam version admin@server:/Users/admin/bin/gamadv-xtd3$ ./gam version
WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: /Users/admin/GAMConfig/oauth2.txt, Not Found WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: /Users/admin/GAMConfig/oauth2.txt, Not Found
GAMADV-XTD3 6.67.01 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource GAMADV-XTD3 6.67.03 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.10.8 64-bit final Python 3.10.8 64-bit final
MacOS High Sierra 10.13.6 x86_64 MacOS High Sierra 10.13.6 x86_64
@@ -1002,7 +1002,7 @@ writes the credentials into the file oauth2.txt.
C:\GAMADV-XTD3>del C:\GAMConfig\oauth2.txt C:\GAMADV-XTD3>del C:\GAMConfig\oauth2.txt
C:\GAMADV-XTD3>gam version C:\GAMADV-XTD3>gam version
WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found
GAMADV-XTD3 6.67.01 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource GAMADV-XTD3 6.67.03 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.0 64-bit final Python 3.12.0 64-bit final
Windows-10-10.0.17134 AMD64 Windows-10-10.0.17134 AMD64

View File

@@ -28,6 +28,7 @@
* https://developers.google.com/drive/api/v3/reference/teamdrives/list * https://developers.google.com/drive/api/v3/reference/teamdrives/list
* https://support.google.com/a/answer/7374057 * https://support.google.com/a/answer/7374057
* https://workspaceupdates.googleblog.com/2022/05/shared-drives-in-organizational-units-open-beta.html * https://workspaceupdates.googleblog.com/2022/05/shared-drives-in-organizational-units-open-beta.html
* https://support.google.com/a/users/answer/7338880
## Query documentation ## Query documentation
* https://developers.google.com/drive/api/v3/search-shareddrives * https://developers.google.com/drive/api/v3/search-shareddrives

View File

@@ -16,6 +16,7 @@
## API documentation ## API documentation
* https://developers.google.com/drive/api/v3/reference/files * https://developers.google.com/drive/api/v3/reference/files
* https://support.google.com/a/answer/7374057 * https://support.google.com/a/answer/7374057
* https://support.google.com/a/users/answer/7338880
## Definitions ## Definitions
* [`<DriveFileEntity>`](Drive-File-Selection) * [`<DriveFileEntity>`](Drive-File-Selection)
@@ -66,12 +67,13 @@ gam <UserTypeEntity> copy drivefile <DriveFileEntity>
[summary [<Boolean>]] [showpermissionmessages [<Boolean>]] [summary [<Boolean>]] [showpermissionmessages [<Boolean>]]
[<DriveFileParentAttribute>] [<DriveFileParentAttribute>]
[mergewithparent [<Boolean>]] [recursive [depth <Number>]] [mergewithparent [<Boolean>]] [recursive [depth <Number>]]
<DriveFileCopyAttribute>*
[skipids <DriveFileEntity>]
[copysubfiles [<Boolean>]] [filenamematchpattern <RegularExpression>] [copysubfiles [<Boolean>]] [filenamematchpattern <RegularExpression>]
[filemimetype [not] <MimeTypeList>] [filemimetype [not] <MimeTypeList>]
[copysubfilesownedby any|me|others] [copysubfilesownedby any|me|others]
[copysubfolders [<Boolean>]] [foldernamematchpattern <RegularExpression>] [copysubfolders [<Boolean>]] [foldernamematchpattern <RegularExpression>]
[copysubshortcuts [<Boolean>]] [shortcutnamematchpattern <RegularExpression>] [copysubshortcuts [<Boolean>]] [shortcutnamematchpattern <RegularExpression>]
<DriveFileCopyAttribute>*
[duplicatefiles overwriteolder|overwriteall|duplicatename|uniquename|skip] [duplicatefiles overwriteolder|overwriteall|duplicatename|uniquename|skip]
[duplicatefolders merge|duplicatename|uniquename|skip] [duplicatefolders merge|duplicatename|uniquename|skip]
[copiedshortcutspointtocopiedfiles [<Boolean>]] [copiedshortcutspointtocopiedfiles [<Boolean>]]
@@ -125,6 +127,9 @@ The `depth <Number>` argument controls which files or folders within the top fol
* `depth 0` - the files or folders in the top folder are copied, no descendants of folders are copied. * `depth 0` - the files or folders in the top folder are copied, no descendants of folders are copied.
* `depth N` - the files and folders within the top folder and those files and folders N levels below the top folder are copied. * `depth N` - the files and folders within the top folder and those files and folders N levels below the top folder are copied.
### This option handles special cases where you want to prevent selected files/folders from being copied.
* `skipids <DriveFileEntity>` - Do not copy files/folders with the specified IDs.
### By default, when recursively copying a top folder, all sub files, folders and shortcuts are copied, subject to the `depth` option. ### By default, when recursively copying a top folder, all sub files, folders and shortcuts are copied, subject to the `depth` option.
You can specify whether sub files, folders and shortcuts are copied. If sub folders are not copied, their contents are not copied. You can specify whether sub files, folders and shortcuts are copied. If sub folders are not copied, their contents are not copied.
* `copysubfiles false` - Sub files are not copied * `copysubfiles false` - Sub files are not copied
@@ -203,6 +208,7 @@ In previous versions, copying shortcuts caused an error because shortcuts can't
If a shortcut in the source structure points to a file/folder that is not in the source structure: If a shortcut in the source structure points to a file/folder that is not in the source structure:
* The shortcut is re-created to point to the original file/folder. * The shortcut is re-created to point to the original file/folder.
If a shortcut in the source structure points to a file/folder that is in the source structure: If a shortcut in the source structure points to a file/folder that is in the source structure:
* `copiedshortcutspointtocopiedfiles` omitted or `copiedshortcutspointtocopiedfiles true` - The shortcut is re-created to point to the copied file/folder. * `copiedshortcutspointtocopiedfiles` omitted or `copiedshortcutspointtocopiedfiles true` - The shortcut is re-created to point to the copied file/folder.
* `copiedshortcutspointtocopiedfiles false` - The shortcut is re-created to point to the original file/folder. * `copiedshortcutspointtocopiedfiles false` - The shortcut is re-created to point to the original file/folder.

View File

@@ -27,6 +27,7 @@
* https://developers.google.com/drive/api/v3/shortcuts * https://developers.google.com/drive/api/v3/shortcuts
* https://support.google.com/a/answer/6105699 * https://support.google.com/a/answer/6105699
* https://support.google.com/a/answer/7374057 * https://support.google.com/a/answer/7374057
* https://support.google.com/a/users/answer/7338880
* https://developers.google.com/docs/api/reference/rest * https://developers.google.com/docs/api/reference/rest
## Definitions ## Definitions

View File

@@ -107,9 +107,9 @@ By default, files in the trash are not transferred.
Specify order of file processing. Specify order of file processing.
* `(orderby <DriveOrderByFieldName> [ascending|descending])*` * `(orderby <DriveOrderByFieldName> [ascending|descending])*`
These options handle special cases where you want to prevent ownership from being transferred for selected files. These options handle special cases where you want to prevent ownership from being transferred for selected files/folders.
* `skipids <DriveFileEntity>` - Do not transfer ownership for files with the specified IDs. * `skipids <DriveFileEntity>` - Do not transfer ownership for files/folders with the specified IDs.
* `skipusers <UserTypeEntity>` - Do not transfer ownership for files owned by the specified users. * `skipusers <UserTypeEntity>` - Do not transfer ownership for files/folders owned by the specified users.
By default, only files owned by users in the same domain as the claiming user have their ownership transferred. By default, only files owned by users in the same domain as the claiming user have their ownership transferred.
* `subdomains <DomainNameEntity>` - Transfer ownership for files in the selected sub-domains. * `subdomains <DomainNameEntity>` - Transfer ownership for files in the selected sub-domains.

View File

@@ -37,8 +37,8 @@ gam <UserTypeEntity> transfer drive <UserItem> [select <DriveFileEntity>]
By default, all of the source users files will be transferred except those in the trash. If you want to transfer a subset of By default, all of the source users files will be transferred except those in the trash. If you want to transfer a subset of
the source users files, use the `select <DriveFileEntity>` option. the source users files, use the `select <DriveFileEntity>` option.
This option handles special cases where you want to prevent selected files from being transferred. This option handles special cases where you want to prevent selected files/folders from being transferred.
* `skipids <DriveFileEntity>` - Do not transfer files with the specified IDs. * `skipids <DriveFileEntity>` - Do not transfer files/folders with the specified IDs.
You can specify the access that the source user retains to the files that it owns. You can specify the access that the source user retains to the files that it owns.
If no option is specified, the source user retains no access to the transferred files. If no option is specified, the source user retains no access to the transferred files.

View File

@@ -25,6 +25,7 @@
* https://developers.google.com/drive/v3/web/manage-teamdrives#managing_team_drives_for_domain_administrators * https://developers.google.com/drive/v3/web/manage-teamdrives#managing_team_drives_for_domain_administrators
* https://support.google.com/a/answer/7374057 * https://support.google.com/a/answer/7374057
* https://workspaceupdates.googleblog.com/2022/05/shared-drives-in-organizational-units-open-beta.html * https://workspaceupdates.googleblog.com/2022/05/shared-drives-in-organizational-units-open-beta.html
* https://support.google.com/a/users/answer/7338880
## Query documentation ## Query documentation
* https://developers.google.com/drive/api/v3/search-shareddrives * https://developers.google.com/drive/api/v3/search-shareddrives

View File

@@ -4,7 +4,7 @@
Print the current version of Gam with details Print the current version of Gam with details
``` ```
gam version gam version
GAMADV-XTD3 6.67.01 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource GAMADV-XTD3 6.67.03 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.0 64-bit final Python 3.12.0 64-bit final
MacOS Monterey 12.7 x86_64 MacOS Monterey 12.7 x86_64
@@ -16,7 +16,7 @@ Time: 2023-06-02T21:10:00-07:00
Print the current version of Gam with details and time offset information Print the current version of Gam with details and time offset information
``` ```
gam version timeoffset gam version timeoffset
GAMADV-XTD3 6.67.01 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource GAMADV-XTD3 6.67.03 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.0 64-bit final Python 3.12.0 64-bit final
MacOS Monterey 12.7 x86_64 MacOS Monterey 12.7 x86_64
@@ -28,7 +28,7 @@ Your system time differs from www.googleapis.com by less than 1 second
Print the current version of Gam with extended details and SSL information Print the current version of Gam with extended details and SSL information
``` ```
gam version extended gam version extended
GAMADV-XTD3 6.67.01 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource GAMADV-XTD3 6.67.03 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.0 64-bit final Python 3.12.0 64-bit final
MacOS Monterey 12.7 x86_64 MacOS Monterey 12.7 x86_64
@@ -65,7 +65,7 @@ MacOS High Sierra 10.13.6 x86_64
Path: /Users/Admin/bin/gamadv-xtd3 Path: /Users/Admin/bin/gamadv-xtd3
Version Check: Version Check:
Current: 5.35.08 Current: 5.35.08
Latest: 6.67.01 Latest: 6.67.03
echo $? echo $?
1 1
``` ```
@@ -73,7 +73,7 @@ echo $?
Print the current version number without details Print the current version number without details
``` ```
gam version simple gam version simple
6.67.01 6.67.03
``` ```
In Linux/MacOS you can do: In Linux/MacOS you can do:
``` ```
@@ -83,7 +83,7 @@ echo $VER
Print the current version of Gam and address of this Wiki Print the current version of Gam and address of this Wiki
``` ```
gam help gam help
GAM 6.67.01 - https://github.com/taers232c/GAMADV-XTD3 GAM 6.67.03 - https://github.com/taers232c/GAMADV-XTD3
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.0 64-bit final Python 3.12.0 64-bit final
MacOS Monterey 12.7 x86_64 MacOS Monterey 12.7 x86_64

View File

@@ -2,6 +2,10 @@
Merged GAM-Team version Merged GAM-Team version
6.67.03
Fixed bug introduced in 6.67.02 in `gam <UserTypeEntity> claim ownership` that caused a trap.
6.67.02 6.67.02
Added option `skipids <DriveFileEntity>` to `gam <UserTypeEntity> copy drivefile` that handles special cases Added option `skipids <DriveFileEntity>` to `gam <UserTypeEntity> copy drivefile` that handles special cases

View File

@@ -57198,7 +57198,6 @@ def moveDriveFile(users):
i, count, users = getEntityArgument(users) i, count, users = getEntityArgument(users)
for user in users: for user in users:
i += 1 i += 1
origUser = user
user, drive, jcount = _validateUserGetFileIDs(user, i, count, fileIdEntity, entityType=Ent.DRIVE_FILE_OR_FOLDER) user, drive, jcount = _validateUserGetFileIDs(user, i, count, fileIdEntity, entityType=Ent.DRIVE_FILE_OR_FOLDER)
if jcount == 0: if jcount == 0:
continue continue
@@ -59257,7 +59256,7 @@ def claimOwnership(users):
for fileId in fileIdEntity['list']: for fileId in fileIdEntity['list']:
j += 1 j += 1
filesToClaim = {} filesToClaim = {}
kVlist = [Ent.USER, user, Ent.DRIVE_FILE_OR_FOLDER, fileId] kvList = [Ent.USER, user, Ent.DRIVE_FILE_OR_FOLDER, fileId]
if buildTree: if buildTree:
fileEntry = fileTree.get(fileId) fileEntry = fileTree.get(fileId)
if not fileEntry: if not fileEntry: