Subject: Re: veriexec by default (Re: CVS commit: src/sys/arch)
To: None <elad@NetBSD.org>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: tech-kern
Date: 10/28/2006 13:29:25
> YAMAMOTO Takashi wrote:
> >> YAMAMOTO Takashi wrote:
> >>>> + char *pathbuf;
> >>>> + pathbuf = __UNCONST(ndp->ni_dirp);
> >>> why can't you make it const?
> >> I can. other than that, is it okay?
> >
> > yes, it seems better than the current code.
>
> if pathbuf is const, btw, I have to __UNCONST it when passing to
> copyinstr() and PNBUF_PUT() it seems. still okay? :)
const char *pathname;
char *buf;
:
:
if () {
buf = PNBUF_GET();
copyinstr(buf);
pathname = buf;
} else {
buf = NULL;
pathname = ndp->ni_dirp;
}
:
:
if (buf != NULL) {
PNBUF_PUT(buf);
}
YAMAMOTO Takashi