X-Spam-Check-By: sourceware.org Message-ID: <461A91B1.2984D418@dessent.net> Date: Mon, 09 Apr 2007 12:19:13 -0700 From: Brian Dessent X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: ln -s exe magic (coreutils 6.7-2) References: <011701c73f43$3d07d270$3e0010ac AT wirelessworld DOT airvananet DOT com> <20070124043651 DOT GF25379 AT ns1 DOT anodized DOT com> <20070124094810 DOT GN27843 AT calimero DOT vinschen DOT de> <45B76311 DOT 1000009 AT byu DOT net> <20070124143821 DOT GQ27843 AT calimero DOT vinschen DOT de> <461A3A14 DOT 8090702 AT byu DOT net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Reply-To: cygwin AT cygwin DOT com Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Eric Blake wrote: > when creating symlinks, I plan to still auto-append the .exe to the link > target if necessary (otherwise, exec*() succeeds but open() fails when > dereferencing the symlink), but not to the link name. That sounds correct. If open() fails on a link target that's missing an .exe, then it should not be able to create such a symlink with ln. Or perhaps, it is possible, but doing so requires special effort, e.g. "ln -s foo bar." > Therefore, in the original case, the first ln -s generates > sendmail->/usr/bin/exim, then the second ln -s overwrites it with > sendmail->/usr/sbin/ssmtp.exe rather than adding a new file. Don't you mean the first ln -s generates "sendmail -> /usr/bin/exim.exe" and the second overwrites it with "sendmail -> /usr/bin/ssmtp.exe"? > Now, should I also make ln -s smart enough for the reverse? In other > words, if sendmail.exe->/usr/sbin/ssmtp.exe exists, and the user does 'ln > - -fs /usr/bin/exim sendmail', should I delete the existing sendmail.exe.lnk > as part of creating the new symlink? I'm guessing that since the -f > implies unlinking first, that this would be okay to do. Yes, it should remove the existing sendmail.exe link. That is the expected behavior of the command (since both "sendmail" and "sendmail.exe" describe the same executable, from the point of view of exec) and not doing so would seem to only lead to bugs. > The other thing I am thinking about is making the coreutils postinstall > script go through /usr/bin and finding all instances of *.exe.lnk, and > rewriting those symlinks to be just *.lnk, taking care of Corinna's list > of symlinks with .exe in their name. This won't catch everything, but it > will be a good chunk of the current issues, while transitioning towards > the point of preferring only *.lnk rather than *.exe.lnk for a symlink > name. I wonder, though, if this will trip up cygcheck at all. That sounds good at first, but whatever package created those symlinks will just recreate them again when reinstalled/updated, so I think the better plan would be to identify whatever is doing it and work with maintainers of those packages to update them. Brian -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/