svn commit: samba r2102 - in branches/SAMBA_4_0/source/libcli/util: .

tridge at samba.org tridge at samba.org
Mon Aug 30 05:33:50 GMT 2004


Author: tridge
Date: 2004-08-30 05:33:49 +0000 (Mon, 30 Aug 2004)
New Revision: 2102

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/libcli/util&rev=2102&nolog=1

Log:
fixed a race condition when handling dos errors that are in our
table. Should get rid of the static buffer completely at some point.


Modified:
   branches/SAMBA_4_0/source/libcli/util/doserr.c


Changeset:
Modified: branches/SAMBA_4_0/source/libcli/util/doserr.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/util/doserr.c	2004-08-30 05:32:00 UTC (rev 2101)
+++ branches/SAMBA_4_0/source/libcli/util/doserr.c	2004-08-30 05:33:49 UTC (rev 2102)
@@ -22,13 +22,12 @@
 
 #include "includes.h"
 
-typedef const struct
-{
+struct werror_code_struct {
 	const char *dos_errstr;
 	WERROR werror;
-} werror_code_struct;
+};
 
-werror_code_struct dos_errs[] =
+static const struct werror_code_struct dos_errs[] =
 {
 	{ "WERR_OK", WERR_OK },
 	{ "WERR_BADFILE", WERR_BADFILE },
@@ -79,8 +78,6 @@
         static pstring msg;
         int idx = 0;
 
-	slprintf(msg, sizeof(msg), "DOS code 0x%08x", W_ERROR_V(werror));
-
 	while (dos_errs[idx].dos_errstr != NULL) {
 		if (W_ERROR_V(dos_errs[idx].werror) == 
                     W_ERROR_V(werror))
@@ -88,5 +85,7 @@
 		idx++;
 	}
 
+	slprintf(msg, sizeof(msg), "DOS code 0x%08x", W_ERROR_V(werror));
+
         return msg;
 }



More information about the samba-cvs mailing list