summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/acconfig.h2
-rw-r--r--source3/configure.in24
-rw-r--r--source3/include/config.h.in2
-rw-r--r--source3/include/trans2.h11
4 files changed, 39 insertions, 0 deletions
diff --git a/source3/acconfig.h b/source3/acconfig.h
index 8477d5de95..5265979efb 100644
--- a/source3/acconfig.h
+++ b/source3/acconfig.h
@@ -188,3 +188,5 @@
#undef HAVE_LDAP
#undef HAVE_STAT_ST_BLOCKS
#undef STAT_ST_BLOCKSIZE
+#undef HAVE_DEVICE_MAJOR_FN
+#undef HAVE_DEVICE_MINOR_FN
diff --git a/source3/configure.in b/source3/configure.in
index ed5bc605ef..864999332c 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -899,6 +899,30 @@ if test x"$samba_cv_HAVE_STRUCT_DIRENT64" = x"yes"; then
AC_DEFINE(HAVE_STRUCT_DIRENT64)
fi
+AC_CACHE_CHECK([for major macro],samba_cv_HAVE_DEVICE_MAJOR_FN,[
+AC_TRY_RUN([
+#if defined(HAVE_UNISTD_H)
+#include <unistd.h>
+#endif
+#include <sys/types.h>
+main() { dev_t dev; int i = major(dev); return 0; }],
+samba_cv_HAVE_DEVICE_MAJOR_FN=yes,samba_cv_HAVE_DEVICE_MAJOR_FN=no,samba_cv_HAVE_DEVICE_MAJOR_FN=cross)])
+if test x"$samba_cv_HAVE_DEVICE_MAJOR_FN" = x"yes"; then
+ AC_DEFINE(HAVE_DEVICE_MAJOR_FN)
+fi
+
+AC_CACHE_CHECK([for minor macro],samba_cv_HAVE_DEVICE_MINOR_FN,[
+AC_TRY_RUN([
+#if defined(HAVE_UNISTD_H)
+#include <unistd.h>
+#endif
+#include <sys/types.h>
+main() { dev_t dev; int i = minor(dev); return 0; }],
+samba_cv_HAVE_DEVICE_MINOR_FN=yes,samba_cv_HAVE_DEVICE_MINOR_FN=no,samba_cv_HAVE_DEVICE_MINOR_FN=cross)])
+if test x"$samba_cv_HAVE_DEVICE_MINOR_FN" = x"yes"; then
+ AC_DEFINE(HAVE_DEVICE_MINOR_FN)
+fi
+
AC_CACHE_CHECK([for unsigned char],samba_cv_HAVE_UNSIGNED_CHAR,[
AC_TRY_RUN([#include <stdio.h>
main() { char c; c=250; exit((c > 0)?0:1); }],
diff --git a/source3/include/config.h.in b/source3/include/config.h.in
index 164d2fb755..fe4ff0df38 100644
--- a/source3/include/config.h.in
+++ b/source3/include/config.h.in
@@ -254,6 +254,8 @@
#undef HAVE_LDAP
#undef HAVE_STAT_ST_BLOCKS
#undef STAT_ST_BLOCKSIZE
+#undef HAVE_DEVICE_MAJOR_FN
+#undef HAVE_DEVICE_MINOR_FN
/* The number of bytes in a int. */
#undef SIZEOF_INT
diff --git a/source3/include/trans2.h b/source3/include/trans2.h
index 55b1670aa7..53f351d5cf 100644
--- a/source3/include/trans2.h
+++ b/source3/include/trans2.h
@@ -316,11 +316,21 @@ Byte offset Type name description
#define MIN_UNIX_INFO_LEVEL 0x200
#define MAX_UNIX_INFO_LEVEL 0x2FF
+#define INFO_LEVEL_IS_UNIX(level) (((level) >= MIN_UNIX_INFO_LEVEL) && ((level) <= MAX_UNIX_INFO_LEVEL))
+
#define SMB_QUERY_FILE_UNIX_BASIC 0x200 /* UNIX File Info*/
#define SMB_SET_FILE_UNIX_BASIC 0x200
#define MODE_NO_CHANGE -1 /* file mode value which */
/* means "don't change it" */
+#define UNIX_TYPE_FILE 0
+#define UNIX_TYPE_DIR 1
+#define UNIX_TYPE_SYMLINK 2
+#define UNIX_TYPE_CHARDEV 3
+#define UNIX_TYPE_BLKDEV 4
+#define UNIX_TYPE_FIFO 5
+#define UNIX_TYPE_SOCKET 6
+#define UNIx_TYPE_UNKNOWN 0xFFFFFFFF
/*
LARGE_INTEGER EndOfFile File size
@@ -337,6 +347,7 @@ Byte offset Type name description
3 -- Character device
4 -- Block device
5 -- FIFO (named pipe)
+ 6 -- Unix domain socket
LARGE_INTEGER devmajor Major device number if type is device
LARGE_INTEGER devminor Minor device number if type is device