Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Kernel v2.6.24 /fs/cifs/cifs_debug.c

Filename:/fs/cifs/cifs_debug.c
Lines Added:18
Lines Deleted:10
Also changed in: (Previous) 2.6.24-rc8  2.6.24-rc7  2.6.24-rc6  2.6.24-rc5  2.6.24-rc4  2.6.24-rc3 
(Following) 2.6.25-rc3-git6  2.6.25-rc4  2.6.25-rc5  2.6.25-rc6  2.6.25-rc7  2.6.25-rc8 

Location
[  2.6.24
  [  fs
    [  cifs
       o  cifs_debug.c

Patch

diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
index 1bf8cf5..73c4c41 100644
--- a/fs/cifs/cifs_debug.c
+++ b/fs/cifs/cifs_debug.c
@@ -209,13 +209,16 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset,
       i++;
       tcon = list_entry(tmp, struct cifsTconInfo, cifsConnectionList);
       dev_type = le32_to_cpu(tcon->fsDevInfo.DeviceType);
-      length =
-          sprintf(buf,
-             "\n%d) %s Uses: %d Type: %s DevInfo: 0x%x "
-             "Attributes: 0x%x\nPathComponentMax: %d Status: %d",
-             i, tcon->treeName,
-             atomic_read(&tcon->useCount),
-             tcon->nativeFileSystem,
+      length = sprintf(buf, "\n%d) %s Uses: %d ", i,
+             tcon->treeName, atomic_read(&tcon->useCount));
+      buf += length;
+      if (tcon->nativeFileSystem) {
+         length = sprintf(buf, "Type: %s ",
+                tcon->nativeFileSystem);
+         buf += length;
+      }
+      length = sprintf(buf, "DevInfo: 0x%x Attributes: 0x%x"
+             "\nPathComponentMax: %d Status: %d",
              le32_to_cpu(tcon->fsDevInfo.DeviceCharacteristics),
              le32_to_cpu(tcon->fsAttrInfo.Attributes),
              le32_to_cpu(tcon->fsAttrInfo.MaxPathNameComponentLength),
@@ -876,11 +879,16 @@ security_flags_write(struct file *file, const char __user *buffer,
    if (count < 3) {
       /* single char or single char followed by null */
       c = flags_string[0];
-      if (c == '0' || c == 'n' || c == 'N')
+      if (c == '0' || c == 'n' || c == 'N') {
          extended_security = CIFSSEC_DEF; /* default */
-      else if (c == '1' || c == 'y' || c == 'Y')
+         return count;
+      } else if (c == '1' || c == 'y' || c == 'Y') {
          extended_security = CIFSSEC_MAX;
-      return count;
+         return count;
+      } else if (!isdigit(c)) {
+         cERROR(1, ("invalid flag %c", c));
+         return -EINVAL;
+      }
    }
    /* else we have a number */
 


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.