The Samba-Bugzilla – Attachment 1264 Details for
Bug 2758
"File exists" error using options -b and --backup-dir with device files.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
A partial fix
backup.patch (text/plain), 1.80 KB, created by
Wayne Davison
on 2005-06-07 10:56:38 UTC
(
hide
)
Description:
A partial fix
Filename:
MIME Type:
Creator:
Wayne Davison
Created:
2005-06-07 10:56:38 UTC
Size:
1.80 KB
patch
obsolete
>--- backup.c 22 Feb 2005 01:57:58 -0000 1.44 >+++ backup.c 7 Jun 2005 17:47:23 -0000 >@@ -188,18 +188,16 @@ static int keep_backup(char *fname) > return 0; > > /* Check to see if this is a device file, or link */ >- if (IS_DEVICE(file->mode)) { >- if (am_root && preserve_devices) { >- if (do_mknod(buf, file->mode, file->u.rdev) < 0 >- && (errno != ENOENT || make_bak_dir(buf) < 0 >- || do_mknod(buf, file->mode, file->u.rdev) < 0)) { >- rsyserr(FERROR, errno, "mknod %s failed", >- full_fname(buf)); >- } else if (verbose > 2) { >- rprintf(FINFO, >- "make_backup: DEVICE %s successful.\n", >- safe_fname(fname)); >- } >+ if (IS_DEVICE(file->mode) && am_root && preserve_devices) { >+ do_unlink(buf); >+ if (do_mknod(buf, file->mode, file->u.rdev) < 0 >+ && (errno != ENOENT || make_bak_dir(buf) < 0 >+ || do_mknod(buf, file->mode, file->u.rdev) < 0)) { >+ rsyserr(FERROR, errno, "mknod %s failed", >+ full_fname(buf)); >+ } else if (verbose > 2) { >+ rprintf(FINFO, "make_backup: DEVICE %s successful.\n", >+ safe_fname(fname)); > } > kept = 1; > do_unlink(fname); >@@ -230,15 +228,18 @@ static int keep_backup(char *fname) > full_fname(buf), file->u.link); > } > kept = 1; >+ } else { >+ do_unlink(buf); >+ if (do_symlink(file->u.link, buf) < 0 >+ && (errno != ENOENT || make_bak_dir(buf) < 0 >+ || do_symlink(file->u.link, buf) < 0)) { >+ rsyserr(FERROR, errno, "link %s -> \"%s\"", >+ full_fname(buf), >+ safe_fname(file->u.link)); >+ } >+ do_unlink(fname); >+ kept = 1; > } >- if (do_symlink(file->u.link, buf) < 0 >- && (errno != ENOENT || make_bak_dir(buf) < 0 >- || do_symlink(file->u.link, buf) < 0)) { >- rsyserr(FERROR, errno, "link %s -> \"%s\"", >- full_fname(buf), safe_fname(file->u.link)); >- } >- do_unlink(fname); >- kept = 1; > } > #endif >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 2758
: 1264