Setting permissions without setting owner and group can have rather
inconvenient results. See this example with latest code:
$ touch test
$ chgrp wheel test
$ chmod g+w test
$ ls -l test
-rw-rw-r-- 1 tobias wheel 0 Mar 31 20:05 test
$ ./sort -o test test
$ ls -l test
-rw-rw-r-- 1 tobias tobia
On Mon, Mar 30, 2015 at 02:29:51PM -0600, Todd C. Miller wrote:
> On Mon, 30 Mar 2015 20:05:38 +0200, Alexander Bluhm wrote:
>
> > If an outfile exists but is not an infile, permissions are preserved.
> > If an outfile exists and is also an infile, it gets 666 & ~umask.
> > Do we want this inconsi
On Mon, 30 Mar 2015 20:05:38 +0200, Alexander Bluhm wrote:
> If an outfile exists but is not an infile, permissions are preserved.
> If an outfile exists and is also an infile, it gets 666 & ~umask.
> Do we want this inconsistency?
That's what the old sort did. It looks like GNU sort preserves t
On Mon, Mar 30, 2015 at 10:20:33AM -0600, Todd C. Miller wrote:
> I like this even better as it gets rid of the predictable temp file
> name. I also removed some useless dynamic allocations. The temp
> file handling in sort is still rather bad but at least this fixes
> the -o flag.
If an outfile
I like this even better as it gets rid of the predictable temp file
name. I also removed some useless dynamic allocations. The temp
file handling in sort is still rather bad but at least this fixes
the -o flag.
- todd
Index: usr.bin/sort/sort.c
=
How about this instead? It is more or less equivalent to what the
old sort did.
- todd
Index: file.c
===
RCS file: /cvs/src/usr.bin/sort/file.c,v
retrieving revision 1.3
diff -u -r1.3 file.c
--- file.c 20 Mar 2015 00:26:38 -00
On Mon, Mar 30, 2015 at 04:48:55PM +0200, Alexander Bluhm wrote:
> On Mon, Mar 30, 2015 at 08:59:16AM +0200, Otto Moerbeek wrote:
> > If you call umask(2), it's better to reset it to the old value after
> > you're done.
>
> I reset the umask immediately after reading it. I only need the
> curre
On Mon, Mar 30, 2015 at 08:59:16AM +0200, Otto Moerbeek wrote:
> If you call umask(2), it's better to reset it to the old value after
> you're done.
I reset the umask immediately after reading it. I only need the
current value to use it in chmod.
> But it's likely better to fchmod the file whil
On Sun, Mar 29, 2015 at 09:50:48PM +0200, Alexander Bluhm wrote:
> Hi,
>
> While doing make makesum in the ports framework, I realized that
> the distinfo file always gets permissions 0600. It uses sort -o
> in a way that the output file will overwrite the input file. In
> this case, sort creat
Hi,
While doing make makesum in the ports framework, I realized that
the distinfo file always gets permissions 0600. It uses sort -o
in a way that the output file will overwrite the input file. In
this case, sort creates a temp file with 0600 and replaces the
output file at the end.
I would lik
10 matches
Mail list logo