Skip to content

Commit

Permalink
Fixed bug introduced in 6.67.02 in `gam <UserTypeEntity> claim owners…
Browse files Browse the repository at this point in the history
…hip` that caused a trap.
  • Loading branch information
taers232c committed Jan 2, 2024
1 parent 7596215 commit 293e1c1
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 16 deletions.
21 changes: 21 additions & 0 deletions docs/GamUpdates.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

# Update GAMADV-XTD3 to latest version
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`
Expand All @@ -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

### 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

Fixed bug in `gam print vaultcounts` that caused a trap.
Expand Down
4 changes: 2 additions & 2 deletions docs/How-to-Upgrade-from-Standard-GAM.md
Original file line number Diff line number Diff line change
Expand Up @@ -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$ ./gam version
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>
Python 3.10.8 64-bit final
MacOS High Sierra 10.13.6 x86_64
Expand Down Expand Up @@ -1002,7 +1002,7 @@ writes the credentials into the file oauth2.txt.
C:\GAMADV-XTD3>del C:\GAMConfig\oauth2.txt
C:\GAMADV-XTD3>gam version
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>
Python 3.12.0 64-bit final
Windows-10-10.0.17134 AMD64
Expand Down
1 change: 1 addition & 0 deletions docs/Shared-Drives.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
* https://developers.google.com/drive/api/v3/reference/teamdrives/list
* https://support.google.com/a/answer/7374057
* https://workspaceupdates.googleblog.com/2022/05/shared-drives-in-organizational-units-open-beta.html
* https://support.google.com/a/users/answer/7338880

## Query documentation
* https://developers.google.com/drive/api/v3/search-shareddrives
Expand Down
8 changes: 7 additions & 1 deletion docs/Users-Drive-Copy-Move.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
## API documentation
* https://developers.google.com/drive/api/v3/reference/files
* https://support.google.com/a/answer/7374057
* https://support.google.com/a/users/answer/7338880

## Definitions
* [`<DriveFileEntity>`](Drive-File-Selection)
Expand Down Expand Up @@ -66,12 +67,13 @@ gam <UserTypeEntity> copy drivefile <DriveFileEntity>
[summary [<Boolean>]] [showpermissionmessages [<Boolean>]]
[<DriveFileParentAttribute>]
[mergewithparent [<Boolean>]] [recursive [depth <Number>]]
<DriveFileCopyAttribute>*
[skipids <DriveFileEntity>]
[copysubfiles [<Boolean>]] [filenamematchpattern <RegularExpression>]
[filemimetype [not] <MimeTypeList>]
[copysubfilesownedby any|me|others]
[copysubfolders [<Boolean>]] [foldernamematchpattern <RegularExpression>]
[copysubshortcuts [<Boolean>]] [shortcutnamematchpattern <RegularExpression>]
<DriveFileCopyAttribute>*
[duplicatefiles overwriteolder|overwriteall|duplicatename|uniquename|skip]
[duplicatefolders merge|duplicatename|uniquename|skip]
[copiedshortcutspointtocopiedfiles [<Boolean>]]
Expand Down Expand Up @@ -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 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.
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
Expand Down Expand Up @@ -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:
* 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:
* `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.
Expand Down
1 change: 1 addition & 0 deletions docs/Users-Drive-Files-Manage.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* https://developers.google.com/drive/api/v3/shortcuts
* https://support.google.com/a/answer/6105699
* https://support.google.com/a/answer/7374057
* https://support.google.com/a/users/answer/7338880
* https://developers.google.com/docs/api/reference/rest

## Definitions
Expand Down
6 changes: 3 additions & 3 deletions docs/Users-Drive-Ownership.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ By default, files in the trash are not transferred.
Specify order of file processing.
* `(orderby <DriveOrderByFieldName> [ascending|descending])*`

These options handle special cases where you want to prevent ownership from being transferred for selected files.
* `skipids <DriveFileEntity>` - Do not transfer ownership for files with the specified IDs.
* `skipusers <UserTypeEntity>` - Do not transfer ownership for files owned by the specified users.
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/folders with the specified IDs.
* `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.
* `subdomains <DomainNameEntity>` - Transfer ownership for files in the selected sub-domains.
Expand Down
4 changes: 2 additions & 2 deletions docs/Users-Drive-Transfer.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
the source users files, use the `select <DriveFileEntity>` option.

This option handles special cases where you want to prevent selected files from being transferred.
* `skipids <DriveFileEntity>` - Do not transfer files with the specified IDs.
This option handles special cases where you want to prevent selected files/folders from being transferred.
* `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.
If no option is specified, the source user retains no access to the transferred files.
Expand Down
1 change: 1 addition & 0 deletions docs/Users-Shared-Drives.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* https://developers.google.com/drive/v3/web/manage-teamdrives#managing_team_drives_for_domain_administrators
* https://support.google.com/a/answer/7374057
* https://workspaceupdates.googleblog.com/2022/05/shared-drives-in-organizational-units-open-beta.html
* https://support.google.com/a/users/answer/7338880

## Query documentation
* https://developers.google.com/drive/api/v3/search-shareddrives
Expand Down
12 changes: 6 additions & 6 deletions docs/Version-and-Help.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Print the current version of Gam with details
```
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>
Python 3.12.0 64-bit final
MacOS Monterey 12.7 x86_64
Expand All @@ -16,7 +16,7 @@ Time: 2023-06-02T21:10:00-07:00
Print the current version of Gam with details and time offset information
```
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>
Python 3.12.0 64-bit final
MacOS Monterey 12.7 x86_64
Expand All @@ -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
```
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>
Python 3.12.0 64-bit final
MacOS Monterey 12.7 x86_64
Expand Down Expand Up @@ -65,15 +65,15 @@ MacOS High Sierra 10.13.6 x86_64
Path: /Users/Admin/bin/gamadv-xtd3
Version Check:
Current: 5.35.08
Latest: 6.67.01
Latest: 6.67.03
echo $?
1
```

Print the current version number without details
```
gam version simple
6.67.01
6.67.03
```
In Linux/MacOS you can do:
```
Expand All @@ -83,7 +83,7 @@ echo $VER
Print the current version of Gam and address of this Wiki
```
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>
Python 3.12.0 64-bit final
MacOS Monterey 12.7 x86_64
Expand Down
4 changes: 4 additions & 0 deletions src/GamUpdate.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

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

Added option `skipids <DriveFileEntity>` to `gam <UserTypeEntity> copy drivefile` that handles special cases
Expand Down
3 changes: 1 addition & 2 deletions src/gam/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57198,7 +57198,6 @@ def anyFolderPermissionOperations():
i, count, users = getEntityArgument(users)
for user in users:
i += 1
origUser = user
user, drive, jcount = _validateUserGetFileIDs(user, i, count, fileIdEntity, entityType=Ent.DRIVE_FILE_OR_FOLDER)
if jcount == 0:
continue
Expand Down Expand Up @@ -59257,7 +59256,7 @@ def _processRetainedRole(user, i, count, oldOwner, entityType, ofileId, fileDesc
for fileId in fileIdEntity['list']:
j += 1
filesToClaim = {}
kVlist = [Ent.USER, user, Ent.DRIVE_FILE_OR_FOLDER, fileId]
kvList = [Ent.USER, user, Ent.DRIVE_FILE_OR_FOLDER, fileId]
if buildTree:
fileEntry = fileTree.get(fileId)
if not fileEntry:
Expand Down

0 comments on commit 293e1c1

Please sign in to comment.