diff options
author | Jim Meyering <jim@meyering.net> | 1996-11-30 04:33:30 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1996-11-30 04:33:30 +0000 |
commit | 0682a5efe9be735dac040185c73e581f641279fc (patch) | |
tree | 62854364111d9ca181e70f91a6af6f78dc2cf0b4 | |
parent | dc68073b212ddf9bb4d1f1441671761f227c17cb (diff) | |
download | coreutils-0682a5efe9be735dac040185c73e581f641279fc.tar.xz |
(copy_file): Allow installation from non-directory (rather than only regular)
files. Suggestion from Charles Karney.
-rw-r--r-- | src/install.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/install.c b/src/install.c index 914cd6313..c31c1a7c0 100644 --- a/src/install.c +++ b/src/install.c @@ -370,9 +370,13 @@ copy_file (char *from, char *to, int *to_created) error (0, errno, "%s", from); return 1; } - if (!S_ISREG (from_stats.st_mode)) + + /* Allow installing from non-regular files like /dev/null. + Charles Karney reported that some Sun version of install allows that + and that sendmail's installation process relies on the behavior. */ + if (S_ISDIR (from_stats.st_mode)) { - error (0, 0, _("`%s' is not a regular file"), from); + error (0, 0, _("`%s' is a directory"), from); return 1; } if (stat (to, &to_stats) == 0) |