BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000243 [BusyBox] Standards Compliance major always 05-03-05 02:57 12-07-05 21:32
Reporter Danyel Ceccaldi View Status public  
Assigned To BusyBox
Priority normal Resolution fixed  
Status closed   Product Version 1.00
Summary 0000243: cp clone special files instead of copying from them, for example /dev/null
Description cp /dev/null targetfile
creates a special targetfile instead of an empty regular file.
probably libbb/copy_file.c requires patching.

Additional Information The patch below is not completely working.
If applied cp not longer clones special files, but it generated a strange error message and exit with exit code 1.
Glenn McGrath posted a patch in september 2002:

-------------- next part --------------
--- busybox.orig/libbb/copy_file.c 2002-06-11 23:25:26.000000000 +1000
+++ ./busybox.dup/libbb/copy_file.c 2002-09-16 15:17:57.000000000 +1000
@@ -129,7 +129,7 @@
             perror_msg("unable to change permissions of `%s'", dest);
             status = -1;
         }
- } else if (S_ISREG(source_stat.st_mode)) {
+ } else if (S_ISREG(source_stat.st_mode) || (!(flags & FILEUTILS_PRESERVE_STATUS))) {
         FILE *sfp, *dfp=NULL;
 #ifdef CONFIG_FEATURE_PRESERVE_HARDLINKS
         char *link_name;

Attached Files

- Relationships

- Notes
(0000736)
landley
12-07-05 21:32

svn 12100
 

- Issue History
Date Modified Username Field Change
05-03-05 02:57 Danyel Ceccaldi New Issue
12-07-05 21:32 landley Status assigned => closed
12-07-05 21:32 landley Note Added: 0000736
12-07-05 21:32 landley Resolution open => fixed
12-07-05 21:32 landley Fixed in Version  => svn


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker