Bug 80288 - [PATCH] samba: processing of symlinks broken
Summary: [PATCH] samba: processing of symlinks broken
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Dirk Meyer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-23 17:20 UTC by Andre.Albsmeier
Modified: 2005-09-22 14:50 UTC (History)
0 users

See Also:


Attachments
file.diff (899 bytes, patch)
2005-04-23 17:20 UTC, Andre.Albsmeier
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andre.Albsmeier 2005-04-23 17:20:17 UTC
There are two serious bugs in the code which processes symlinks
in smbd:

1.) The programmer assumed that readlink() would NUL-terminate
    the result (flink). This is fixed with the first part of the
    patch.

2.) In case of a relative symlink, the destination (cleanlink) is
    constructed by concatenating realdir with the link. This is
    wrong, it should be dirname(name) + the link. The second part
    of the patch fixes that.

How-To-Repeat: 
Raise debuglevel to 3 and access symlinks from Winblows. Watch
the messed up filenames due to 1.).
Fix 1.) and try to access relative symlinks from Winblows. These
links must not reside on the toplevel of the share. Watch the
wrongly constructed filnames.
Comment 1 Mark Linimon 2005-04-23 19:34:46 UTC
To which version(s) of the samba port does this patch apply?
Comment 2 Andre.Albsmeier 2005-04-24 09:59:48 UTC
> To which version(s) of the samba port does this patch apply?

Well, since I wrote "samba from ports" it must be the one in
net/samba (2.2.12 at the moment) :-). Don't know if it applies
to samba3 as well...

BTW, your mail never made it through to me. I just ran across
it in the audit-trail...

	-Andre
Comment 3 Dirk Meyer freebsd_committer freebsd_triage 2005-09-22 14:42:44 UTC
State Changed
From-To: open->analyzed

I will take care of it.
Comment 4 Dirk Meyer freebsd_committer freebsd_triage 2005-09-22 14:43:16 UTC
Responsible Changed
From-To: freebsd-ports-bugs->dinoex

I will take care of it.
Comment 5 Dirk Meyer freebsd_committer freebsd_triage 2005-09-22 14:50:18 UTC
State Changed
From-To: analyzed->closed

committed, thanks.