cannot create .hosts.b0WX1x : File exists

Rok Krulec Rok.Krulec at fpp.edu
Fri Nov 30 09:46:30 EST 2001


Hello Dave,

On Thu, 29 Nov 2001, Dave Dykstra wrote:
> What version of rsync are you using?  The "cannot create" message is coming
> from receiver.c.  Assuming you're using a released version of rsync and not
> a development version, it appears that the mktemp library call is creating
> the file and rsync isn't expecting that.  Are you sure the Linuxes are
> exactly the same; do you perhaps have a different version of libc on that
> one machine (I'm guessing that maybe mktemp has been changed to create the
> file instead of just returning its name)?  Andrew Tridgell changed the
> relevant section of code in the development version of rsync 6 months ago
> to use mkstemp (when configure determines it to be secure) instead of
> mktemp but he didn't say why.

This is it. All working machines have 2.2 lnx kernel and libc-2.1.3.so
nonworking one has 2.4 lnx kernel and libc-2.2.1.so.

I changed line 121 of syscall.c to use:
   mktemp(template);
instead of 
   mkstemp(template);

I got his linker warning, but rsync was linked OK and is working fine now.

syscall.o: In function `do_mktemp':
syscall.o(.text+0x32f): the use of `mktemp' is dangerous, better use `mkstemp'

Dave, thank You for Your help. You guys are really great.

Rok Krulec

Portoroz/Slovenia, 29.Nov 2001 @ 23:12 CET
Public GnuPG key @ http://rok.fpp.edu/pgp.key

> On Thu, Nov 29, 2001 at 12:34:04AM +0100, Rok Krulec wrote:
> > Hello Dave,
> > 
> > thank You for Your time; sorry I didn't included my rsyncd.conf. As I
> > said, on two other machines with EXACTLY the same config file and EXACTLY
> > the same passwd entries for nobody and nogroup = same ID's, it works
> > perfectly. EXECTLY the same permissions on target directory alos ofcourse.
> > 
> > This is my /etc/rsyncd.conf:
> > 
> > --- CUT HERE ---
> > motd file = /etc/issue.net
> > max connections = 0
> > syslog facility = local3
> > 
> > [bkp]
> >         comment = Backup area
> >         path = /_silos
> >         read only = no
> >         list = no
> >         uid = nobody
> >         gid = nogroup
> >         hosts allow = XXX.XXX.XXX.XXX
> > --- CUT HERE ---
> > 
> > Portoroz/Slovenia, 29.Nov 2001 @ 00:24 CET
> > Public GnuPG key @ http://rok.fpp.edu/pgp.key
> > 
> > 
> > On Wed, 28 Nov 2001, Dave Dykstra wrote:
> > > You probably need to set
> > >     read only = no
> > > in rsyncd.conf.
> > > 
> > > - Dave
> > > 
> > > On Wed, Nov 28, 2001 at 04:29:35PM +0100, Rok Krulec wrote:
> > > > Hello,
> > > > 
> > > > when I do:
> > > > /opt/rsync/bin/rsync /etc/hosts targethost::bkp/
> > > > 
> > > > I get:
> > > > cannot create .hosts.b0WX1x : File exists
> > > > 
> > > > I check the targethost and I get empty file .hosts.b0WX1x
> > > > 
> > > > When trying with other targethost-s it works, but on this one it doesn't.
> > > > On the other targethosts I have exactly the same LinuX distribution,
> > > > permissions and users than on the problem targethost.
> > > > I have exactly the same configuration than on the other machines, except
> > > > on probelm targethost I have SCSI hard disk.
> > > > 
> > > > When i strace the rsync --deamon i get:
> > > > 
> > > > 4697  open(".hosts.b0WX1x", O_RDWR|O_CREAT|O_EXCL|0x8000, 0600) = 4
> > > > 4697  open(".hosts.b0WX1x", O_WRONLY|O_CREAT|O_EXCL|0x8000, 0600) = -1 EEXIST (File exists)
> > > > 
> > > > It seems like it opens the file ReadWrite and then tries to open it
> > > > readonly. I don't know why. It bangs then.
> > > > 
> > > > Thanks for any hint,
> > > >    Rok Krulec
> > 
> 






More information about the rsync mailing list