Changeset: 651a689b1500 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=651a689b1500
Modified Files:
MonetDB5/src/modules/mal/mal_mapi.mx
Branch: Jun2010
Log Message:
do not silently truncate the socket file, but throw an error instead if it
doesn't fit
diffs (18 lines):
diff -r 1fd7a5999c1e -r 651a689b1500 MonetDB5/src/modules/mal/mal_mapi.mx
--- a/MonetDB5/src/modules/mal/mal_mapi.mx Mon Jul 26 12:25:54 2010 +0200
+++ b/MonetDB5/src/modules/mal/mal_mapi.mx Mon Jul 26 12:41:26 2010 +0200
@@ -740,6 +740,14 @@
OPERATION_FAILED ": creation of UNIX
socket failed: %s",
strerror(errno));
}
+
+ /* prevent silent truncation, sun_path is typically around 108
+ * chars long :/ */
+ if (strlen(usockfile) > sizeof(userver.sun_path))
+ throw(MAL, "mal_mapi.listen",
+ OPERATION_FAILED ": UNIX socket path
too long: %s",
+ usockfile);
+
userver.sun_family = AF_UNIX;
strncpy(userver.sun_path, usockfile, sizeof(userver.sun_path));
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list