@@ -3918,33 +3918,35 @@ class SyncEngine {
3918
3918
displayFunctionProcessingStart(thisFunctionName, logKey);
3919
3919
}
3920
3920
3921
- // This function will write the following xattr attributes based on the JSON data received from Microsoft onedrive
3922
- // - createdBy using the 'displayName' value
3923
- // - lastModifiedBy using the 'displayName' value
3924
-
3925
- string createdBy;
3926
- string lastModifiedBy;
3927
-
3928
- // Configure 'createdBy' from the JSON data
3929
- if (hasCreatedByUserDisplayName(onedriveJSONItem)) {
3930
- createdBy = onedriveJSONItem["createdBy"]["user"]["displayName"].str;
3931
- } else {
3932
- // required data not in JSON data
3933
- createdBy = "Unknown";
3934
- }
3935
-
3936
- // Configure 'lastModifiedBy' from the JSON data
3937
- if (hasLastModifiedByUserDisplayName(onedriveJSONItem)) {
3938
- lastModifiedBy = onedriveJSONItem["lastModifiedBy"]["user"]["displayName"].str;
3939
- } else {
3940
- // required data not in JSON data
3941
- lastModifiedBy = "Unknown";
3921
+ // We can only set xattr values when not performing a --dry-run operation
3922
+ if (!dryRun) {
3923
+ // This function will write the following xattr attributes based on the JSON data received from Microsoft onedrive
3924
+ // - createdBy using the 'displayName' value
3925
+ // - lastModifiedBy using the 'displayName' value
3926
+ string createdBy;
3927
+ string lastModifiedBy;
3928
+
3929
+ // Configure 'createdBy' from the JSON data
3930
+ if (hasCreatedByUserDisplayName(onedriveJSONItem)) {
3931
+ createdBy = onedriveJSONItem["createdBy"]["user"]["displayName"].str;
3932
+ } else {
3933
+ // required data not in JSON data
3934
+ createdBy = "Unknown";
3935
+ }
3936
+
3937
+ // Configure 'lastModifiedBy' from the JSON data
3938
+ if (hasLastModifiedByUserDisplayName(onedriveJSONItem)) {
3939
+ lastModifiedBy = onedriveJSONItem["lastModifiedBy"]["user"]["displayName"].str;
3940
+ } else {
3941
+ // required data not in JSON data
3942
+ lastModifiedBy = "Unknown";
3943
+ }
3944
+
3945
+ // Set the xattr values
3946
+ setXAttr(filePath, "user.onedrive.createdBy", createdBy);
3947
+ setXAttr(filePath, "user.onedrive.lastModifiedBy", lastModifiedBy);
3942
3948
}
3943
3949
3944
- // Set the xattr values
3945
- setXAttr(filePath, "user.onedrive.createdBy", createdBy);
3946
- setXAttr(filePath, "user.onedrive.lastModifiedBy", lastModifiedBy);
3947
-
3948
3950
// Display function processing time if configured to do so
3949
3951
if (appConfig.getValueBool("display_processing_time") && debugLogging) {
3950
3952
// Combine module name & running Function
0 commit comments