install: Use fchown to change owner
This commit is contained in:
parent
8c02cf675c
commit
8ef9b38e56
@ -55,16 +55,14 @@ install(const char *s1, const char *s2, int depth)
|
|||||||
}
|
}
|
||||||
if (concat(f1, s1, f2, s2) < 0)
|
if (concat(f1, s1, f2, s2) < 0)
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
||||||
if (fchmod(f2, mode) < 0)
|
if (fchmod(f2, mode) < 0)
|
||||||
eprintf("fchmod %s:", s2);
|
eprintf("fchmod %s:", s2);
|
||||||
|
if (fchown(f2, owner, group) < 0)
|
||||||
|
eprintf("lchown %s:", s2);
|
||||||
|
|
||||||
close(f1);
|
close(f1);
|
||||||
close(f2);
|
close(f2);
|
||||||
|
|
||||||
if (lchown(s2, owner, group) < 0)
|
|
||||||
eprintf("lchown %s:", s2);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user