CVS update: samba/source/include

Martin Pool mbp at samba.org
Mon Jan 14 17:15:08 EST 2002


Date:	Sun Jan 13 22:15:07 2002
Author:	mbp

Update of /data/cvs/samba/source/include
In directory va:/tmp/cvs-serv11067

Modified Files:
	smb.h 
Log Message:
PSTRING_SANCTIFY:

If you define this, pstring and fstring become distinguished types, so
that it's harder to accidentally overflow them by for example passing
an fstring on the lhs of pstrcpy.

The types are defined as one-element union arrays so that with
"fstring f" the name "f" will be a pointer and with a big hammer you
can cast it to (char *).  So code that tries to just use it directly
will get a loud warning, but hopefully nothing worse.

To pass them to non-pstring-aware functions, use PSTR and check that
the function takes a const.  They should almost never be modified
except by special calls.  In those unusual cases, use PSTR_MUTABLE.

This is off by default so as not to produce too many warnings.  As the
code is vetted it can become the default.


Revisions:
smb.h		1.402 => 1.403
	http://www.samba.org/cgi-bin/cvsweb/samba/source/include/smb.h?r1=1.402&r2=1.403




More information about the samba-cvs mailing list