Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Jun 1998 16:28:21 +0300 (EEST)
From:      Heikki Suonsivu <hsu@clinet.fi>
To:        Peter Hawkins <thepish@FreeBSD.ORG>
Cc:        Heikki Suonsivu <hsu@clinet.fi>, Peter Hawkins <peter@clari.net.au>, freebsd-bugs@FreeBSD.ORG
Subject:   Re: bin/4599
Message-ID:  <13691.59125.985303.183564@katiska.clinet.fi>
In-Reply-To: <Pine.BSF.3.96.980608211655.11826H-100000@dana.clari.net.au>
References:  <13691.49682.498719.688203@katiska.clinet.fi> <Pine.BSF.3.96.980608211655.11826H-100000@dana.clari.net.au>

next in thread | previous in thread | raw e-mail | index | archive | help

Peter Hawkins writes:
 > >No it does not use _PATH_TMP.  If you do not bother to read the code before
 > >closing the related PRs, at least you could trust someone who did.
 > 
 > Sorry, you're simply wrong there.
 > 
 > >From RELENG_2_2:
 > 
 >   strcpy(tempfile, _PATH_TMP);
 >   strcat(tempfile, _RDIST_TMP);
 > 
 > >From -current:
 > 
 >   strcpy(tempfile, _PATH_TMP);
 >   strcat(tempfile, _RDIST_TMP);  
 >     
 > Like I said, your _PATH_TMP should be a valid directory.

[The actual problem seems to be have been fixed in
/usr/src/lib/libc/stdio/mktemp.c in version 1.4.2.1 -> 1.4.2.2, so closing
the original PR is fine now, but my point on reading PR's carefully before
closing them is still valid]

You seem to be looking rdist distributed with FreeBSD, I cannot find above
in rdist6.  As I numerous times in my mails and in the PR mentioned:

       This breaks rdist6, which wants to create a temporary path and patch up
       missing directories on the path afterwards.

The following is an excerpt from server.c (for which the PR also included a
diff):

                /*
                 * Create name of temporary file
                 */
                if (catname && cattarget(file) < 0) {
                        error("Cannot set file name.");
                        return;
                }
                file = strrchr(target, '/');
                if (file == NULL)
                        (void) strcpy(new, tempname);
                else if (file == target)
                        (void) sprintf(new, "/%s", tempname);
                else {
                        *file = CNULL;
                        (void) sprintf(new, "%s/%s", target, tempname);
                        *file = '/';
                }
                message(MT_SYSLOG|MT_INFO, "Create name of temp results %s",
                        new);
#if 0           
                if (!mktemp(new)) {
                  error("Cannot create temporary name, errno %d.", errno);
                }
#else
                {
                  char *p;
                  p = strstr(new, "XXXXXX");
                  if (p)
                    sprintf(p, "%6d", getpid() % 1000000);
                  else
                    error("Cannot create temporary name");
                }
#endif
                
                message(MT_SYSLOG|MT_INFO, "After mktemp it becomes %s", new);
        }

#if 0 is my workaround, and couple of messages were added when I was
tracking this one.  I also added the check around mktemp, originally there
was no check at all, so it was a bit tricky to find the problem being in
the server.

 > Peter
 > 
 > Hilink Internet            Peter Hawkins
 > 381 Swan St Richmond,      
 > Vic, Australia             Ph: +61-3-9421 2006 Fax: +61-3-9421 2007
 > http://www.hilink.com.au   Peter@hilink.com.au
 > 
 > FreeBSD Project:           thepish@FreeBSD.org

-- 
Heikki Suonsivu, T{ysikuu 10 C 83/02210 Espoo/FINLAND, hsu@clinet.fi
mobile +358-40-5519679 work +358-9-43542270 fax -4555276

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?13691.59125.985303.183564>