0) {
| lookup_record(T_A, *(ap) + 2, dispatch_a);
| + lookup_record(T_, *(ap) + 2, dispatch_);
| continue;
| }
| if (strncasecmp("exists:", *ap, 7) == 0) {
--
Todd T. Fries . http://todd.fries.net/pgp.txt . @unix2mars . github:toddfries
On Sat, 13 Oct 2018 21:16:10 -0600, "Todd C. Miller" wrote:
> I think it is safest to use user_from_uid, uid_from_user, group_from_gid
> and gid_from_group in all places where the return value of getpw*
> and getgr* is unused.
Updated diff that adds wrapper functions for i
other flags that use getpw{nam,uid}.
I think it is safest to use user_from_uid, uid_from_user, group_from_gid
and gid_from_group in all places where the return value of getpw*
and getgr* is unused.
- todd
Index: usr.sbin/user/user.c
ntroduced in rev 1.21. I agree with your analysis
and that fix looks correct.
- todd
t;el_cursor.h++]
> = MB_FILL_CHAR;
Shouldn't the NUL character come after filling with MB_FILL_CHAR?
Otherwise, it may still be unterminated.
- todd
On Sun, 07 Oct 2018 17:08:06 +0200, Marc Espie wrote:
> Specifically, the only part that cares about
> locale is sort, and it's definitely correct in fixing
> it's not run on an utf-8 file.
Agreed. How about the following?
- todd
Index: usr.bin/locate/l
; || next == '\t')
I agree with your analysis. Thank you for taking the time to
determine the author's intent instead of blindly trusting the static
analyzer.
- todd
gt; across databases.
One comment inline, otherwise OK millert@
- todd
> Index: getent.c
> ===
> RCS file: /cvs/src/usr.bin/getent/getent.c,v
> retrieving revision 1.18
> diff -u -p -r1.18 getent.c
> --- getent.c
e fix
> is a matter of changing getpwnam(3) to uid_from_user(3).
OK millert@
- todd
On Tue, 25 Sep 2018 21:43:41 +0200, Klemens Nanni wrote:
> OK?
I think you should use __dead here too. E.g.
static void __dead usage(void);
- todd
> Index: getent.c
> ===
> RCS file: /cvs/src/usr.bin/geten
rrect in thinking that the veil is not activated for group,
hosts and passwd?
- todd
any
reason why Ricardo's diff can't go in.
I wonder if we can do unveil(NULL, NULL) for getent databases without
an explicit file. A quick test seems to work for dns.
- todd
nly support passwd, group and ethers via YP.
Someone more familiar with YP should probably chime in.
- todd
t appears the getpw pledge should unveil
what is needed for YP. Note that the ethers database can also be
stored YP.
- todd
I doubt this will work on systems using YP or ypldap.
- todd
That syntax makes sense to be and I didn't notice any problems in
the diff. OK millert@
- todd
evision 1.23 (2006).
OK millert@
- todd
== NULL" check out of the
first if() clause now that it can be true in either case.
Found by clang analyzer.
- todd
Index: bin/csh/dir.c
===
RCS file: /cvs/src/bin/csh/dir.c,v
retrieving revision 1.21
diff -u -p -u -r1.21 dir.c
On Tue, 18 Sep 2018 11:51:26 -0600, "Todd C. Miller" wrote:
> To use strchr(3) here we either need mask the char value with 0xff
> or figure out why asyntax() is calling any() with a char value of
> -32768.
The -32768 comes from a Char with the QUOTE bit set.
This gets sign-ex
nge [0, 255]. This causes
unexpected behavior with the i386 assembler version of strchr(3).
To use strchr(3) here we either need mask the char value with 0xff
or figure out why asyntax() is calling any() with a char value of
-32768.
- todd
t;???";
>
> either way ok.
The "???" is not terribly useful. I think it is better to use the
uid of the user writing to the tty. Either way, this is a code
path unlikely to be exercised.
- todd
On Mon, 17 Sep 2018 23:55:32 +0800, Michael Mikonos wrote:
> In csh(1) the functions Malloc(), Calloc() & Reallocarray()
> are always called via the macros (which don't really do anything).
> This patch renames the functions and deletes the macros.
> Does this look OK?
OK millert@
- todd
Two more pontential places where user_from_uid(3) makes sense.
These were in my large diff but got lost chopping it up into smaller
pieces.
- todd
Index: usr.bin/write/write.c
===
RCS file: /cvs/src/usr.bin/write/write.c,v
Since we store each entry 3 times the estimate of the number of
elements needs to be 3x the number of entries.
Also set the bucket size to be the optimal file system block size
instead of hard-coding to 4096.
- todd
Index: usr.sbin/pwd_mkdb/pwd_mkdb.c
On Mon, 17 Sep 2018 15:53:06 +0200, Martijn van Duren wrote:
> It should be safe. There are 5 instances where any() isn't called with
> a string literal:
Thanks for checking. OK millert@ for the diff.
- todd
Any rdist users out there? The way rdist does group caching (stash
the struct group pointer) will stop working in the future so I'd
like to get these changes in before then.
- todd
On Thu, 13 Sep 2018 13:24:49 -0600, "Todd C. Miller" wrote:
> Use password/group cache f
We can use uid_from_user(3) and gid_from_group(3) in utilities that
do repeated passwd/group lookups.
This is the final diff.
- todd
Index: bin/chmod/chmod.c
===
RCS file: /cvs/src/bin/chmod/chmod.c,v
retrieving revision 1.42
diff
there are actual calls to any()
with a NULL string (most use a constant string) but this needs to
be checked before committing.
- todd
On Fri, 14 Sep 2018 22:30:26 +0800, Michael Mikonos wrote:
> Your patch was better. Here is a version with the function renamed
> and const added to the param list to match strdup(3).
Looks good. OK millert@
- todd
On Thu, 13 Sep 2018 10:47:35 -0600, "Todd C. Miller" wrote:
> Use the passwd/group cache functions in mtree(1) to avoid repeatedly
> looking up the same user/group. The passwd and group files are
> kept open too.
I sent out and older version of the diff that was missing some
On Mon, 10 Sep 2018 12:32:01 -0600, "Todd C. Miller" wrote:
> This diff replaces calls to getpwuid/getgrgid with
> uid_from_user/gid_from_group and fixes warnings caused by the
> user_from_uid/group_from_gid return value change to const char *.
>
> I've also cha
lets us make better use of the gid
cache. I've also made the tilde expansion in expand.c use exptilde().
This needs further testing by someone who actually uses rdist.
- todd
Index: usr.bin/rdist/common.c
===
RCS file: /cv
Use user_from_uid(3) and group_from_gid(3) in a few more places
that do repeated lookups.
- todd
Index: sbin/fsck_ext2fs/inode.c
===
RCS file: /cvs/src/sbin/fsck_ext2fs/inode.c,v
retrieving revision 1.27
diff -u -p -u -r1.27
Use user_from_uid(3) and group_from_gid(3) to avoid extra passwd
and group file lookups. This required a bit of reordering of the
file mode handling bits to deal with the const char *.
- todd
Index: usr.bin/stat/stat.c
===
RCS
Use the passwd/group cache functions in mtree(1) to avoid repeatedly
looking up the same user/group. The passwd and group files are
kept open too.
Index: usr.sbin/mtree/create.c
===
RCS file: /cvs/src/usr.sbin/mtree/create.c,v
retrie
Replace the local getname() and getuserid() functions with calls
to user_from_uid(3) and uid_from_user(3). This requires sprinkling
const in a few places but is otherwise mechanical.
- todd
Index: usr.bin/mail/Makefile
===
RCS
Thanks for the feedback, here's an updated diff that eliminates
pwcache.h, gracefully handles table allocation failure and massages
the comments to be a bit more general.
I can take a look at supporting arbitrary length names in the future.
- todd
Index: include/
larger than 4096. The default db
behavior is to use st_blksize if no bsize is specified so we could
just set bsize to 0 instead.
Opinions? NetBSD has an option for pwd_mkdb to set the cache size
on the command line but I'd rather just have better default behavior.
- todd
Index: usr
I can break the warning fixes out into a separate diff.
- todd
Index: bin/chmod/chmod.c
===
RCS file: /cvs/src/bin/chmod/chmod.c,v
retrieving revision 1.42
diff -u -p -u -r1.42 chmod.c
--- bin/chmod/chmod.c 28 May 2017 08:03:36
This removes cache.c from pax in favor of using the new uid_from_user()
and gid_from_group() functions in libc. I've added explicit calls
to setpassent() and setgroupent() since they are no longer implicitly
called.
- todd
Index: bin/pax/Mak
ectly. This is consistent
with rev 1.10 of pwcache.c.
The new functions can be used to speed up repeated user -> uid
lookups in mtree, newsyslog and others. Those diffs will be sent
separately.
- todd
Index: include/pwd.h
===
RCS fi
On Thu, 23 Aug 2018 11:24:54 -0500, Scott Cheloha wrote:
> On Tue, Aug 14, 2018 at 03:11:47PM -0500, Scott Cheloha wrote:
> > This patch is ok cheloha@ and I can commit if someone else
> > is ok, too.
>
> 1 week bump. Anyone else ok?
OK millert@
- todd
I agree that the sentence about the
pid file should be removed as well.
- todd
close(env->sc_snmp);
> env->sc_snmp = -1;
> }
>
> But env has been initialized with 0 by calloc(3). It has to be set
> to -1 to make the logic work.
OK millert@
- todd
c from the pre-libevent days. OK millert@
- todd
On Fri, 31 Aug 2018 17:12:50 +0200, Christian Weisgerber wrote:
> In the pkill man page, clarify that the patterns are EXTENDED regular
> expressions. I shouldn't have to guess, try, or look at the source
> for this.
OK millert@
- todd
Penned by Theo de Raadt on 20180823 14:22.46, we have:
| Mike Larkin wrote:
|
| > On Thu, Aug 23, 2018 at 11:05:40AM -0500, Todd T. Fries wrote:
| > > This makes me wonder. Does it make sense to support booting a kernel
without
| > > disks? Some people have heard of the p
if (kernel == NULL && ndisks == 0)
| - errx(1, "no kernel or disk specified");
| + if (kernel == NULL && ndisks == 0 && !iso)
| + errx(1, "no kernel or disk/cdrom specified");
| if (nnics == -1)
|
th wpath cpath fattr flock", this has
> been tested directly and also via vipw(8).
OK millert@
- todd
the error in case the addressed mapped already exists but
> can be changed back in case ...).
Does anyone other than FreeBSD define MAP_EXCL? A quick google
search didn't turn up any other systems with it.
- todd
doesn't explicitly say it is supported, and since there
are better APIs for this anyway I think removing the text makes
sense.
OK millert@
- todd
On Wed, 15 Aug 2018 09:27:24 -0500, Scott Cheloha wrote:
> Use dprintf for the DEFAULT_MESG string instead of the more awkward
> write+strlen combo.
I don't object to this but I also wouldn't object to rewriting
nologin.c to use stdio.
- todd
On Tue, 07 Aug 2018 17:15:58 +0200, Frederic Cambus wrote:
> Since rev 1.36, the instance variable is never read again so we can
> simply drop the else clause with the assignment.
OK millert@
- todd
/* transition wait */
| #define IEEE80211_INACT_WAIT5 /* inactivity timer
interval */
| #define IEEE80211_INACT_MAX (300/IEEE80211_INACT_WAIT)
| -#define IEEE80211_CACHE_SIZE100
| +
| #define IEEE80211_CACHE_WAIT30
|
| struct ieee80211_rateset {
--
Todd T. Fries . http://todd.fries.net/pgp.txt . @unix2mars . github:toddfries
e
difficult but our acme-client has changed enough that this may not
be an issue.
- todd
er?
I think this is safe on any 2s-complement machine unless sizeof(ssize_t)
< sizeof(size_t). I wouldn't worry about it.
- todd
wl the man pages for
existing Xr's of glob(3) that could be converted to glob(7).
OK millert@
- todd
t you get to choose the colour of the bikeshed, OK either way.
Good idea. I made that change and committed.
- todd
On Tue, 17 Jul 2018 13:21:31 -0600, "Todd C. Miller" wrote:
> It probably makes more sense to do the newline check (and decrement
> len if one is present) before newsize is computed. Then you would
> need to unconditionally NUL-terminate lp->line.
Perhaps something like
On Tue, 17 Jul 2018 19:39:16 +0300, Lauri Tirkkonen wrote:
> while porting join(1) to Unleashed OS (which does not have fgetln(3)) I
> came up with the following. Since the fgetln man page advises against
> using it, I thought OpenBSD might want this diff too.
Looks good. One minor comment inlin
I'm open to a better description but it is hard to describe the
behavior of both modes without being overly generic.
Perhaps simply:
.Nd rebuild mail aliases
- todd
Now that aliases in smtpd.conf default to plain text files and not
db files we don't want to tell people to run makemap instead of
newaliases.
- todd
Index: usr.sbin/smtpd/newaliases.8
===
RCS file: /cvs/src/usr.sbin/
On Fri, 13 Jul 2018 13:00:59 +0100, Ricardo Mestre wrote:
> This one looks better
OK millert@
- todd
On Sun, 24 Jun 2018 01:50:49 -0300, Gleydson Soares wrote:
> calloc() already filled all the memory block to 0, zap memset().
OK millert@
- todd
is nic.africa
Makes sense. OK millert@
- todd
_class from:
> unbalanced brackets ([])
> to:
> brackets ([ ]) not balanced
OK millert@
- todd
On Sun, 17 Jun 2018 15:52:34 -0600, "Todd C. Miller" wrote:
> On Sun, 17 Jun 2018 17:29:31 +0200, Mark Kettenis wrote:
>
> > If folks indeed think that this is a must-have feature, this is
> > certainly a better approach. I wonder though if the setupterm() call
&g
pler than expected. Now whenever TERM is
set (including at startup) it will call setupterm().
- todd
Index: bin/ksh/Makefile
===
RCS file: /cvs/src/bin/ksh/Makefile,v
retrieving revision 1.38
diff -u -p -u -r1.38 Makefile
--- bin/ksh/Make
On Sat, 16 Jun 2018 12:41:12 -0700, Il Ka wrote:
> > alternative that doesn't require linking ksh with
> > curses?
>
> I'm curious, is it possible to use termcap/terminfo directly here?
My recent diffs use the terminfo api rather than full-blown curses
but it is all the same library.
- todd
s all just libcurses. Since ksh is statically
linked we only pull in the bits we need anyway.
> The man page needs to be adjusted now that you no longer call clear(1).
I will do that if we agree this is the way forward.
- todd
On Sat, 16 Jun 2018 16:16:57 -0600, "Todd C. Miller" wrote:
> On Sat, 16 Jun 2018 14:50:40 +0200, Mark Kettenis wrote:
>
> > To be honest, I find the whole idea of invoking an external program to
> > clear the screen insane.
>
> Linking with curses doesn'
dec hex
529120 12584 57024 598728 922c8 /bin/ksh
595671 21904 57024 674599 a4b27 ./obj/ksh
- todd
Index: bin/ksh/Makefile
===
RCS file: /cvs/src/bin/ksh/Makefile,v
retrieving revision 1.38
diff -u -p -u -r1.38 Makef
On Sat, 16 Jun 2018 14:50:40 +0200, Mark Kettenis wrote:
> To be honest, I find the whole idea of invoking an external program to
> clear the screen insane.
Do you have an alternative that doesn't require linking ksh with
curses?
- todd
ror actions would be.
>
> It's quite possible there already exists a better function to call
> within the ksh code already, but I was unable to figure out which if so.
Using system() within ksh seems wrong. How about this instead?
This is an oft-requested feature. The diff looks good, I've made
some minor comments in-line.
- todd
On Mon, 11 Jun 2018 20:23:11 -, Job Snijders wrote:
> diff --git usr.sbin/cron/crontab.5 usr.sbin/cron/crontab.5
> index 9c2e651980a..700010faadf 100644
> --- usr.sbin/
On Tue, 12 Jun 2018 13:29:08 -, David CARLIER wrote:
> here a little patch proposal for xargs command line.
That fix is correct. I'll commit it unless there are objections.
- todd
On Wed, Jun 06, 2018 at 03:57:44PM +0800, Nan Xiao wrote:
> Hi tech@,
>
> The following patch fixes the build warning:
Committed, thanks!
>
> ..
>
> variable 'CFIIndex' [-Wunused-variable]
> unsigned CFIIndex;
>^
> 1 warning generated.
>
>
> Index: X86FrameLowering.cpp
> ==
libraries and get the
> information.
Or just run clear(1). That may be preferable to linking ksh with
libcurses.
- todd
nyway. This seems like an
improvement.
> This change doesn't require any userspace recompilation for inspecting
> a live kernel: on reboot -lkvm binaries behave as expected.
Great. I was worried that consumers of p_ustart_{sec,usec} would
need to change but I can see that is not the case.
- todd
New clang warns about some differences between Elf64_Addr (aka
uint64) and Elf32_Addr (aka uint32) and the format type provided for
these values in the debug output from distrib/common/elfrd_size.c. The
same code is used when compiling both 32 and 64 bit versions, so we used
ptrdiff_t to get size s
On Thu, 24 May 2018 16:38:17 -0400, Rupert Gallagher wrote:
> It may solve some obscure technical problem, but is a horrible thing
> to read and write. How about keeping the best of both worlds? Leave
> the old beautiful PF-like syntax to humans, and translate it into
> the newEgyptian(tm) on the
That does sound nicer.
- todd
On Tue, 15 May 2018 20:57:02 +0200, Marco Pfatschbacher wrote:
> I think it's time to remove this artifact from 1996.
Agreed. OK millert@
- todd
eps. As the loop in vfs_stall() does not destroy the
> mount point, TAILQ_FOREACH_REVERSE without _SAVE is the correct
> macro to use.
I think this deserves a comment so someone else doesn't try to "fix"
it later.
- todd
at can be a separate commit.
- todd
uot; changed to "ptrdiff_t off", as it should be.
> If I understand things correctly, we're lucky that this didn't
> strike us on 64-bit archs yet. The is needed only
> for the ptrdiff_t.
Looks good, OK millert@
- todd
; I think (b) would be the better solution, this seems very fragile.
>
> Todd and Guenther -- what do you think?
I'd prefer separate buffer spaces as well, the current situation is
fragile as we've seen.
- todd
On Tue, 17 Apr 2018 09:50:49 +0200, Martin Pieuchot wrote:
> Sure, here's an updated diff. It also moves the FRELE(9) in the error
> loop down as suggested by visa@.
OK millert@
- todd
FRELE(fp, p);
to the fail label? If we get to fail, fp is either NULL or needs to
drop a reference.
- todd
On Fri, 13 Apr 2018 19:42:51 +0200, Jeremie Courreges-Anglas wrote:
> The diff uses timespecsub:
Ah, OK. That's fine then.
- todd
for some
of the time-related macros.
- todd
On Mon, 09 Apr 2018 11:56:46 -0500, Scott Cheloha wrote:
> Always nifty:
>
> $ video -f '%d%d%d'
> video: 31668978116843009-2139062144: No such file or directory
>
> So, use strlcpy and check for truncation.
>
> ok?
OK millert@
- todd
~~
> --8<--
>
> Full log at:
>
> https://junkpile.org/p/failures/i386-20180407/archivers/fuse-zip.log
>
> Proposed fix below. ok?
OK millert@
- todd
On Sat, 07 Apr 2018 10:46:01 +0200, Anton Lindqvist wrote:
> Since patch(1) no longer invokes ed(1), pathnames.h can be removed.
> _PATH_TMP is still used inside patch.c but including paths.h is
> sufficient.
OK millert@
- todd
y makes more
sense in context.
That said, as long as the comments are preserved (as you do), I
have no objection to simplifying the loops this way. As you say,
the "a > b ||" bit doesn't have any effect.
- todd
ill be line-buffered so the output doesn't really get garbled.
- todd
original easier to read, but maybe I am in the
minority. Personally, I'd prefer the "goto done" idiom over a bunch
of nested if() statements.
- todd
On Mon, 02 Apr 2018 12:34:27 +0200, Martin Pieuchot wrote:
> Here's a diff to move FREF() just after fd_getfile() in sys_kevent(),
> sys_lseek() and getvnode().
Looks fine. OK millert@
- todd
n dprintf() is BUFSIZ (1024) which should be plenty.
- todd
On Sat, 31 Mar 2018 15:15:34 -0400, David Hill wrote:
> Add the free size. (allocated in mfs_vfsops.c)
>
> mfsp = malloc(sizeof *mfsp, M_MFSNODE, M_WAITOK | M_ZERO);
> devvp->v_data = mfsp;
OK millert@
- todd
701 - 800 of 1653 matches
Mail list logo