~ubuntu-branches/ubuntu/maverick/mysql-5.1/maverick-proposed

« back to all changes in this revision

Viewing changes to sql/sql_udf.cc

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 14:16:05 UTC
  • mto: This revision was merged to the branch mainline in revision 20.
  • Revision ID: package-import@ubuntu.com-20120222141605-nxlu9yzc6attylc2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2000 MySQL AB
 
1
/*
 
2
   Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
2
3
 
3
4
   This program is free software; you can redistribute it and/or modify
4
5
   it under the terms of the GNU General Public License as published by
11
12
 
12
13
   You should have received a copy of the GNU General Public License
13
14
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
 
16
*/
15
17
 
16
18
/* This implements 'user defined functions' */
17
19
 
173
175
 
174
176
      On windows we must check both FN_LIBCHAR and '/'.
175
177
    */
176
 
    if (my_strchr(files_charset_info, dl_name,
177
 
                  dl_name + strlen(dl_name), FN_LIBCHAR) ||
178
 
        IF_WIN(my_strchr(files_charset_info, dl_name,
179
 
                         dl_name + strlen(dl_name), '/'), 0) ||
 
178
    if (check_valid_path(dl_name, strlen(dl_name)) ||
180
179
        check_string_char_length(&name, "", NAME_CHAR_LEN,
181
180
                                 system_charset_info, 1))
182
181
    {
416
415
    Ensure that the .dll doesn't have a path
417
416
    This is done to ensure that only approved dll from the system
418
417
    directories are used (to make this even remotely secure).
419
 
 
420
 
    On windows we must check both FN_LIBCHAR and '/'.
421
418
  */
422
 
  if (my_strchr(files_charset_info, udf->dl,
423
 
                udf->dl + strlen(udf->dl), FN_LIBCHAR) ||
424
 
      IF_WIN(my_strchr(files_charset_info, udf->dl,
425
 
                       udf->dl + strlen(udf->dl), '/'), 0))
 
419
  if (check_valid_path(udf->dl, strlen(udf->dl)))
426
420
  {
427
421
    my_message(ER_UDF_NO_PATHS, ER(ER_UDF_NO_PATHS), MYF(0));
428
422
    DBUG_RETURN(1);