Whamcloud - gitweb
LU-5304: do not memset after LIBCFS_ALLOC
[fs/lustre-release.git] / libcfs / libcfs / linux / linux-module.c
index 127b1d3..f98ba64 100644 (file)
@@ -137,7 +137,7 @@ static long libcfs_ioctl(struct file *file,
        struct cfs_psdev_file    pfile;
        int    rc = 0;
 
-       if (current_fsuid() != 0)
+       if (!capable(CAP_SYS_ADMIN))
                return -EACCES;
 
        if ( _IOC_TYPE(cmd) != IOC_LIBCFS_TYPE ||
@@ -151,12 +151,12 @@ static long libcfs_ioctl(struct file *file,
        /* Handle platform-dependent IOC requests */
        switch (cmd) {
        case IOC_LIBCFS_PANIC:
-               if (!cfs_capable(CAP_SYS_BOOT))
+               if (!cfs_capable(CFS_CAP_SYS_BOOT))
                        return (-EPERM);
                panic("debugctl-invoked panic");
                return (0);
        case IOC_LIBCFS_MEMHOG:
-               if (!cfs_capable(CAP_SYS_ADMIN))
+               if (!cfs_capable(CFS_CAP_SYS_ADMIN))
                        return -EPERM;
                /* go thought */
        }