From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on sa.int.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.2.5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to; bh=pCSjKTzPxyvvSscj6N3QnH3bJj1JDiNhGtUrJJU3p/E=; b=sETF1Tp5G1k6ljShdqv0zJMmkaCRU9X6Y0ETjBUSK6iYPVo5jwChh3pIhFaxoj7RmO o8rpRUWJxM9AhFf9ihv8Y5iRpWyhwdvh1Prbby9YRsQu8IUg1Zp7PjBwH9lLr/Kovdk2 udYaVOlIuzHAK853Jls96PcztYKcXtk21B5pDhveOsL7yMuaCnkuV7rAgyiWIziYPLbQ 4FO0wwoRN5Xtojq5KoOnz0Mv4fDd4XA7l7++Lnu22UXa+kRx16ew7bNBBqyp12Qk2zA5 k8Og8iFydnMSsYMBGbw969mbGqKYTDA0HGrz5NCycBkiidNq/gsbjAVax/2pMefzcfWE d82Q== Sender: Denis Smirnov Date: Sat, 4 Aug 2012 17:05:43 +0400 From: "=?koi8-r?B?5MXOydMg883J0s7P1w==?=" To: sisyphus@lists.altlinux.org Message-ID: <20120804130543.GA9211@mw.mithraen.ru> References: <5016A698.5040308@rattler.kiev.ua> <20120730184123.GK31323@osdn.org.ua> <5016ED75.6090200@rattler.kiev.ua> <50178AEE.9070604@rattler.kiev.ua> <20120731103318.GC30799@mw.mithraen.ru> <5017B5A4.30504@rattler.kiev.ua> <20120804093508.GA16296@mw.mithraen.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="f2QGlHpHGjS2mn6Y" Content-Disposition: inline In-Reply-To: Subject: Re: [sisyphus] =?koi8-r?b?9MXL09TP19nKIMnO09TBzMzF0g==?= X-BeenThere: sisyphus@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux Sisyphus discussions List-Id: ALT Linux Sisyphus discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Aug 2012 13:07:47 -0000 Archived-At: List-Archive: List-Post: --f2QGlHpHGjS2mn6Y Content-Type: multipart/mixed; boundary="pWyiEgJYm5f9v55/" Content-Disposition: inline --pWyiEgJYm5f9v55/ Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Aug 04, 2012 at 03:03:15PM +0300, Dmitriy Kruglikov wrote: DK> =E4=C1=D7=C1=CA =C4=C5=CC=C1=D4=D8 =DC=D3=CB=C1=CC=C1=C3=C9=C0 =D0=D2= =CF=C2=CC=C5=CD=D9... DK> =E5=D3=CC=C9 =CE=C5=D4 =D7=CF=DA=CD=CF=D6=CE=CF=D3=D4=C9 =D0=C1=CB=CF= =D7=C1=D4=D8/=D2=C1=D3=D0=C1=CB=CF=D7=D9=D7=C1=D4=D8 =C8=C1=D2=C4-=C4=C9=CE= =CB=C9, =DA=CE=C1=DE=C9=D4=D8 =C9=C8 DK> =D0=C1=CB=CF=D7=C1=D4=D8 =C9 =CE=C5 =CE=D5=D6=CE=CF... DK> =E4=C1=D7=C1=CA =C9=C8 _=C4=C5=CC=C1=D4=D8_ =D0=CF=D3=CC=C5 =D2=C1=D3= =D0=C1=CB=CF=D7=CB=C9. DK> =E9=CC=C9 =D0=D2=C9 =D0=C5=D2=D7=CF=CD =D3=D4=C1=D2=D4=C5 ... =F4=CF =C5=D3=D4=D8, =CE=D5=D6=CE=CF =C4=D7=C1 =D3=CB=D2=C9=D0=D4=C1. =D0=C5=D2=D7=D9=CA: - =D7=D9=D1=D7=C9=D4 =D7=D3=C5 =C8=C1=D2=C4=CC=C9=CE=CB=C9 - =D5=C4=C1=CC=C9=D4 =C9=C8 - =D0=CF=CC=CF=D6=C9=D4 =C9=C8 =D3=D0=C9=D3=CF=CB =CB=D5=C4=C1-=CE=C9=C2=D5= =C4=D8 =D7=D4=CF=D2=CF=CA: - =D0=C5=D2=C5=D3=CF=DA=C4=C1=D3=D4 =D0=CF=D3=CC=C5 =D2=C1=D3=D0=C1=CB=CF= =D7=CB=C9 =ED=CE=C5 =D7=D3=C5-=D4=C1=CB=C9 =C2=CF=CC=D8=DB=C5 =CE=D2=C1=D7=C9=D4=D3= =D1 =D7=C1=D2=C9=C1=CE=D4 =D3 =D0=C1=D4=DE=C5=CE=D9=CD cpio. =F7 =C1=D4=D4=C1=DE=C5 =CD=CF=CA =D0=C1=D4=DE, =CB=CF=D4=CF=D2=D9=CA =D1 = =D0=C9=D3=C1=CC =D7 =CE=CF=D1=C2=D2=C5 2006. =FC=D4=CF =C4=C5=CD=CF, =CE=CF= =CF=CE=CF =D5=D3=D0=C5=DB=CE=CF =D2=C1=C2=CF=D4=C1=CC=CF. --=20 =F3 =D5=D7=C1=D6=C5=CE=C9=C5=CD, =E4=C5=CE=C9=D3 http://mithraen.ru/ ---------------------------------------------------------------------------- --pWyiEgJYm5f9v55/ Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename="cpio-2.6-can-break-hardlinks.patch" Content-Transfer-Encoding: quoted-printable =F4=CF=CC=D8=CB=CF =D7 cpio-2.6/rmt: rmt =F4=CF=CC=D8=CB=CF =D7 cpio-2.6/rmt: rmt.o =F4=CF=CC=D8=CB=CF =D7 cpio-2.6/src: copyin.o =F4=CF=CC=D8=CB=CF =D7 cpio-2.6/src: copyout.o diff -ur cpio-2.6.orig/src/copypass.c cpio-2.6/src/copypass.c --- cpio-2.6.orig/src/copypass.c 2006-10-01 00:14:55 +0400 +++ cpio-2.6/src/copypass.c 2006-10-01 00:18:13 +0400 @@ -29,6 +29,46 @@ #define lchown chown #endif =20 +/* Copy file */ +int copy_file(const char *infile, const char *outfile) +{ + int ifd, ofd, len; + struct stat in_stat; + mode_t oldmode; + char buf[4096]; /* XXX make it lerger. */ + if ((ifd =3D open(infile, O_RDONLY)) < 0) { + return -1; + } + fstat(ifd, &in_stat); + oldmode =3D umask(0); + if ((ofd =3D open(outfile, O_WRONLY | O_TRUNC | O_CREAT, 07777 & in_stat.= st_mode )) < 0) { + close(ifd); + umask(oldmode); + return -1; + } + fchown(ofd, in_stat.st_uid, in_stat.st_gid); + umask(oldmode); + while ((len =3D read(ifd, buf, sizeof(buf)))) { + int res; + if (len < 0) { + break; + } + /* XXX handle partial writes */ + res =3D write(ofd, buf, len); + if (res !=3D len) { + len =3D -1; /* error marker */ + break; + } + } + close(ifd); + close(ofd); + if (len < 0) { + unlink(outfile); + return -1; /* error */ + } + return 0; /* success */ +} + /* Copy files listed on the standard input into directory `directory_name'. If `link_flag', link instead of copying. */ =20 @@ -455,6 +495,8 @@ link_to_name (char *link_name, char *link_target) { int res =3D link (link_target, link_name); + if (res < 0) + copy_file(link_target, link_name); if (res < 0 && create_dir_flag) { create_all_directories (link_name); @@ -470,6 +512,10 @@ { error (0, errno, _("cannot link %s to %s"), link_target, link_name); + res =3D copy_file(link_target, link_name); + if (res) + strerror("copy_file"); } return res; } + --pWyiEgJYm5f9v55/-- --f2QGlHpHGjS2mn6Y Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlAdHiYACgkQPuR8c4jhFKLc9QCZAWQeoxJKI87mcxsLYaLLRSYJ gMQAoLGOJcRt7xfEDFzjbTy7GG2I/acn =67eS -----END PGP SIGNATURE----- --f2QGlHpHGjS2mn6Y--