>From: Eugene Exarevsky <zheka@xxxxxxxx>
>Hi!
>
>Here is some results of my playing with XFS DMAPI:
>
>1. libdm can't be compiled without inserting
>
>#define _LOOSE_KERNEL_NAMES
>#include <linux/types.h>
>
>before
>
>#include <linux/dmapi_kern.h>
>
>maybe, insert this lines into dmapi_kern.h ?
It's not clear why you are seeing this and I'm not. I'll get a proper
Makefile checked in for libdm. In the meantime I've included a copy of it at
the end of this note.
>2.
>After non-priveleged user called dmapi function that calls dm_query_fsys_for_v
>ector()
>(invisible read, for example), vector leaved initialized by dm_enosys() functi
>on until reboot.
>So even root will give ENOSYS.
It looks like I broke compatibility with Irix. You shouldn't be able to get
into dmapi without privilege. At the top of dmapi_ioctl() in dmapi_sysent.c
there should be a check for CAP_MKNOD.*
I'll get this stuff checked in.
Dean
* In the Overview section of the XDSM spec, last sentence of Scope and
Purpose, "These interfaces are not intended for direct use by typical
end-users or unprivileged processes."
------------ cmd/xfs/libdm/Makefile ----------
#
# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it would be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# Further, this software is distributed without any warranty that it is
# free of the rightful claim of any third person regarding infringement
# or the like. Any license provided herein, whether implied or
# otherwise, applies only to this software file. Patent licenses, if
# any, provided herein do not apply to combinations of this program with
# other software, or any other product whatsoever.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write the Free Software Foundation, Inc., 59
# Temple Place - Suite 330, Boston MA 02111-1307, USA.
#
# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
# Mountain View, CA 94043, or:
#
# http://www.sgi.com
#
# For further information regarding this notice, see:
#
# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
#
TOPDIR = ..
include $(TOPDIR)/include/builddefs
CFLAGS += -Ilinux
STATICLIBTARGET = libdm.a
LIBTARGET = libdm.so
CFILES = \
dm_attr.c \
dm_bulkattr.c \
dm_config.c \
dm_dmattr.c \
dm_event.c \
dm_handle.c \
dm_handle2path.c \
dm_hole.c \
dm_mountinfo.c \
dm_rdwr.c \
dm_region.c \
dm_right.c \
dm_session.c \
linux/dmapi_lib.c
default: $(LIBTARGET) $(STATICLIBTARGET)
include $(BUILDRULES)
install: default
#$(INSTALL) -m 755 -d $(XFS_CMDS_LIB_DIR)
#$(INSTALL) -m 755 $(STATICLIBTARGET) $(XFS_CMDS_LIB_DIR)
|