Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F135856267
D4191.id10311.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D4191.id10311.diff
View Options
Index: usr.bin/xinstall/xinstall.c
===================================================================
--- usr.bin/xinstall/xinstall.c
+++ usr.bin/xinstall/xinstall.c
@@ -754,10 +754,7 @@
devnull = 1;
}
- if (!dolink)
- target = (stat(to_name, &to_sb) == 0);
- else
- target = (lstat(to_name, &to_sb) == 0);
+ target = (lstat(to_name, &to_sb) == 0);
if (dolink) {
if (target && !safecopy) {
@@ -772,8 +769,7 @@
return;
}
- /* Only install to regular files. */
- if (target && !S_ISREG(to_sb.st_mode)) {
+ if (target && !S_ISREG(to_sb.st_mode) && !S_ISLNK(to_sb.st_mode)) {
errno = EFTYPE;
warn("%s", to_name);
return;
@@ -786,7 +782,7 @@
err(EX_OSERR, "%s", from_name);
/* If we don't strip, we can compare first. */
- if (docompare && !dostrip && target) {
+ if (docompare && !dostrip && target && S_ISREG(to_sb.st_mode)) {
if ((to_fd = open(to_name, O_RDONLY, 0)) < 0)
err(EX_OSERR, "%s", to_name);
if (devnull)
@@ -838,7 +834,7 @@
/*
* Compare the stripped temp file with the target.
*/
- if (docompare && dostrip && target) {
+ if (docompare && dostrip && target && S_ISREG(to_sb.st_mode)) {
temp_fd = to_fd;
/* Re-open to_fd using the real target name. */
@@ -872,9 +868,7 @@
}
(void) close(temp_fd);
}
- }
-
- if (dostrip && (!docompare || !target))
+ } else if (dostrip)
digestresult = digest_file(tempfile);
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 14, 2:03 PM (7 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25289819
Default Alt Text
D4191.id10311.diff (1 KB)
Attached To
Mode
D4191: Install should not follow the symlinks
Attached
Detach File
Event Timeline
Log In to Comment