9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] devenv
@ 2012-02-25  3:33 cinap_lenrek
  2012-02-25  4:07 ` erik quanstrom
  0 siblings, 1 reply; 3+ messages in thread
From: cinap_lenrek @ 2012-02-25  3:33 UTC (permalink / raw)
  To: 9fans

devwalk() gets in a endless loop when envgen() truncates the
Dir.name (because it doesnt fit in up->genbuf) from create().

echo A >/env/AAAAAAA.... #(128 A's, works)

echo A >/env/AAAAAAA.... #(128 A's again, now process spins in kernel mode and never returns)

--
cinap




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

* Re: [9fans] devenv
  2012-02-25  3:33 [9fans] devenv cinap_lenrek
@ 2012-02-25  4:07 ` erik quanstrom
  2012-02-25 11:35   ` Charles Forsyth
  0 siblings, 1 reply; 3+ messages in thread
From: erik quanstrom @ 2012-02-25  4:07 UTC (permalink / raw)
  To: 9fans

; diffy -c ../port/portdat.h
/n/dump/2012/0224/sys/src/9/port/portdat.h:701,707 - ../port/portdat.h:701,707
  	char	*errstr;	/* reason we're unwinding the error stack, errbuf1 or 0 */
  	char	errbuf0[ERRMAX];
  	char	errbuf1[ERRMAX];
- 	char	genbuf[128];	/* buffer used e.g. for last name element from namec */
+ 	char	genbuf[ERRMAX];	/* buffer used e.g. for last name element from namec */
  	Chan	*slash;
  	Chan	*dot;

; diffy -c ../port/devenv.c
/n/dump/2012/0224/sys/src/9/port/devenv.c:8,13 - ../port/devenv.c:8,14
  enum
  {
  	Maxenvsize = 16300,
+ 	Maxename = ERRMAX-1,		/* sizeof(Proc->genbuf) */
  };

  static Egrp	*envgrp(Chan *c);
/n/dump/2012/0224/sys/src/9/port/devenv.c:146,151 - ../port/devenv.c:147,154

  	if(c->qid.type != QTDIR)
  		error(Eperm);
+ 	if(strlen(name) > Maxename)
+ 		error("name too long");

  	omode = openmode(omode);
  	eg = envgrp(c);



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

* Re: [9fans] devenv
  2012-02-25  4:07 ` erik quanstrom
@ 2012-02-25 11:35   ` Charles Forsyth
  0 siblings, 0 replies; 3+ messages in thread
From: Charles Forsyth @ 2012-02-25 11:35 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

just say
        if(strlen(name) >= sizeof(up->genbuf))
           error("name too long");
if that's where they are going.



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

end of thread, other threads:[~2012-02-25 11:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-25  3:33 [9fans] devenv cinap_lenrek
2012-02-25  4:07 ` erik quanstrom
2012-02-25 11:35   ` Charles Forsyth

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).