From owner-freebsd-security Mon Feb 3 17:56:04 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id RAA07186 for security-outgoing; Mon, 3 Feb 1997 17:56:04 -0800 (PST) Received: from spitfire.ecsel.psu.edu (qmailr@spitfire.ecsel.psu.edu [146.186.218.51]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id RAA07175 for ; Mon, 3 Feb 1997 17:56:01 -0800 (PST) Received: (qmail 29805 invoked by uid 1000); 4 Feb 1997 01:55:53 -0000 Date: 4 Feb 1997 01:55:53 -0000 Message-ID: <19970204015553.29804.qmail@spitfire.ecsel.psu.edu> To: security@freebsd.org Subject: more locale patches... From: Dan Cross Sender: owner-security@freebsd.org X-Loop: FreeBSD.org Precedence: bulk (NOTE: these patches are for 2.2...) Here are patches for more locate stuff from 2.2-CURRENT, well, it's not that current: : spitfire 1144; uname -a FreeBSD spitfire.ecsel.psu.edu 2.2-CURRENT FreeBSD 2.2-CURRENT #0: Sat Sep 28 16:39:56 EDT 1996 tenser@spitfire.ecsel.psu.edu:/usr/src/sys/compile/SPIT FIRE i386 : spitfire 1145; But they might help out nonetheless. Note that in setlocale.c, the sections that were changed are enclosed in #if 0's, marked with the comment, ``someday we might actually use the file.'' :-) I see no harm in changing that code now, however, in preperation for the future. :-) Thanks! - Dan C. (btw- I don't guarantee that this fixes every bug in the locale functions, but, it's a start. :-) ----- Begin locale.diff *** collate.c 1997/02/03 23:45:56 1.1 --- collate.c 1997/02/03 23:49:55 *************** *** 71,80 **** return 0; if (!_PathLocale && !(_PathLocale = getenv("PATH_LOCALE"))) _PathLocale = _PATH_LOCALE; ! strcpy(buf, _PathLocale); ! strcat(buf, "/"); ! strcat(buf, encoding); ! strcat(buf, "/LC_COLLATE"); if ((fp = fopen(buf, "r")) == NULL) { __collate_load_error = save_load_error; return -1; --- 71,78 ---- return 0; if (!_PathLocale && !(_PathLocale = getenv("PATH_LOCALE"))) _PathLocale = _PATH_LOCALE; ! (void)snprintf(buf, ! PATH_MAX, "%s/%s/LC_COLLATE", _PathLocale, encoding); if ((fp = fopen(buf, "r")) == NULL) { __collate_load_error = save_load_error; return -1; *** setrunelocale.c 1997/02/03 23:47:15 1.1 --- setrunelocale.c 1997/02/03 23:48:19 *************** *** 86,95 **** if (!_PathLocale && !(_PathLocale = getenv("PATH_LOCALE"))) _PathLocale = _PATH_LOCALE; ! (void) strcpy(name, _PathLocale); ! (void) strcat(name, "/"); ! (void) strcat(name, encoding); ! (void) strcat(name, "/LC_CTYPE"); if ((fp = fopen(name, "r")) == NULL) return(ENOENT); --- 86,93 ---- if (!_PathLocale && !(_PathLocale = getenv("PATH_LOCALE"))) _PathLocale = _PATH_LOCALE; ! (void)snprintf(name, ! PATH_MAX, "%s/%s/LC_CTYPE", _PathLocale, encoding); if ((fp = fopen(name, "r")) == NULL) return(ENOENT); ----- End locale.diff