From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11043 invoked by alias); 19 Jan 2014 22:13:19 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 32292 Received: (qmail 21923 invoked from network); 19 Jan 2014 22:13:14 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.2 Date: Sun, 19 Jan 2014 23:13:10 +0100 From: Simon Ruderich To: zsh-workers@zsh.org Subject: Re: segfault with exceedingly long path Message-ID: <20140119221310.GA502@ruderich.org> References: <20140118002033.GY27889@sym.noone.org> <140117174902.ZM7366@torch.brasslantern.com> <20140119191048.018a051a@pws-pc.ntlworld.com> <140119133550.ZM5354@torch.brasslantern.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="=_zucker.schokokeks.org-4100-1390169591-0001-2" Content-Disposition: inline In-Reply-To: <140119133550.ZM5354@torch.brasslantern.com> User-Agent: Mutt/1.5.21 (2013-03-19) --=_zucker.schokokeks.org-4100-1390169591-0001-2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jan 19, 2014 at 01:35:50PM -0800, Bart Schaefer wrote: > In this particular case even if the shell were able to deal with an > "unlimited" directory nesting depth, system calls like chdir(2) would > begin to fail. PATH_MAX is the maximum relative path length, which should be accepted by chdir(2) and similar system calls. As long as we don't use paths longer than PATH_MAX in system calls, it doesn't matter how "deep" the directory structure is. It only becomes a problem if a very long absolute path is used. So we could do that in small steps, e.g. first chdir(2) to a directory < PATH_MAX bytes deep, then from there to the next directory < PATH_MAX bytes deep and so on until we get down to the real directory. I don't think that's worth it, but it works. Regards Simon --=20 + privacy is necessary + using gnupg http://gnupg.org + public key id: 0x92FEFDB7E44C32F9 --=_zucker.schokokeks.org-4100-1390169591-0001-2 Content-Type: application/pgp-signature; name="signature.asc" Content-Transfer-Encoding: 7bit Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBCgAGBQJS3E32AAoJEJL+/bfkTDL5OPwP/2tGiuoLK6+k7PD5AKbjqxu1 Kr51a0GoPJsBQ8iEBBvaqHeQmuaqYzXMiIB3V2lhWRMDqE+POibh5USwsglWhe9q WmDcVPxbNlZRXwJP6bKilEYZOYai6XGH5kZF2Y0E/h9O00uwOIEq46jxz8dXpfcG 0LBfoc5QPa8eyjjOP/DAatd6TpiivJ/iMcJ2fBntsUJ3i8VyjFn9+/6yt+4OCBNN mvpWU/M4RRAm2R6D9hbPCTQ4y/zxNXT710UrS+W0Vf744huhtpqVfwS7Yvf4QxwL xZamyRb2Y1IksbWPtj2E+sKGYOKA7YgCyKB+MUxl0tyHc/2AvA8fASMPzi1oiKSH ZBvqrK8KSie7lfA9aMA3o0Vhf6ZLN/t079gt7ajjj0DIkPZnjU8+OgqSzXICVKCv fBtieDB0Zwq1yrAdN1BINk2HNiaeETRAA89794RZy6aN8zqUPS+79MYLBzcvwEpQ Mo5YhdC89l8Xk6psZdiLvAulwPwPTMzAU2qVnXltb5nwuun0CoC5JL8boAHlwRuj r+i0fbQMzHv0Ru35GIpX+C5L/dt11F04RRZjWcLiEnfInjnhCVgQk1IDlzmM2Ues jaKX7Qa3MHDAxvPvDs7WrnqTiA8ATpymWD8scZSGZpILHIj7wcIydAe3wru9VAm0 H1V8UoEzW4dB1cLdKaqL =uk0n -----END PGP SIGNATURE----- --=_zucker.schokokeks.org-4100-1390169591-0001-2--