Bug 14256 - smbd does a chdir() twice per request
Summary: smbd does a chdir() twice per request
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-30 08:04 UTC by Ralph Böhme
Modified: 2020-04-09 07:18 UTC (History)
2 users (show)

See Also:


Attachments
Patch for 4.11 backported from master (2.32 KB, patch)
2020-03-16 13:31 UTC, Ralph Böhme
jra: review-
Details
Patch for 4.12 cherry-picked from master (3.18 KB, patch)
2020-03-16 13:32 UTC, Ralph Böhme
jra: review+
Details
Patch for 4.11 - Fixed up commit message. (2.19 KB, patch)
2020-03-16 22:27 UTC, Jeremy Allison
slow: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralph Böhme 2020-01-30 08:04:48 UTC
Since 8e81090789e4cc3ba9e5aa792d4e52971909c894 we're doing chdir() twice, first into conn->connectpath, then into conn->origpath.

Before commit 8e81090789e4cc3ba9e5aa792d4e52971909c894 if chdir(conn->connectpath) succeeded, we wouldn't do the second chdir().

Have patch, need bugnumber.
Comment 1 Ralph Böhme 2020-03-16 13:31:17 UTC
Created attachment 15864 [details]
Patch for 4.11 backported from master
Comment 2 Ralph Böhme 2020-03-16 13:32:01 UTC
Created attachment 15865 [details]
Patch for 4.12 cherry-picked from master
Comment 3 Jeremy Allison 2020-03-16 21:47:10 UTC
Comment on attachment 15864 [details]
Patch for 4.11 backported from master

Can you fix up the commit message to remove the section:

"While at it, simplify the logging logic: if chdir() fails in this core function,
just always log is as error including the unix token."

as that's not being done in this back-port.
Comment 4 Jeremy Allison 2020-03-16 21:59:53 UTC
Comment on attachment 15865 [details]
Patch for 4.12 cherry-picked from master

LGTM.
Comment 5 Jeremy Allison 2020-03-16 22:27:30 UTC
Created attachment 15868 [details]
Patch for 4.11 - Fixed up commit message.

Rather than moaning about the commit message being wrong, fix it myself :-).
Comment 6 Ralph Böhme 2020-04-06 14:11:05 UTC
Reassigning to Karolin for inclusion in 4.11 and 4.12.
Comment 7 Karolin Seeger 2020-04-07 08:07:50 UTC
(In reply to Ralph Böhme from comment #6)
Pushed to autobuild-v4-{11,12}-test.
Comment 8 Karolin Seeger 2020-04-09 07:18:34 UTC
(In reply to Karolin Seeger from comment #7)
Pushed to both branches.
Closing out bug report.

Thanks!