edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
* [Edbrowse-dev] wordexp
@ 2014-12-28 21:45 Karl Dahlke
  2014-12-29  0:25 ` Adam Thompson
  0 siblings, 1 reply; 6+ messages in thread
From: Karl Dahlke @ 2014-12-28 21:45 UTC (permalink / raw)
  To: Edbrowse-dev

After some playing around with wordexp, I'm inclined to leave things alone.
wordexp just does too much.
Unbalanced parens or brackets or quotes or apostrophes
will produce a syntax error.
Here's a filename with one apostrophe in it.

#include <stdio.h>
#include <wordexp.h>
main()
{
wordexp_t w;
int rc;
rc = wordexp("isn't", &w, 0);
if(rc == WRDE_SYNTAX)
puts("syntax error");
}

And even if the quotes are balanced, they will be taken away from you.

#include <stdio.h>
#include <wordexp.h>
main()
{
wordexp_t w;
int rc;
rc = wordexp("is'n't", &w, 0);
puts(w.we_wordv[0]);
}

So many side effects that I'm sure people will be confused.
I already wrote the code and it's been working for years,
guess I'll leave it alone.

Karl Dahlke

^ permalink raw reply	[flat|nested] 6+ messages in thread
* [Edbrowse-dev] wordexp
@ 2014-12-30 11:10 Karl Dahlke
  2014-12-30 13:55 ` Adam Thompson
  0 siblings, 1 reply; 6+ messages in thread
From: Karl Dahlke @ 2014-12-30 11:10 UTC (permalink / raw)
  To: Edbrowse-dev

After considerable waffling, I decided to give wordexp a try
for variable expansion and globbing on file names.
Odds are, we won't notice any difference.
But at least it is somewhat standard now, and I got rid of a bunch of
#ifdef Windows dos unix code.
Some of the old code is still in there under #if 0,
and I'll get rid of that when I have confidence in the new system.

Speaking of old stuff, we'll have to decide when to delete
jsdom.cpp jsloc.cpp js.h.
That is, when are we committed to the new system?
Of course, thanks to git, you never really delete stuff,
you can always get it back if you want it.

Karl Dahlke

^ permalink raw reply	[flat|nested] 6+ messages in thread
* [Edbrowse-dev] wordexp
@ 2015-02-14  0:47 Chris Brannon
  0 siblings, 0 replies; 6+ messages in thread
From: Chris Brannon @ 2015-02-14  0:47 UTC (permalink / raw)
  To: edbrowse-dev

I recently learned that the wordexp function may have security issues on
some operating systems.
http://www.openwall.com/lists/oss-security/2015/02/11/3

So my question is this.  Are we passing any untrusted input to wordexp?
Or does it just expand filenames obtained from the user at the keyboard?

-- Chris

^ permalink raw reply	[flat|nested] 6+ messages in thread
* [Edbrowse-dev]  wordexp
@ 2015-02-14  1:51 Karl Dahlke
  0 siblings, 0 replies; 6+ messages in thread
From: Karl Dahlke @ 2015-02-14  1:51 UTC (permalink / raw)
  To: Edbrowse-dev

This is called to expand variables in file names that the user types in.
I really don't think it should be a problem.

Karl Dahlke

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-02-14  1:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-28 21:45 [Edbrowse-dev] wordexp Karl Dahlke
2014-12-29  0:25 ` Adam Thompson
2014-12-30 11:10 Karl Dahlke
2014-12-30 13:55 ` Adam Thompson
2015-02-14  0:47 Chris Brannon
2015-02-14  1:51 Karl Dahlke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).