Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Do not fail to get internal path on NonExistingFile #47581

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

juliusknorr
Copy link
Member

@juliusknorr juliusknorr commented Aug 28, 2024

Follow up to:

Summary

If we cannot get the internal path from the file info (e.g. when creating a new file), but we can obtain it from the parent node through the mountpoint.

Fixes errors log spam when creating a new file and having admin_audit enabled when being called in

'path' => mb_substr($node->getInternalPath(), 5),

@juliusknorr juliusknorr requested review from nickvergessen, icewind1991, a team, artonge and come-nc and removed request for a team August 28, 2024 15:18
@juliusknorr juliusknorr added bug 3. to review Waiting for reviews labels Aug 28, 2024
@juliusknorr juliusknorr added this to the Nextcloud 31 milestone Aug 28, 2024
@nickvergessen
Copy link
Member

Just for the record, if you did this because you see it on our instance, the stable30 backport was merged after the last RC

@juliusknorr
Copy link
Member Author

juliusknorr commented Aug 28, 2024

I noticed on our instance but it was still an issue on master, the previous fixes only tackled getId() not getInternalPath() which is also not throwing on NonExistingFile instances

(edit: I'm not sure why I didn't catch this when testing the earlier PR i did)

@nickvergessen
Copy link
Member

NonExistingFolder needs the same fix? and did you also try "read" operation paths from admin_audit

…older

Signed-off-by: Julius Härtl <jus@bitgrid.net>
@juliusknorr
Copy link
Member Author

Reads are not affected as the file already exists then, but added the same for folder creation on NonExistingFolder

@juliusknorr juliusknorr merged commit 6d04ad8 into master Aug 29, 2024
174 checks passed
@juliusknorr juliusknorr deleted the fix/audit-new-node branch August 29, 2024 13:43
@juliusknorr
Copy link
Member Author

/backport to stable30

This comment was marked as resolved.

@juliusknorr

This comment was marked as resolved.

This comment was marked as resolved.

@juliusknorr

This comment was marked as resolved.

This comment was marked as resolved.

@juliusknorr
Copy link
Member Author

/backport to stable30

Copy link

backportbot bot commented Aug 30, 2024

The backport to stable30 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable30
git pull origin stable30

# Create the new backport branch
git checkout -b backport/47581/stable30

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 61108882

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/47581/stable30

Error: Failed to clone repository: Failed to checkout branches: error: Your local changes to the following files would be overwritten by checkout:
dist/3794-3794.js.map.license
dist/4546-4546.js.map.license
dist/4696-4696.js.map.license
dist/5643-5643.js.map.license
dist/583-583.js.map.license
dist/9972-9972.js.map.license
Please commit your changes or stash them before you switch branches.
Aborting


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@skjnldsv
Copy link
Member

/backport to stable30

1 similar comment
@skjnldsv
Copy link
Member

/backport to stable30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants