Re: [hackers] [sbase] install: Use fchown to change owner || Michael Forney

2020-05-25 Thread Quentin Rameau
> >> +  if (fchown(f2, owner, group) < 0)
> >> +  eprintf("lchown %s:", s2);
> >
> > Little typo here ^
> 
> Whoops, missed that. In the follow up commit, I used the correct
> function name, so I think it's just a mistake from when I split my
> changes into two commits.

Oh right, I missed the change in the other commit because it arrived
before this one on the mailing list, forget about my comment then!



Re: [hackers] [sbase] install: Use fchown to change owner || Michael Forney

2020-05-25 Thread Michael Forney
On 2020-05-24, Quentin Rameau  wrote:
> Hi Michael,
>
>> +if (fchown(f2, owner, group) < 0)
>> +eprintf("lchown %s:", s2);
>
> Little typo here ^

Whoops, missed that. In the follow up commit, I used the correct
function name, so I think it's just a mistake from when I split my
changes into two commits.



Re: [hackers] [sbase] install: Use fchown to change owner || Michael Forney

2020-05-24 Thread Quentin Rameau
Hi Michael,

> + if (fchown(f2, owner, group) < 0)
> + eprintf("lchown %s:", s2);

Little typo here ^



[hackers] [sbase] install: Use fchown to change owner || Michael Forney

2020-05-24 Thread git
commit 8ef9b38e56b9b03fed5c1e4d5cb4a4cb66713868
Author: Michael Forney 
AuthorDate: Sun May 24 20:56:50 2020 -0700
Commit: Michael Forney 
CommitDate: Sun May 24 20:56:50 2020 -0700

install: Use fchown to change owner

diff --git a/xinstall.c b/xinstall.c
index e102c4c..bb973e8 100644
--- a/xinstall.c
+++ b/xinstall.c
@@ -55,16 +55,14 @@ install(const char *s1, const char *s2, int depth)
}
if (concat(f1, s1, f2, s2) < 0)
exit(1);
-
if (fchmod(f2, mode) < 0)
eprintf("fchmod %s:", s2);
+   if (fchown(f2, owner, group) < 0)
+   eprintf("lchown %s:", s2);
 
close(f1);
close(f2);
 
-   if (lchown(s2, owner, group) < 0)
-   eprintf("lchown %s:", s2);
-
return 0;
 }