> > o Please shorten any long line or comment to less than 80 columns
> 
> This is quite tricky when using 8 character tabs.  Is 4 character indent
> okay for userland source?

"Real" tabs are best. Look at style(9) for ways to break the long
lines.

        It is ok to break very long
            lines like this;

> > o Please do not use mktemp(); use mkstemp() instead.
> 
> I used mktemp() to get a filename to redirect to, eg.
> 
> /* Improvised example */
> char *cmd;
> asprintf(cmd, "prog > %s", mktemp(blah));
> system(cmd);
> free(cmd);

BIG security hole. Someone can exploit a race to compromise this.

> I couldn't see a simple way around this, any clues?

How's this?

int handle;
template = "/tmp/mumbleXXXXXXXX";
char *cmd;
handle = mkstemp(template); // template is modified
asprintf(cmd, "prog > %s", template);
system(cmd);
close(handle); // bye-bye file

M
-- 
o       Mark Murray
\_
O.\_    Warning: this .sig is umop ap!sdn

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to