オープンソース・ソフトウェアの開発とダウンロード

Subversion リポジトリの参照

Diff of /trunk/1.7.x/ccs-patch/security/ccsecurity/realpath.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1330 by kumaneko, Wed Jun 25 06:31:25 2008 UTC revision 1379 by kumaneko, Thu Jul 10 06:52:35 2008 UTC
# Line 5  Line 5 
5   *   *
6   * Copyright (C) 2005-2008  NTT DATA CORPORATION   * Copyright (C) 2005-2008  NTT DATA CORPORATION
7   *   *
8   * Version: 1.6.2   2008/06/25   * Version: 1.6.3-pre   2008/07/10
9   *   *
10   * This file is applicable to both 2.4.30 and 2.6.11 and later.   * This file is applicable to both 2.4.30 and 2.6.11 and later.
11   * See README.ccs for ChangeLog.   * See README.ccs for ChangeLog.
# Line 191  static int get_absolute_path(struct dent Line 191  static int get_absolute_path(struct dent
191  int ccs_realpath_from_dentry2(struct dentry *dentry, struct vfsmount *mnt,  int ccs_realpath_from_dentry2(struct dentry *dentry, struct vfsmount *mnt,
192                                char *newname, int newname_len)                                char *newname, int newname_len)
193  {  {
194          int error;          int error = -EINVAL;
195          struct dentry *d_dentry;          struct dentry *d_dentry;
196          struct vfsmount *d_mnt;          struct vfsmount *d_mnt;
197          if (!dentry || !mnt || !newname || newname_len <= 2048)          if (!dentry || !newname || newname_len <= 2048)
198                  return -EINVAL;                  goto out;
199  #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22)  #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22)
200          if (dentry->d_op && dentry->d_op->d_dname) {          if (dentry->d_op && dentry->d_op->d_dname) {
201                  /* For "socket:[\$]" and "pipe:[\$]". */                  /* For "socket:[\$]" and "pipe:[\$]". */
# Line 235  int ccs_realpath_from_dentry2(struct den Line 235  int ccs_realpath_from_dentry2(struct den
235                  goto out;                  goto out;
236          }          }
237  #endif  #endif
238            if (!mnt)
239                    goto out;
240          d_dentry = dget(dentry);          d_dentry = dget(dentry);
241          d_mnt = mntget(mnt);          d_mnt = mntget(mnt);
242          /***** CRITICAL SECTION START *****/          /***** CRITICAL SECTION START *****/
# Line 250  int ccs_realpath_from_dentry2(struct den Line 252  int ccs_realpath_from_dentry2(struct den
252          /***** CRITICAL SECTION END *****/          /***** CRITICAL SECTION END *****/
253          dput(d_dentry);          dput(d_dentry);
254          mntput(d_mnt);          mntput(d_mnt);
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22)  
255   out:   out:
 #endif  
256          if (error)          if (error)
257                  printk(KERN_WARNING "ccs_realpath: Pathname too long.\n");                  printk(KERN_WARNING "ccs_realpath: Pathname too long. (%d)\n",
258                           error);
259          return error;          return error;
260  }  }
261    

Legend:
Removed from v.1330  
changed lines
  Added in v.1379

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26