diff options
author | Jeremy Allison <jra@samba.org> | 1998-09-04 20:53:58 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1998-09-04 20:53:58 +0000 |
commit | 83900f2b682c62f2b5620b29ecb710274990ac51 (patch) | |
tree | d990ea194e1ecdb3ca78fb93f3af09274e97634d | |
parent | 33bf29fd24c1dc076055303a0f135c9a47fb9877 (diff) | |
download | samba-83900f2b682c62f2b5620b29ecb710274990ac51.tar.gz samba-83900f2b682c62f2b5620b29ecb710274990ac51.tar.bz2 samba-83900f2b682c62f2b5620b29ecb710274990ac51.zip |
Modified dev_t and ino_t code to be 64 bit clean (including changes
to oplock break message passing). I think that smbd/nmbd are now
inode and offset size independent (at least for 32 bit and 64 bit
systems).
Now to expose all this new functionality to NT clients.....
Jeremy.
(This used to be commit 5910d07bbf45a34d3c901461f74704c029a79474)
-rwxr-xr-x | source3/configure | 192 | ||||
-rw-r--r-- | source3/configure.in | 14 | ||||
-rw-r--r-- | source3/include/config.h.in | 2 | ||||
-rw-r--r-- | source3/include/includes.h | 18 | ||||
-rw-r--r-- | source3/locking/locking_shm.c | 131 | ||||
-rw-r--r-- | source3/locking/locking_slow.c | 18 | ||||
-rw-r--r-- | source3/smbd/files.c | 8 | ||||
-rw-r--r-- | source3/smbd/open.c | 61 | ||||
-rw-r--r-- | source3/smbd/oplock.c | 123 | ||||
-rw-r--r-- | source3/smbd/reply.c | 10 |
10 files changed, 443 insertions, 134 deletions
diff --git a/source3/configure b/source3/configure index 30b28fbe41..36382ea270 100755 --- a/source3/configure +++ b/source3/configure @@ -3712,20 +3712,74 @@ rm -fr conftest* fi -echo $ac_n "checking for union semun ... $ac_c" +echo $ac_n "checking for 64 bit ino_t ... $ac_c" if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF #line 3721 "configure" #include "confdefs.h" +#include <stdio.h> +#include <sys/stat.h> +main() { exit((sizeof(ino_t) == 8) ? 0 : 1); } +EOF +if { (eval echo configure:3727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then + echo yes;cat >> confdefs.h <<\EOF +#define SIZEOF_INO_T 8 +EOF + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + echo no +fi +rm -fr conftest* +fi + + +echo $ac_n "checking for ino64_t ... $ac_c" +if test "$cross_compiling" = yes; then + { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } +else + cat > conftest.$ac_ext <<EOF +#line 3748 "configure" +#include "confdefs.h" +#include <stdio.h> +#include <sys/stat.h> +main() { struct stat64 st; ino64_t s; if (sizeof(ino_t) == sizeof(ino64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); } +EOF +if { (eval echo configure:3754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then + echo yes;cat >> confdefs.h <<\EOF +#define HAVE_INO64_T 1 +EOF + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + echo no +fi +rm -fr conftest* +fi + + +echo $ac_n "checking for union semun ... $ac_c" +if test "$cross_compiling" = yes; then + { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } +else + cat > conftest.$ac_ext <<EOF +#line 3775 "configure" +#include "confdefs.h" #include <sys/types.h> #include <sys/ipc.h> #include <sys/sem.h> main() { union semun ss; exit(0); } EOF -if { (eval echo configure:3729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then echo yes;cat >> confdefs.h <<\EOF #define HAVE_UNION_SEMUN 1 @@ -3746,12 +3800,12 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 3750 "configure" +#line 3804 "configure" #include "confdefs.h" #include <stdio.h> main() { char c; c=250; exit((c > 0)?0:1); } EOF -if { (eval echo configure:3755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then echo yes;cat >> confdefs.h <<\EOF #define HAVE_UNSIGNED_CHAR 1 @@ -3769,7 +3823,7 @@ fi echo $ac_n "checking for sin_len in sock ... $ac_c" cat > conftest.$ac_ext <<EOF -#line 3773 "configure" +#line 3827 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/socket.h> @@ -3778,7 +3832,7 @@ int main() { struct sockaddr_in sock; sock.sin_len = sizeof(sock); ; return 0; } EOF -if { (eval echo configure:3782: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3836: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo yes;cat >> confdefs.h <<\EOF #define HAVE_SOCK_SIN_LEN 1 @@ -3794,14 +3848,14 @@ rm -f conftest* echo $ac_n "checking for __FILE__ macro ... $ac_c" cat > conftest.$ac_ext <<EOF -#line 3798 "configure" +#line 3852 "configure" #include "confdefs.h" #include <stdio.h> int main() { printf("%s\n", __FILE__); ; return 0; } EOF -if { (eval echo configure:3805: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3859: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo yes;cat >> confdefs.h <<\EOF #define HAVE_FILE_MACRO 1 @@ -3817,14 +3871,14 @@ rm -f conftest* echo $ac_n "checking for __FUNCTION__ macro ... $ac_c" cat > conftest.$ac_ext <<EOF -#line 3821 "configure" +#line 3875 "configure" #include "confdefs.h" #include <stdio.h> int main() { printf("%s\n", __FUNCTION__); ; return 0; } EOF -if { (eval echo configure:3828: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3882: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo yes;cat >> confdefs.h <<\EOF #define HAVE_FUNCTION_MACRO 1 @@ -3843,14 +3897,14 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 3847 "configure" +#line 3901 "configure" #include "confdefs.h" #include <sys/time.h> #include <unistd.h> main() { struct timeval tv; exit(gettimeofday(&tv, NULL));} EOF -if { (eval echo configure:3854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then echo yes;cat >> confdefs.h <<\EOF #define HAVE_GETTIMEOFDAY_TZ 1 @@ -3872,7 +3926,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 3876 "configure" +#line 3930 "configure" #include "confdefs.h" #include <sys/types.h> #include <dirent.h> @@ -3880,7 +3934,7 @@ main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d); if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 && di->d_name[0] == 0) exit(0); exit(1);} EOF -if { (eval echo configure:3884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then echo yes - you are using the broken /usr/ucb/cc;cat >> confdefs.h <<\EOF #define HAVE_BROKEN_READDIR 1 @@ -3898,7 +3952,7 @@ fi echo $ac_n "checking for utimbuf ... $ac_c" cat > conftest.$ac_ext <<EOF -#line 3902 "configure" +#line 3956 "configure" #include "confdefs.h" #include <sys/types.h> #include <utime.h> @@ -3906,7 +3960,7 @@ int main() { struct utimbuf tbuf; tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf)); ; return 0; } EOF -if { (eval echo configure:3910: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3964: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo yes;cat >> confdefs.h <<\EOF #define HAVE_UTIMBUF 1 @@ -3925,11 +3979,11 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 3929 "configure" +#line 3983 "configure" #include "confdefs.h" #include "tests/ftruncate.c" EOF -if { (eval echo configure:3933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then echo yes;cat >> confdefs.h <<\EOF #define HAVE_FTRUNCATE_EXTEND 1 @@ -3950,11 +4004,11 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 3954 "configure" +#line 4008 "configure" #include "confdefs.h" #include "tests/getgroups.c" EOF -if { (eval echo configure:3958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then echo yes;cat >> confdefs.h <<\EOF #define HAVE_BROKEN_GETGROUPS 1 @@ -3976,7 +4030,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 3980 "configure" +#line 4034 "configure" #include "confdefs.h" #include <stdio.h> @@ -3988,7 +4042,7 @@ if (strcmp(inet_ntoa(ip),"18.52.86.120") && strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); } exit(1);} EOF -if { (eval echo configure:3992: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then echo yes;cat >> confdefs.h <<\EOF #define REPLACE_INET_NTOA 1 @@ -4009,11 +4063,11 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 4013 "configure" +#line 4067 "configure" #include "confdefs.h" main() { exit(getuid() != 0); } EOF -if { (eval echo configure:4017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then echo yes;cat >> confdefs.h <<\EOF #define HAVE_ROOT 1 @@ -4035,14 +4089,14 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 4039 "configure" +#line 4093 "configure" #include "confdefs.h" #define HAVE_NETMASK_IFCONF 1 #define AUTOCONF 1 #include "lib/netmask.c" EOF -if { (eval echo configure:4046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then echo yes;netmask=yes;cat >> confdefs.h <<\EOF #define HAVE_NETMASK_IFCONF 1 @@ -4064,14 +4118,14 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 4068 "configure" +#line 4122 "configure" #include "confdefs.h" #define HAVE_NETMASK_IFREQ 1 #define AUTOCONF 1 #include "lib/netmask.c" EOF -if { (eval echo configure:4075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then echo yes;netmask=yes;cat >> confdefs.h <<\EOF #define HAVE_NETMASK_IFREQ 1 @@ -4094,14 +4148,14 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 4098 "configure" +#line 4152 "configure" #include "confdefs.h" #define HAVE_NETMASK_AIX 1 #define AUTOCONF 1 #include "lib/netmask.c" EOF -if { (eval echo configure:4105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then echo yes;netmask=yes;cat >> confdefs.h <<\EOF #define HAVE_NETMASK_AIX 1 @@ -4123,11 +4177,11 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 4127 "configure" +#line 4181 "configure" #include "confdefs.h" #include "tests/trapdoor.c" EOF -if { (eval echo configure:4131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then echo no else @@ -4148,11 +4202,11 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 4152 "configure" +#line 4206 "configure" #include "confdefs.h" #include "tests/shared_mmap.c" EOF -if { (eval echo configure:4156: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then echo yes;cat >> confdefs.h <<\EOF #define HAVE_SHARED_MMAP 1 @@ -4173,11 +4227,11 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 4177 "configure" +#line 4231 "configure" #include "confdefs.h" #include "tests/fcntl_lock.c" EOF -if { (eval echo configure:4181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then echo yes;cat >> confdefs.h <<\EOF #define HAVE_FCNTL_LOCK 1 @@ -4198,7 +4252,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 4202 "configure" +#line 4256 "configure" #include "confdefs.h" #include <stdio.h> @@ -4219,7 +4273,7 @@ exit(1); #endif } EOF -if { (eval echo configure:4223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then echo yes;cat >> confdefs.h <<\EOF #define HAVE_STRUCT_FLOCK64 1 @@ -4240,11 +4294,11 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 4244 "configure" +#line 4298 "configure" #include "confdefs.h" #include "tests/sysv_ipc.c" EOF -if { (eval echo configure:4248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then echo yes;cat >> confdefs.h <<\EOF #define HAVE_SYSV_IPC 1 @@ -4263,7 +4317,7 @@ fi ################################################# # check for the AFS filesystem echo $ac_n "checking whether to use AFS""... $ac_c" 1>&6 -echo "configure:4267: checking whether to use AFS" >&5 +echo "configure:4321: checking whether to use AFS" >&5 # Check whether --with-afs or --without-afs was given. if test "${with_afs+set}" = set; then withval="$with_afs" @@ -4289,7 +4343,7 @@ fi ################################################# # check for the DFS auth system echo $ac_n "checking whether to use DFS auth""... $ac_c" 1>&6 -echo "configure:4293: checking whether to use DFS auth" >&5 +echo "configure:4347: checking whether to use DFS auth" >&5 # Check whether --with-dfs or --without-dfs was given. if test "${with_dfs+set}" = set; then withval="$with_dfs" @@ -4314,7 +4368,7 @@ fi ################################################# # check for automount support echo $ac_n "checking whether to use AUTOMOUNT""... $ac_c" 1>&6 -echo "configure:4318: checking whether to use AUTOMOUNT" >&5 +echo "configure:4372: checking whether to use AUTOMOUNT" >&5 # Check whether --with-automount or --without-automount was given. if test "${with_automount+set}" = set; then withval="$with_automount" @@ -4339,7 +4393,7 @@ fi ################################################# # check for a LDAP password database echo $ac_n "checking whether to use LDAP password database""... $ac_c" 1>&6 -echo "configure:4343: checking whether to use LDAP password database" >&5 +echo "configure:4397: checking whether to use LDAP password database" >&5 # Check whether --with-ldap or --without-ldap was given. if test "${with_ldap+set}" = set; then withval="$with_ldap" @@ -4364,7 +4418,7 @@ fi ################################################# # check for a NISPLUS password database echo $ac_n "checking whether to use NISPLUS password database""... $ac_c" 1>&6 -echo "configure:4368: checking whether to use NISPLUS password database" >&5 +echo "configure:4422: checking whether to use NISPLUS password database" >&5 # Check whether --with-nisplus or --without-nisplus was given. if test "${with_nisplus+set}" = set; then withval="$with_nisplus" @@ -4389,7 +4443,7 @@ fi ################################################# # check for a NISPLUS_HOME support echo $ac_n "checking whether to use NISPLUS_HOME""... $ac_c" 1>&6 -echo "configure:4393: checking whether to use NISPLUS_HOME" >&5 +echo "configure:4447: checking whether to use NISPLUS_HOME" >&5 # Check whether --with-nisplus-home or --without-nisplus-home was given. if test "${with_nisplus_home+set}" = set; then withval="$with_nisplus_home" @@ -4414,7 +4468,7 @@ fi ################################################# # check for the secure socket layer echo $ac_n "checking whether to use SSL""... $ac_c" 1>&6 -echo "configure:4418: checking whether to use SSL" >&5 +echo "configure:4472: checking whether to use SSL" >&5 # Check whether --with-ssl or --without-ssl was given. if test "${with_ssl+set}" = set; then withval="$with_ssl" @@ -4439,7 +4493,7 @@ fi ################################################# # check for experimental mmap support echo $ac_n "checking whether to use MMAP""... $ac_c" 1>&6 -echo "configure:4443: checking whether to use MMAP" >&5 +echo "configure:4497: checking whether to use MMAP" >&5 # Check whether --with-mmap or --without-mmap was given. if test "${with_mmap+set}" = set; then withval="$with_mmap" @@ -4464,7 +4518,7 @@ fi ################################################# # check for syslog logging echo $ac_n "checking whether to use syslog logging""... $ac_c" 1>&6 -echo "configure:4468: checking whether to use syslog logging" >&5 +echo "configure:4522: checking whether to use syslog logging" >&5 # Check whether --with-syslog or --without-syslog was given. if test "${with_syslog+set}" = set; then withval="$with_syslog" @@ -4489,7 +4543,7 @@ fi ################################################# # check for experimental netatalk resource fork support echo $ac_n "checking whether to support netatalk""... $ac_c" 1>&6 -echo "configure:4493: checking whether to support netatalk" >&5 +echo "configure:4547: checking whether to support netatalk" >&5 # Check whether --with-netatalk or --without-netatalk was given. if test "${with_netatalk+set}" = set; then withval="$with_netatalk" @@ -4515,7 +4569,7 @@ fi ################################################# # these tests are taken from the GNU fileutils package echo "checking how to get filesystem space usage" 1>&6 -echo "configure:4519: checking how to get filesystem space usage" >&5 +echo "configure:4573: checking how to get filesystem space usage" >&5 space=no # Perform only the link test since it seems there are no variants of the @@ -4527,12 +4581,12 @@ space=no if test $space = no; then # SVR4 echo $ac_n "checking statvfs function (SVR4)""... $ac_c" 1>&6 -echo "configure:4531: checking statvfs function (SVR4)" >&5 +echo "configure:4585: checking statvfs function (SVR4)" >&5 if eval "test \"`echo '$''{'fu_cv_sys_stat_statvfs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4536 "configure" +#line 4590 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/statvfs.h> @@ -4540,7 +4594,7 @@ int main() { struct statvfs fsd; statvfs (0, &fsd); ; return 0; } EOF -if { (eval echo configure:4544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4598: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* fu_cv_sys_stat_statvfs=yes else @@ -4565,7 +4619,7 @@ fi if test $space = no; then # DEC Alpha running OSF/1 echo $ac_n "checking for 3-argument statfs function (DEC OSF/1)""... $ac_c" 1>&6 -echo "configure:4569: checking for 3-argument statfs function (DEC OSF/1)" >&5 +echo "configure:4623: checking for 3-argument statfs function (DEC OSF/1)" >&5 if eval "test \"`echo '$''{'fu_cv_sys_stat_statfs3_osf1'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4573,7 +4627,7 @@ else fu_cv_sys_stat_statfs3_osf1=no else cat > conftest.$ac_ext <<EOF -#line 4577 "configure" +#line 4631 "configure" #include "confdefs.h" #include <sys/param.h> @@ -4586,7 +4640,7 @@ else exit (statfs (".", &fsd, sizeof (struct statfs))); } EOF -if { (eval echo configure:4590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then fu_cv_sys_stat_statfs3_osf1=yes else @@ -4613,7 +4667,7 @@ fi if test $space = no; then # AIX echo $ac_n "checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)""... $ac_c" 1>&6 -echo "configure:4617: checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)" >&5 +echo "configure:4671: checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)" >&5 if eval "test \"`echo '$''{'fu_cv_sys_stat_statfs2_bsize'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4621,7 +4675,7 @@ else fu_cv_sys_stat_statfs2_bsize=no else cat > conftest.$ac_ext <<EOF -#line 4625 "configure" +#line 4679 "configure" #include "confdefs.h" #ifdef HAVE_SYS_PARAM_H @@ -4640,7 +4694,7 @@ else exit (statfs (".", &fsd)); } EOF -if { (eval echo configure:4644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then fu_cv_sys_stat_statfs2_bsize=yes else @@ -4667,7 +4721,7 @@ fi if test $space = no; then # SVR3 echo $ac_n "checking for four-argument statfs (AIX-3.2.5, SVR3)""... $ac_c" 1>&6 -echo "configure:4671: checking for four-argument statfs (AIX-3.2.5, SVR3)" >&5 +echo "configure:4725: checking for four-argument statfs (AIX-3.2.5, SVR3)" >&5 if eval "test \"`echo '$''{'fu_cv_sys_stat_statfs4'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4675,7 +4729,7 @@ else fu_cv_sys_stat_statfs4=no else cat > conftest.$ac_ext <<EOF -#line 4679 "configure" +#line 4733 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/statfs.h> @@ -4685,7 +4739,7 @@ else exit (statfs (".", &fsd, sizeof fsd, 0)); } EOF -if { (eval echo configure:4689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then fu_cv_sys_stat_statfs4=yes else @@ -4712,7 +4766,7 @@ fi if test $space = no; then # 4.4BSD and NetBSD echo $ac_n "checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)""... $ac_c" 1>&6 -echo "configure:4716: checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)" >&5 +echo "configure:4770: checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)" >&5 if eval "test \"`echo '$''{'fu_cv_sys_stat_statfs2_fsize'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4720,7 +4774,7 @@ else fu_cv_sys_stat_statfs2_fsize=no else cat > conftest.$ac_ext <<EOF -#line 4724 "configure" +#line 4778 "configure" #include "confdefs.h" #include <sys/types.h> #ifdef HAVE_SYS_PARAM_H @@ -4736,7 +4790,7 @@ else exit (statfs (".", &fsd)); } EOF -if { (eval echo configure:4740: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then fu_cv_sys_stat_statfs2_fsize=yes else @@ -4763,7 +4817,7 @@ fi if test $space = no; then # Ultrix echo $ac_n "checking for two-argument statfs with struct fs_data (Ultrix)""... $ac_c" 1>&6 -echo "configure:4767: checking for two-argument statfs with struct fs_data (Ultrix)" >&5 +echo "configure:4821: checking for two-argument statfs with struct fs_data (Ultrix)" >&5 if eval "test \"`echo '$''{'fu_cv_sys_stat_fs_data'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4771,7 +4825,7 @@ else fu_cv_sys_stat_fs_data=no else cat > conftest.$ac_ext <<EOF -#line 4775 "configure" +#line 4829 "configure" #include "confdefs.h" #include <sys/types.h> #ifdef HAVE_SYS_PARAM_H @@ -4791,7 +4845,7 @@ else exit (statfs (".", &fsd) != 1); } EOF -if { (eval echo configure:4795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then fu_cv_sys_stat_fs_data=yes else diff --git a/source3/configure.in b/source3/configure.in index a1992c0fe0..4ad5a05402 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -184,6 +184,20 @@ main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit echo yes;AC_DEFINE(HAVE_OFF64_T), echo no) +echo $ac_n "checking for 64 bit ino_t ... $ac_c" +AC_TRY_RUN([#include <stdio.h> +#include <sys/stat.h> +main() { exit((sizeof(ino_t) == 8) ? 0 : 1); }], +echo yes;AC_DEFINE(SIZEOF_INO_T,8), +echo no) + +echo $ac_n "checking for ino64_t ... $ac_c" +AC_TRY_RUN([#include <stdio.h> +#include <sys/stat.h> +main() { struct stat64 st; ino64_t s; if (sizeof(ino_t) == sizeof(ino64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }], +echo yes;AC_DEFINE(HAVE_INO64_T), +echo no) + echo $ac_n "checking for union semun ... $ac_c" AC_TRY_RUN([ #include <sys/types.h> diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 80160fb4b4..e0bcbfe6f0 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -60,6 +60,8 @@ #undef HAVE_LONGLONG #undef HAVE_OFF64_T #undef SIZEOF_OFF_T +#undef HAVE_INO64_T +#undef SIZEOF_INO_T #undef HAVE_REMSH #undef HAVE_UNSIGNED_CHAR #undef HAVE_UTIMBUF diff --git a/source3/include/includes.h b/source3/include/includes.h index 4086bd53fe..f0271906a5 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -322,11 +322,25 @@ */ #ifndef SMB_DEV_T -#define SMB_DEV_T uint32 +#define SMB_DEV_T dev_t #endif +/* + * Setup the correctly sized inode type. + */ + #ifndef SMB_INO_T -#define SMB_INO_T uint32 +# ifdef HAVE_INO64_T +# define SMB_INO_T ino64_t +# else +# define SMB_INO_T ino_t +# endif +#endif + +#ifndef LARGE_SMB_INO_T +# if defined(HAVE_INO64_T) || (defined(SIZEOF_INO_T) && (SIZEOF_INO_T == 8)) +# define LARGE_SMB_INO_T 1 +# endif #endif #ifndef SMB_OFF_T diff --git a/source3/locking/locking_shm.c b/source3/locking/locking_shm.c index 909bdb78e4..b18b5efb2c 100644 --- a/source3/locking/locking_shm.c +++ b/source3/locking/locking_shm.c @@ -139,15 +139,26 @@ static int shm_get_share_modes(connection_struct *conn, if(!found) { - DEBUG(5,("get_share_modes no entry for file dev = %d ino = %d\n", - dev, inode)); +#ifdef LARGE_SMB_INO_T + DEBUG(5,("get_share_modes no entry for file dev = %x ino = %.0f\n", + (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ + DEBUG(5,("get_share_modes no entry for file dev = %x ino = %lx\n", + (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ return (0); } if(file_scanner_p->locking_version != LOCKING_VERSION) { - DEBUG(0,("ERROR: get_share_modes Deleting old share mode v1 %d dev=%d ino=%d\n", - file_scanner_p->locking_version, dev, inode)); +#ifdef LARGE_SMB_INO_T + DEBUG(0,("ERROR: get_share_modes Deleting old share mode v1 %d dev=%x ino=%.0f\n", + file_scanner_p->locking_version, (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ + DEBUG(0,("ERROR: get_share_modes Deleting old share mode v1 %d dev=%x ino=%lx\n", + file_scanner_p->locking_version, (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ + if(file_prev_p == file_scanner_p) mode_array[hash_entry] = file_scanner_p->next_offset; else @@ -203,8 +214,13 @@ static int shm_get_share_modes(connection_struct *conn, /* PARANOIA TEST */ if(file_scanner_p->num_share_mode_entries < 0) { - DEBUG(0,("PANIC ERROR: get_share_mode: entries=%d dev=%d ino=%d\n", - file_scanner_p->num_share_mode_entries,dev, inode)); +#ifdef LARGE_SMB_INO_T + DEBUG(0,("PANIC ERROR: get_share_mode: entries=%d dev=%x ino=%.0f\n", + file_scanner_p->num_share_mode_entries, (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ + DEBUG(0,("PANIC ERROR: get_share_mode: entries=%d dev=%x ino=%lx\n", + file_scanner_p->num_share_mode_entries, (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ return 0; } @@ -235,8 +251,13 @@ static int shm_get_share_modes(connection_struct *conn, /* If no valid share mode entries were found then this record shouldn't exist ! */ if(num_entries_copied == 0) { - DEBUG(0,("get_share_modes: file with dev %d inode %d empty\n", - dev, inode)); +#ifdef LARGE_SMB_INO_T + DEBUG(0,("get_share_modes: file with dev %x inode %.0f empty\n", + (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ + DEBUG(0,("get_share_modes: file with dev %x inode %lx empty\n", + (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ if(*old_shares) free((char *)*old_shares); *old_shares = 0; @@ -248,8 +269,13 @@ static int shm_get_share_modes(connection_struct *conn, shmops->shm_free(shmops->addr2offset(file_scanner_p)); } - DEBUG(5,("get_share_modes: file with dev %d inode %d -> %d entries\n", - dev, inode, num_entries_copied)); +#ifdef LARGE_SMB_INO_T + DEBUG(5,("get_share_modes: file with dev %x inode %.0f -> %d entries\n", + (unsigned int)dev, (double)inode, num_entries_copied)); +#else /* LARGE_SMB_INO_T */ + DEBUG(5,("get_share_modes: file with dev %x inode %lx -> %d entries\n", + (unsigned int)dev, (unsigned long)inode, num_entries_copied)); +#endif /* LARGE_SMB_INO_T */ return(num_entries_copied); } @@ -304,15 +330,26 @@ static void shm_del_share_mode(int token, files_struct *fsp) if(!found) { - DEBUG(0,("ERROR: del_share_mode no entry for dev %d inode %d\n", - dev, inode)); +#ifdef LARGE_SMB_INO_T + DEBUG(0,("ERROR: del_share_mode no entry for dev %x inode %.0f\n", + (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ + DEBUG(0,("ERROR: del_share_mode no entry for dev %x inode %lx\n", + (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ return; } if(file_scanner_p->locking_version != LOCKING_VERSION) { - DEBUG(0,("ERROR: del_share_modes Deleting old share mode v1 %d dev=%d ino=%d\n", - file_scanner_p->locking_version, dev, inode)); +#ifdef LARGE_SMB_INO_T + DEBUG(0,("ERROR: del_share_modes Deleting old share mode v1 %d dev=%x ino=%.0f\n", + file_scanner_p->locking_version, (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ + DEBUG(0,("ERROR: del_share_modes Deleting old share mode v1 %d dev=%x ino=%lx\n", + file_scanner_p->locking_version, (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ + if(file_prev_p == file_scanner_p) mode_array[hash_entry] = file_scanner_p->next_offset; else @@ -347,8 +384,14 @@ static void shm_del_share_mode(int token, files_struct *fsp) /* Decrement the number of entries in the record. */ file_scanner_p->num_share_mode_entries -= 1; - DEBUG(2,("del_share_modes Deleting share mode entry dev=%d ino=%d\n", - dev, inode)); +#ifdef LARGE_SMB_INO_T + DEBUG(2,("del_share_modes Deleting share mode entry dev=%x ino=%.0f\n", + (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ + DEBUG(2,("del_share_modes Deleting share mode entry dev=%x ino=%lx\n", + (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ + if(entry_prev_p == entry_scanner_p) /* We are at start of list */ file_scanner_p->share_mode_entries = entry_scanner_p->next_share_mode_entry; @@ -367,8 +410,14 @@ static void shm_del_share_mode(int token, files_struct *fsp) /* If we deleted the last share mode entry then remove the share mode record. */ if(file_scanner_p->num_share_mode_entries == 0) { - DEBUG(2,("del_share_modes num entries = 0, deleting share_mode dev=%d ino=%d\n", - dev, inode)); +#ifdef LARGE_SMB_INO_T + DEBUG(2,("del_share_modes num entries = 0, deleting share_mode dev=%x ino=%.0f\n", + (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ + DEBUG(2,("del_share_modes num entries = 0, deleting share_mode dev=%x ino=%lx\n", + (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ + if(file_prev_p == file_scanner_p) mode_array[hash_entry] = file_scanner_p->next_offset; else @@ -378,8 +427,13 @@ static void shm_del_share_mode(int token, files_struct *fsp) } else { - DEBUG(0,("ERROR: del_share_modes No share mode dev=%d ino=%d\n", - dev, inode)); +#ifdef LARGE_SMB_INO_T + DEBUG(0,("ERROR: del_share_modes No share mode dev=%x ino=%.0f\n", + (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ + DEBUG(0,("ERROR: del_share_modes No share mode dev=%x ino=%lx\n", + (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ } } @@ -447,8 +501,13 @@ static BOOL shm_set_share_mode(int token, files_struct *fsp, uint16 port, uint16 file_scanner_p = new_mode_p; - DEBUG(3,("set_share_mode: Created share record for %s (dev %d inode %d)\n", - fsp->fsp_name, dev, inode)); +#ifdef LARGE_SMB_INO_T + DEBUG(3,("set_share_mode: Created share record for %s (dev %x inode %.0f)\n", + fsp->fsp_name, (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ + DEBUG(3,("set_share_mode: Created share record for %s (dev %x inode %lx)\n", + fsp->fsp_name, (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ } /* Now create the share mode entry */ @@ -542,15 +601,26 @@ static BOOL shm_remove_share_oplock(files_struct *fsp, int token) if(!found) { - DEBUG(0,("ERROR:remove_share_oplock: no entry found for dev=%d ino=%d\n", - dev, inode)); +#ifdef LARGE_SMB_INO_T + DEBUG(0,("ERROR:remove_share_oplock: no entry found for dev=%x ino=%.0f\n", + (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ + DEBUG(0,("ERROR:remove_share_oplock: no entry found for dev=%x ino=%lx\n", + (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ return False; } if(file_scanner_p->locking_version != LOCKING_VERSION) { - DEBUG(0,("ERROR: remove_share_oplock: Deleting old share mode v1=%d dev=%d ino=%d\n", - file_scanner_p->locking_version, dev, inode)); +#ifdef LARGE_SMB_INO_T + DEBUG(0,("ERROR: remove_share_oplock: Deleting old share mode v1=%d dev=%x ino=%.0f\n", + file_scanner_p->locking_version, (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ + DEBUG(0,("ERROR: remove_share_oplock: Deleting old share mode v1=%d dev=%x ino=%lx\n", + file_scanner_p->locking_version, (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ + if(file_prev_p == file_scanner_p) mode_array[hash_entry] = file_scanner_p->next_offset; else @@ -586,8 +656,13 @@ static BOOL shm_remove_share_oplock(files_struct *fsp, int token) if(!found) { - DEBUG(0,("ERROR: remove_share_oplock: No oplock granted. dev=%d ino=%d\n", - dev, inode)); +#ifdef LARGE_SMB_INO_T + DEBUG(0,("ERROR: remove_share_oplock: No oplock granted. dev=%x ino=%.0f\n", + (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ + DEBUG(0,("ERROR: remove_share_oplock: No oplock granted. dev=%x ino=%lx\n", + (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ return False; } diff --git a/source3/locking/locking_slow.c b/source3/locking/locking_slow.c index c9b8d2a687..fd95fd45ec 100644 --- a/source3/locking/locking_slow.c +++ b/source3/locking/locking_slow.c @@ -90,7 +90,11 @@ static BOOL share_name(connection_struct *conn, len = strlen(name); name += len; - slprintf(name, sizeof(pstring) - len - 1, "/share.%u.%u",dev,inode); +#ifdef LARGE_SMB_INO_T + slprintf(name, sizeof(pstring) - len - 1, "/share.%u.%.0f",(unsigned int)dev,(double)inode); +#else /* LARGE_SMB_INO_T */ + slprintf(name, sizeof(pstring) - len - 1, "/share.%u.%lu",(unsigned int)dev,(unsigned long)inode); +#endif /* LARGE_SMB_INO_T */ return(True); } @@ -966,8 +970,16 @@ static int slow_share_forall(void (*fn)(share_mode_entry *, char *)) BOOL new_file; pstring fname; - if (sscanf(s,"share.%u.%u",&dev,&inode)!=2) continue; - +#ifdef LARGE_SMB_INO_T + double inode_ascii; + if (sscanf(s,"share.%u.%lf",&dev,&inode_ascii)!=2) continue; + inode = (SMB_INO_T)inode_ascii; +#else /* LARGE_SMB_INO_T */ + unsigned long inode_long; + if (sscanf(s,"share.%u.%lu",&dev,&inode_long)!=2) continue; + inode = (SMB_INO_T)inode_long; +#endif /* LARGE_SMB_INO_T */ + pstrcpy(lname,lp_lockdir()); trim_string(lname,NULL,"/"); pstrcat(lname,"/"); diff --git a/source3/smbd/files.c b/source3/smbd/files.c index 341d9946ec..163e4f0cf2 100644 --- a/source3/smbd/files.c +++ b/source3/smbd/files.c @@ -128,9 +128,15 @@ file_fd_struct *fd_get_already_open(SMB_STRUCT_STAT *sbuf) (sbuf->st_dev == fd_ptr->dev) && (sbuf->st_ino == fd_ptr->inode)) { fd_ptr->ref_count++; +#ifdef LARGE_SMB_INO_T + DEBUG(3,("Re-used file_fd_struct dev = %x, inode = %.0f, ref_count = %d\n", + (unsigned int)fd_ptr->dev, (double)fd_ptr->inode, + fd_ptr->ref_count)); +#else /* LARGE_SMB_INO_T */ DEBUG(3,("Re-used file_fd_struct dev = %x, inode = %x, ref_count = %d\n", - fd_ptr->dev, fd_ptr->inode, + (unsigned int)fd_ptr->dev, fd_ptr->inode, fd_ptr->ref_count)); +#endif /* LARGE_SMB_INO_T */ return fd_ptr; } } diff --git a/source3/smbd/open.c b/source3/smbd/open.c index f24d4ac962..45d919187f 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -149,10 +149,18 @@ int fd_attempt_close(file_fd_struct *fd_ptr) { extern struct current_user current_user; - DEBUG(3,("fd_attempt_close fd = %d, dev = %x, inode = %x, open_flags = %d, ref_count = %d.\n", - fd_ptr->fd, fd_ptr->dev, fd_ptr->inode, +#ifdef LARGE_SMB_INO_T + DEBUG(3,("fd_attempt_close fd = %d, dev = %x, inode = %.0f, open_flags = %d, ref_count = %d.\n", + fd_ptr->fd, (unsigned int)fd_ptr->dev, (double)fd_ptr->inode, fd_ptr->real_open_flags, fd_ptr->ref_count)); +#else /* LARGE_SMB_INO_T */ + DEBUG(3,("fd_attempt_close fd = %d, dev = %x, inode = %lx, open_flags = %d, ref_count = %d.\n", + fd_ptr->fd, (unsigned int)fd_ptr->dev, (unsigned long)fd_ptr->inode, + fd_ptr->real_open_flags, + fd_ptr->ref_count)); +#endif /* LARGE_SMB_INO_T */ + if(fd_ptr->ref_count > 0) { fd_ptr->ref_count--; if(fd_ptr->ref_count == 0) { @@ -718,16 +726,28 @@ void open_file_shared(files_struct *fsp,connection_struct *conn,char *fname,int if(share_entry->op_type & (EXCLUSIVE_OPLOCK|BATCH_OPLOCK)) { +#ifdef LARGE_SMB_INO_T + DEBUG(5,("open_file_shared: breaking oplock (%x) on file %s, \ +dev = %x, inode = %.0f\n", share_entry->op_type, fname, (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ DEBUG(5,("open_file_shared: breaking oplock (%x) on file %s, \ -dev = %x, inode = %x\n", share_entry->op_type, fname, dev, inode)); +dev = %x, inode = %lx\n", share_entry->op_type, fname, (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ /* Oplock break.... */ unlock_share_entry(conn, dev, inode, token); if(request_oplock_break(share_entry, dev, inode) == False) { free((char *)old_shares); + +#ifdef LARGE_SMB_INO_T + DEBUG(0,("open_file_shared: FAILED when breaking oplock (%x) on file %s, \ +dev = %x, inode = %.0f\n", old_shares[i].op_type, fname, (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ DEBUG(0,("open_file_shared: FAILED when breaking oplock (%x) on file %s, \ -dev = %x, inode = %x\n", old_shares[i].op_type, fname, dev, inode)); +dev = %x, inode = %lx\n", old_shares[i].op_type, fname, (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ + errno = EACCES; unix_ERR_class = ERRDOS; unix_ERR_code = ERRbadshare; @@ -831,8 +851,13 @@ dev = %x, inode = %x\n", old_shares[i].op_type, fname, dev, inode)); global_oplocks_open++; port = oplock_port; +#ifdef LARGE_SMB_INO_T + DEBUG(5,("open_file_shared: granted oplock (%x) on file %s, \ +dev = %x, inode = %.0f\n", oplock_request, fname, (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ DEBUG(5,("open_file_shared: granted oplock (%x) on file %s, \ -dev = %x, inode = %x\n", oplock_request, fname, dev, inode)); +dev = %x, inode = %lx\n", oplock_request, fname, (unsigned int)dev, (double)inode)); +#endif /* LARGE_SMB_INO_T */ } else @@ -1051,8 +1076,15 @@ BOOL check_file_sharing(connection_struct *conn,char *fname, BOOL rename_op) */ if(rename_op && (share_entry->pid == pid)) { + +#ifdef LARGE_SMB_INO_T + DEBUG(0,("check_file_sharing: NT redirector workaround - rename attempted on \ +batch oplocked file %s, dev = %x, inode = %.0f\n", fname, (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ DEBUG(0,("check_file_sharing: NT redirector workaround - rename attempted on \ -batch oplocked file %s, dev = %x, inode = %x\n", fname, dev, inode)); +batch oplocked file %s, dev = %x, inode = %lx\n", fname, (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ + /* * This next line is a test that allows the deny-mode * processing to be skipped. This seems to be needed as @@ -1065,16 +1097,29 @@ batch oplocked file %s, dev = %x, inode = %x\n", fname, dev, inode)); } else { + +#ifdef LARGE_SMB_INO_T DEBUG(5,("check_file_sharing: breaking oplock (%x) on file %s, \ -dev = %x, inode = %x\n", share_entry->op_type, fname, dev, inode)); +dev = %x, inode = %.0f\n", share_entry->op_type, fname, (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ + DEBUG(5,("check_file_sharing: breaking oplock (%x) on file %s, \ +dev = %x, inode = %lx\n", share_entry->op_type, fname, (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ /* Oplock break.... */ unlock_share_entry(conn, dev, inode, token); if(request_oplock_break(share_entry, dev, inode) == False) { free((char *)old_shares); + +#ifdef LARGE_SMB_INO_T DEBUG(0,("check_file_sharing: FAILED when breaking oplock (%x) on file %s, \ -dev = %x, inode = %x\n", old_shares[i].op_type, fname, dev, inode)); +dev = %x, inode = %.0f\n", old_shares[i].op_type, fname, (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ + DEBUG(0,("check_file_sharing: FAILED when breaking oplock (%x) on file %s, \ +dev = %x, inode = %lx\n", old_shares[i].op_type, fname, (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ + return False; } lock_share_entry(conn, dev, inode, &token); diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c index ab88b82953..52a574663c 100644 --- a/source3/smbd/oplock.c +++ b/source3/smbd/oplock.c @@ -105,19 +105,30 @@ should be %d).\n", msg_len, OPLOCK_BREAK_MSG_LEN)); } { uint32 remotepid = IVAL(msg_start,OPLOCK_BREAK_PID_OFFSET); + SMB_DEV_T dev = IVAL(msg_start,OPLOCK_BREAK_DEV_OFFSET); /* - * Warning - this will need to be changed if SMB_DEV_T/SMB_INO_T <> 4 bytes. !! + * Warning - beware of SMB_INO_T <> 4 bytes. !! */ - SMB_DEV_T dev = IVAL(msg_start,OPLOCK_BREAK_DEV_OFFSET); +#ifdef LARGE_SMB_INO_T + SMB_INO_T inode_low = IVAL(msg_start, OPLOCK_BREAK_INODE_OFFSET); + SMB_INO_T inode_high = IVAL(msg_start, OPLOCK_BREAK_INODE_OFFSET + 4); + SMB_INO_T inode = inode_low | (inode_high << 32); +#else /* LARGE_SMB_INO_T */ SMB_INO_T inode = IVAL(msg_start, OPLOCK_BREAK_INODE_OFFSET); +#endif /* LARGE_SMB_INO_T */ struct timeval tval; struct sockaddr_in toaddr; tval.tv_sec = IVAL(msg_start, OPLOCK_BREAK_SEC_OFFSET); tval.tv_usec = IVAL(msg_start, OPLOCK_BREAK_USEC_OFFSET); +#ifdef LARGE_SMB_INO_T DEBUG(5,("process_local_message: oplock break request from \ -pid %d, port %d, dev = %x, inode = %x\n", remotepid, from_port, dev, inode)); +pid %d, port %d, dev = %x, inode = %.0f\n", remotepid, from_port, (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ + DEBUG(5,("process_local_message: oplock break request from \ +pid %d, port %d, dev = %x, inode = %lx\n", remotepid, from_port, (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ /* * If we have no record of any currently open oplocks, @@ -157,9 +168,15 @@ oplocks. Returning success.\n")); return False; } +#ifdef LARGE_SMB_INO_T + DEBUG(5,("process_local_message: oplock break reply sent to \ +pid %d, port %d, for file dev = %x, inode = %.0f\n", + remotepid, from_port, (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ DEBUG(5,("process_local_message: oplock break reply sent to \ -pid %d, port %d, for file dev = %x, inode = %x\n", remotepid, - from_port, dev, inode)); +pid %d, port %d, for file dev = %x, inode = %lx\n", + remotepid, from_port, (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ } break; @@ -179,14 +196,25 @@ reply - dumping info.\n")); { uint32 remotepid = IVAL(msg_start,OPLOCK_BREAK_PID_OFFSET); + SMB_DEV_T dev = IVAL(msg_start,OPLOCK_BREAK_DEV_OFFSET); /* - * Warning - this will need to be changed if SMB_DEV_T/SMB_INO_T <> 4 bytes. !! + * Warning - beware of SMB_INO_T <> 4 bytes. !! */ - SMB_DEV_T dev = IVAL(msg_start,OPLOCK_BREAK_DEV_OFFSET); +#ifdef LARGE_SMB_INO_T + SMB_INO_T inode_low = IVAL(msg_start, OPLOCK_BREAK_INODE_OFFSET); + SMB_INO_T inode_high = IVAL(msg_start, OPLOCK_BREAK_INODE_OFFSET + 4); + SMB_INO_T inode = inode_low | (inode_high << 32); +#else /* LARGE_SMB_INO_T */ SMB_INO_T inode = IVAL(msg_start, OPLOCK_BREAK_INODE_OFFSET); +#endif /* LARGE_SMB_INO_T */ +#ifdef LARGE_SMB_INO_T + DEBUG(0,("process_local_message: unsolicited oplock break reply from \ +pid %d, port %d, dev = %x, inode = %.0f\n", remotepid, from_port, (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ DEBUG(0,("process_local_message: unsolicited oplock break reply from \ -pid %d, port %d, dev = %x, inode = %x\n", remotepid, from_port, dev, inode)); +pid %d, port %d, dev = %x, inode = %lx\n", remotepid, from_port, (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ } return False; @@ -217,7 +245,11 @@ BOOL oplock_break(SMB_DEV_T dev, SMB_INO_T inode, struct timeval *tval) if( DEBUGLVL( 3 ) ) { - dbgtext( "oplock_break: called for dev = %x, inode = %x.\n", dev, inode ); +#ifdef LARGE_SMB_INO_T + dbgtext( "oplock_break: called for dev = %x, inode = %.0f.\n", (unsigned int)dev, (double)inode ); +#else /* LARGE_SMB_INO_T */ + dbgtext( "oplock_break: called for dev = %x, inode = %lx.\n", (unsigned int)dev, (unsigned long)inode ); +#endif /* LARGE_SMB_INO_T */ dbgtext( "Current global_oplocks_open = %d\n", global_oplocks_open ); } @@ -232,7 +264,11 @@ BOOL oplock_break(SMB_DEV_T dev, SMB_INO_T inode, struct timeval *tval) if( DEBUGLVL( 0 ) ) { dbgtext( "oplock_break: cannot find open file with " ); - dbgtext( "dev = %x, inode = %x ", dev, inode); +#ifdef LARGE_SMB_INO_T + dbgtext( "dev = %x, inode = %.0f ", (unsigned int)dev, (double)inode); +#else /* LARGE_SMB_INO_T */ + dbgtext( "dev = %x, inode = %x ", (unsigned int)dev, (unsigned long)inode); +#endif /* LARGE_SMB_INO_T */ dbgtext( "allowing break to succeed.\n" ); } return True; @@ -252,7 +288,11 @@ BOOL oplock_break(SMB_DEV_T dev, SMB_INO_T inode, struct timeval *tval) if( DEBUGLVL( 0 ) ) { dbgtext( "oplock_break: file %s ", fsp->fsp_name ); - dbgtext( "(dev = %x, inode = %x) has no oplock.\n", dev, inode ); +#ifdef LARGE_SMB_INO_T + dbgtext( "(dev = %x, inode = %.0f) has no oplock.\n", (unsigned int)dev, (double)inode ); +#else /* LARGE_SMB_INO_T */ + dbgtext( "(dev = %x, inode = %lx) has no oplock.\n", (unsigned int)dev, (unsigned long)inode ); +#endif /* LARGE_SMB_INO_T */ dbgtext( "Allowing break to succeed regardless.\n" ); } return True; @@ -265,7 +305,11 @@ BOOL oplock_break(SMB_DEV_T dev, SMB_INO_T inode, struct timeval *tval) { dbgtext( "oplock_break: ERROR: oplock_break already sent for " ); dbgtext( "file %s ", fsp->fsp_name); - dbgtext( "(dev = %x, inode = %x)\n", dev, inode ); +#ifdef LARGE_SMB_INO_T + dbgtext( "(dev = %x, inode = %.0f)\n", (unsigned int)dev, (double)inode ); +#else /* LARGE_SMB_INO_T */ + dbgtext( "(dev = %x, inode = %lx)\n", (unsigned int)dev, (unsigned long)inode ); +#endif /* LARGE_SMB_INO_T */ } /* We have to fail the open here as we cannot send another oplock break on @@ -357,7 +401,12 @@ BOOL oplock_break(SMB_DEV_T dev, SMB_INO_T inode, struct timeval *tval) OPLOCK_BREAK_TIMEOUT ) ); DEBUGADD( 0, ( "oplock_break failed for file %s ", fsp->fsp_name ) ); - DEBUGADD( 0, ( "(dev = %x, inode = %x).\n", dev, inode)); +#ifdef LARGE_SMB_INO_T + DEBUGADD( 0, ( "(dev = %x, inode = %.0f).\n", (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ + DEBUGADD( 0, ( "(dev = %x, inode = %lx).\n", (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ + shutdown_server = True; break; } @@ -384,7 +433,12 @@ BOOL oplock_break(SMB_DEV_T dev, SMB_INO_T inode, struct timeval *tval) dbgtext( "oplock_break: no break received from client " ); dbgtext( "within %d seconds.\n", OPLOCK_BREAK_TIMEOUT ); dbgtext( "oplock_break failed for file %s ", fsp->fsp_name ); - dbgtext( "(dev = %x, inode = %x).\n", dev, inode ); +#ifdef LARGE_SMB_INO_T + dbgtext( "(dev = %x, inode = %.0f).\n", (unsigned int)dev, (double)inode ); +#else /* LARGE_SMB_INO_T */ + dbgtext( "(dev = %x, inode = %lx).\n", (unsigned int)dev, (unsigned long)inode ); +#endif /* LARGE_SMB_INO_T */ + } shutdown_server = True; break; @@ -451,7 +505,11 @@ BOOL oplock_break(SMB_DEV_T dev, SMB_INO_T inode, struct timeval *tval) if( DEBUGLVL( 3 ) ) { dbgtext( "oplock_break: returning success for " ); - dbgtext( "dev = %x, inode = %x.\n", dev, inode ); +#ifdef LARGE_SMB_INO_T + dbgtext( "dev = %x, inode = %.0f\n", (unsigned int)dev, (double)inode ); +#else /* LARGE_SMB_INO_T */ + dbgtext( "dev = %x, inode = %lx\n", (unsigned int)dev, (unsigned long)inode ); +#endif /* LARGE_SMB_INO_T */ dbgtext( "Current global_oplocks_open = %d\n", global_oplocks_open ); } @@ -495,11 +553,16 @@ should be %d\n", pid, share_entry->op_port, oplock_port)); SIVAL(op_break_msg,OPLOCK_BREAK_PID_OFFSET,pid); SIVAL(op_break_msg,OPLOCK_BREAK_SEC_OFFSET,(uint32)share_entry->time.tv_sec); SIVAL(op_break_msg,OPLOCK_BREAK_USEC_OFFSET,(uint32)share_entry->time.tv_usec); + SIVAL(op_break_msg,OPLOCK_BREAK_DEV_OFFSET,dev); /* - * WARNING - this will need to be changed if SMB_DEV_T/SMB_INO_T <> 4 bytes. + * WARNING - beware of SMB_INO_T <> 4 bytes. */ - SIVAL(op_break_msg,OPLOCK_BREAK_DEV_OFFSET,dev); +#ifdef LARGE_SMB_INO_T + SIVAL(op_break_msg,OPLOCK_BREAK_INODE_OFFSET,(inode & 0xFFFFFFFFL)); + SIVAL(op_break_msg,OPLOCK_BREAK_INODE_OFFSET+4,((inode >> 32) & 0xFFFFFFFFL)); +#else /* LARGE_SMB_INO_T */ SIVAL(op_break_msg,OPLOCK_BREAK_INODE_OFFSET,inode); +#endif /* LARGE_SMB_INO_T */ /* set the address and port */ bzero((char *)&addr_out,sizeof(addr_out)); @@ -511,7 +574,12 @@ should be %d\n", pid, share_entry->op_port, oplock_port)); { dbgtext( "request_oplock_break: sending a oplock break message to " ); dbgtext( "pid %d on port %d ", share_entry->pid, share_entry->op_port ); - dbgtext( "for dev = %x, inode = %x\n", dev, inode ); +#ifdef LARGE_SMB_INO_T + dbgtext( "for dev = %x, inode = %.0f\n", (unsigned int)dev, (double)inode ); +#else /* LARGE_SMB_INO_T */ + dbgtext( "for dev = %x, inode = %lx\n", (unsigned int)dev, (unsigned long)inode ); +#endif /* LARGE_SMB_INO_T */ + } if(sendto(oplock_sock,op_break_msg,OPLOCK_BREAK_MSG_LEN,0, @@ -522,7 +590,11 @@ should be %d\n", pid, share_entry->op_port, oplock_port)); dbgtext( "request_oplock_break: failed when sending a oplock " ); dbgtext( "break message to pid %d ", share_entry->pid ); dbgtext( "on port %d ", share_entry->op_port ); - dbgtext( "for dev = %x, inode = %x.\n", dev, inode ); +#ifdef LARGE_SMB_INO_T + dbgtext( "for dev = %x, inode = %.0f\n", (unsigned int)dev, (double)inode ); +#else /* LARGE_SMB_INO_T */ + dbgtext( "for dev = %x, inode = %lx\n", (unsigned int)dev, (unsigned long)inode ); +#endif /* LARGE_SMB_INO_T */ dbgtext( "Error was %s\n", strerror(errno) ); } return False; @@ -555,7 +627,12 @@ should be %d\n", pid, share_entry->op_port, oplock_port)); dbgtext( "request_oplock_break: no response received to oplock " ); dbgtext( "break request to pid %d ", share_entry->pid ); dbgtext( "on port %d ", share_entry->op_port ); - dbgtext( "for dev = %x, inode = %x\n", dev, inode ); +#ifdef LARGE_SMB_INO_T + dbgtext( "for dev = %x, inode = %.0f\n", (unsigned int)dev, (double)inode ); +#else /* LARGE_SMB_INO_T */ + dbgtext( "for dev = %x, inode = %lx\n", (unsigned int)dev, (unsigned long)inode ); +#endif /* LARGE_SMB_INO_T */ + } /* * This is a hack to make handling of failing clients more robust. @@ -572,7 +649,11 @@ should be %d\n", pid, share_entry->op_port, oplock_port)); dbgtext( "request_oplock_break: error in response received " ); dbgtext( "to oplock break request to pid %d ", share_entry->pid ); dbgtext( "on port %d ", share_entry->op_port ); - dbgtext( "for dev = %x, inode = %x.\n", dev, inode ); +#ifdef LARGE_SMB_INO_T + dbgtext( "for dev = %x, inode = %.0f\n", (unsigned int)dev, (double)inode ); +#else /* LARGE_SMB_INO_T */ + dbgtext( "for dev = %x, inode = %lx\n", (unsigned int)dev, (unsigned long)inode ); +#endif /* LARGE_SMB_INO_T */ dbgtext( "Error was (%s).\n", strerror(errno) ); } return False; diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 3665518ae6..d7ab997010 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -3564,9 +3564,15 @@ no oplock granted on this file.\n", fsp->fnum)); /* Remove the oplock flag from the sharemode. */ lock_share_entry(fsp->conn, dev, inode, &token); if(remove_share_oplock(fsp, token)==False) { + +#ifdef LARGE_SMB_INO_T + DEBUG(0,("reply_lockingX: failed to remove share oplock for fnum %d, \ +dev = %x, inode = %.0f\n", fsp->fnum, (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ DEBUG(0,("reply_lockingX: failed to remove share oplock for fnum %d, \ -dev = %x, inode = %x\n", - fsp->fnum, dev, inode)); +dev = %x, inode = %lx\n", fsp->fnum, (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ + unlock_share_entry(fsp->conn, dev, inode, token); } else { unlock_share_entry(fsp->conn, dev, inode, token); |