Why is realpath failing? Is it called before the tmux-%u directory is
created?


On Sat, Jul 21, 2012 at 03:39:08PM -0400, Dylan Alex Simon wrote:
> I noticed (accidentally) that the check to prevent nesting tmux in the same
> server wasn't working.  I tracked this down to the fact that $TMUX is
> "/tmp//tmux-499/default,917,0" in my first session.  Note the double-slash,
> because _PATH_TMP is "/tmp/".
> 
> The first time tmux is run, before the socket is created, the realpath call
> fails (ENOENT) and doesn't remove the //, but on subsequent invocations it
> works, removing it.  Thus, the nesting check doesn't realize it's the same
> server.  This would also be a problem if /tmp were a symlink.
> 
> Here's a possible patch for this, which calls realpath on TMPDIR before adding
> the socket and removes trailing slashes, too.
> 
> https://github.com/dylex/xtmux/commit/ebe8de387245b71fb745969d894d37fa5adb1b4b
> 
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> tmux-users mailing list
> tmux-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/tmux-users

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to