summaryrefslogtreecommitdiff
path: root/source3/script
diff options
context:
space:
mode:
Diffstat (limited to 'source3/script')
-rwxr-xr-xsource3/script/build_idl.sh18
-rwxr-xr-xsource3/script/tests/selftest.sh6
-rwxr-xr-xsource3/script/tests/wb_pad.sh82
3 files changed, 92 insertions, 14 deletions
diff --git a/source3/script/build_idl.sh b/source3/script/build_idl.sh
index 7aaddc70c7..34f262ee00 100755
--- a/source3/script/build_idl.sh
+++ b/source3/script/build_idl.sh
@@ -1,18 +1,14 @@
#!/bin/sh
-PIDL_ARGS="--outputdir librpc/gen_ndr --header --ndr-parser --samba3-ndr-server --samba3-ndr-client --"
-PIDL_EXTRA_ARGS="$*"
+ARGS="--includedir=../librpc/idl --outputdir librpc/gen_ndr --header --ndr-parser --samba3-ndr-server --samba3-ndr-client $PIDL_ARGS --"
+IDL_FILES="$*"
oldpwd=`pwd`
cd ${srcdir}
[ -d librpc/gen_ndr ] || mkdir -p librpc/gen_ndr || exit 1
-if [ -z "$PIDL" ] ; then
- PIDL=pidl
-fi
-
-PIDL="$PIDL ${PIDL_ARGS} ${PIDL_EXTRA_ARGS}"
+PIDL="$PIDL $ARGS"
##
## Find newer files rather than rebuild all of them
@@ -23,12 +19,12 @@ for f in ${IDL_FILES}; do
basename=`basename $f .idl`
ndr="librpc/gen_ndr/ndr_$basename.c"
- if [ -f $ndr ] && false; then
- if [ "x`find librpc/idl/$f -newer $ndr -print`" = "xlibrpc/idl/$f" ]; then
- list="$list librpc/idl/$f"
+ if [ -f $ndr ]; then
+ if [ "x`find $f -newer $ndr -print`" = "x$f" ]; then
+ list="$list $f"
fi
else
- list="$list librpc/idl/$f"
+ list="$list $f"
fi
done
diff --git a/source3/script/tests/selftest.sh b/source3/script/tests/selftest.sh
index 15e48b00ef..0894b2507d 100755
--- a/source3/script/tests/selftest.sh
+++ b/source3/script/tests/selftest.sh
@@ -166,9 +166,9 @@ cat >$SERVERCONFFILE<<EOF
domain logons = yes
time server = yes
- add user script = $PERL $SRCDIR/lib/nss_wrapper/nss_wrapper.pl --path $NSS_WRAPPER_PASSWD --type passwd --action add --name %u
- add machine script = $PERL $SRCDIR/lib/nss_wrapper/nss_wrapper.pl --path $NSS_WRAPPER_PASSWD --type passwd --action add --name %u
- delete user script = $PERL $SRCDIR/lib/nss_wrapper/nss_wrapper.pl --path $NSS_WRAPPER_PASSWD --type passwd --action delete --name %u
+ add user script = $PERL $SRCDIR/../lib/nss_wrapper/nss_wrapper.pl --path $NSS_WRAPPER_PASSWD --type passwd --action add --name %u
+ add machine script = $PERL $SRCDIR/../lib/nss_wrapper/nss_wrapper.pl --path $NSS_WRAPPER_PASSWD --type passwd --action add --name %u
+ delete user script = $PERL $SRCDIR/../lib/nss_wrapper/nss_wrapper.pl --path $NSS_WRAPPER_PASSWD --type passwd --action delete --name %u
kernel oplocks = no
kernel change notify = no
diff --git a/source3/script/tests/wb_pad.sh b/source3/script/tests/wb_pad.sh
new file mode 100755
index 0000000000..f1f5ca24c4
--- /dev/null
+++ b/source3/script/tests/wb_pad.sh
@@ -0,0 +1,82 @@
+#!/bin/sh
+#
+# Copyright (C) Guenther Deschner 2008
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+
+tempdir=`mktemp -d /tmp/wb_padXXXXXX`
+test -n "$tempdir" || exit 1
+cat >> $tempdir/wb_pad.c << _EOF
+#include "nsswitch/winbind_client.h"
+
+int main(int argc, const char **argv)
+{
+ struct winbindd_request req;
+ struct winbindd_response resp;
+
+ if (argc != 2) {
+ printf("usage: %s [req|resp]\n", argv[0]);
+ return 0;
+ }
+
+ if (strcmp(argv[1], "req") == 0) {
+ printf("%d\n", (uint32_t)sizeof(req));
+ }
+ if (strcmp(argv[1], "resp") == 0) {
+ printf("%d\n", (uint32_t)sizeof(resp));
+ }
+
+ return 0;
+}
+_EOF
+
+cleanup() {
+ rm -f $tempdir/wb_pad_32 $tempdir/wb_pad_64 $tempdir/wb_pad.c
+ rmdir $tempdir
+}
+
+cflags="-I. -I./../lib/replace -Iinclude"
+${CC:-gcc} -m32 $RPM_OPT_FLAGS $CFLAGS -o $tempdir/wb_pad_32 $cflags $tempdir/wb_pad.c
+if [ $? -ne 0 ]; then
+ cleanup
+ exit 1
+fi
+${CC:-gcc} -m64 $RPM_OPT_FLAGS $CFLAGS -o $tempdir/wb_pad_64 $cflags $tempdir/wb_pad.c
+if [ $? -ne 0 ]; then
+ cleanup
+ exit 1
+fi
+
+out_64_req=`$tempdir/wb_pad_64 req`
+out_64_resp=`$tempdir/wb_pad_64 resp`
+out_32_req=`$tempdir/wb_pad_32 req`
+out_32_resp=`$tempdir/wb_pad_32 resp`
+
+cleanup
+
+if test "$out_64_req" != "$out_32_req"; then
+ echo "winbind request size differs!"
+ echo "64bit: $out_64_req"
+ echo "32bit: $out_32_req"
+ exit 1
+fi
+
+if test "$out_64_resp" != "$out_32_resp"; then
+ echo "winbind response size differs!"
+ echo "64bit: $out_64_resp"
+ echo "32bit: $out_32_resp"
+ exit 1
+fi
+
+exit 0