Bug 8001 - Is MAXPATHLEN set properly on FreeBSD?
Summary: Is MAXPATHLEN set properly on FreeBSD?
Status: ASSIGNED
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 3.0.8
Hardware: All FreeBSD
: P5 normal (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-10 08:20 UTC by Josep
Modified: 2020-04-09 16:29 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Josep 2011-03-10 08:20:27 UTC
I'm trying to do a backup from a synology product (NAS diskstation) to a FreeBSD server, with a 3.0.8pre1
All works well since I get this messages (from log):

2011/03/10 09:15:30 [27378] receiving file list
2011/03/10 09:15:30 [27378] overflow: xflags=0xfa l1=255 l2=774 lastname=@dominis@/ECRYPTFS_FNEK_ENCRYPTED.FWZ0AjypU3Tk-kbJfmwSC9.1Zd.xFP0LS7ysNgXs..gGt8G95MfnVXLBFU--/ECRYPTFS_FNEK_ENCRYPTED.FWZ0AjypU3Tk-kbJfmwSC9.1Zd.xFP0LS7ysVjTftHWkNlQYxEKm0znW3---/ECRYPTFS_FNEK_ENCRYPTED.FWZ0AjypU3Tk-kbJfmwSC9.1Zd.xFP0LS7ysFroUSTkNzwzY4Zko.kOIjE--/ECRYPTFS_FNEK_ENCRYPTED.FWZ0AjypU3Tk-kbJfmwSC9.1Zd.xFP0LS7ysWlVjAVSxuMNMuthTMJ-0b---/ECRYPTFS_FNEK_ENCRYPTED.FWZ0AjypU3Tk-kbJfmwSC9.1Zd.xFP0LS7ys9JlEYfGR20z-oLHK1Chcb---/ECRYPTFS_FNEK_ENCRYPTED.FWZ0AjypU3Tk-kbJfmwSC9.1Zd.xFP0LS7ystyGzkVf3V7WywS-C1FjJTk--/ECRYPTFS_FNEK_ENCRYPTED.FWZ0AjypU3Tk-kbJfmwSC9.1Zd.xFP0LS7ys4kWwlhAnCqKHZ.4sUaFCCU--/ECRYPTFS_FNEK_ENCRYPTED.FWZ0AjypU3Tk-kbJfmwSC9.1Zd.xFP0LS7yslPyZmqmbCTNHY3Zs.lcRi---/ECRYPTFS_FNEK_ENCRYPTED.FWZ0AjypU3Tk-kbJfmwSC9.1Zd.xFP0LS7ys9xLBBQqw3WdAE7YHrpMlnU--/ECRYPTFS_FNEK_ENCRYPTED.FWZ0AjypU3Tk-kbJfmwSC9.1Zd.xFP0LS7ys.QFL27H5pIVa2lyaBsHLxE--/ECRYPTFS_FNEK_ENCRYPTED.FWZ0AjypU3Tk-kbJfmwSC9.1Zd.xFP0LS7ys13ARHC5.R4ZPEw-mpvL1A--- [generator]
2011/03/10 09:15:30 [27378] ERROR: buffer overflow in recv_file_entry [generator]
2011/03/10 09:15:30 [27378] rsync error: error allocating core memory buffers (code 22) at util.c(124) [generator=3.0.8pre1]


The path seems to be too long. I tried to modify the MAXPATHLEN value to 10240, recompiled and installed but the problem persists :(

Can you help me?
Thanks in advanced
Comment 1 Wayne Davison 2011-03-10 22:14:24 UTC
MAXPATHLEN is a system-defined value of the longest path a function such as open() can handle, so you can't just arbitrarily increase it.  If your OS provides a MAXPATHLEN value that is smaller than what open() can handle, file a bug with the FreeBSD folks.  If it doesn't provide any such define, rsync.h will set it to be a conservative 1024 bytes.  If you find that FreeBSD has some other define for this maximal value I can either get rsync.h to make use of it, or you can get the FreeBSD folks to define MAXPATHLEN.

As for increasing the value not helping -- you must either not have defined it right, or you must be doing a transfer where the other side doesn't have a larger buffer.
Comment 2 Björn Jacke 2019-04-13 15:05:57 UTC
rsync should use pathconf() to find the maximum allowed path length and not expect to find a OS define like PATH_MAX because this can vary also from filesystem to filesystem. See https://pubs.opengroup.org/onlinepubs/7908799/xsh/limits.h.html
Comment 3 Ben RUBSON 2020-04-09 16:29:59 UTC
Some additional info :
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=184340