include $(top_srcdir)/src/Common.am
-# SAMBAPREFIX must point to the directory where Samba has been installed.
-# By default, Samba is installed in /usr/local/samba. If you changed this
-# by using the --prefix option when configuring Samba, you need to change
-# SAMBAPREFIX accordingly.
-
-## FIXME: autoconf should test for the samba path.
-
-SMB_AUTH_HELPER = basic_smb_auth.sh
-SAMBAPREFIX=/usr/local/samba
-SMB_AUTH_HELPER_PATH = $(libexecdir)/$(SMB_AUTH_HELPER)
-
-libexec_SCRIPTS = $(SMB_AUTH_HELPER)
-
+libexec_SCRIPTS = basic_smb_auth.sh
libexec_PROGRAMS = basic_smb_auth
basic_smb_auth_SOURCES= basic_smb_auth.cc
-basic_smb_auth_CXXFLAGS = -DSAMBAPREFIX=\"$(SAMBAPREFIX)\" -DHELPERSCRIPT=\"$(SMB_AUTH_HELPER_PATH)\"
+basic_smb_auth_CXXFLAGS = -DHELPERSCRIPT=\"$(libexecdir)/basic_smb_auth.sh\"
basic_smb_auth_LDADD = \
$(top_builddir)/lib/libmiscencoding.la \
$(COMPAT_LIB) \
shcmd = debug_enabled ? HELPERSCRIPT : HELPERSCRIPT " > /dev/null 2>&1";
- /* pass to helper script */
- if (putenv((char *)"SAMBAPREFIX=" SAMBAPREFIX) != 0)
- return 1;
-
while (fgets(buf, HELPER_INPUT_BUFFER, stdin) != NULL) {
if ((s = strchr(buf, '\n')) == NULL)
addropt=""
fi
echo "Query address options: $addropt"
-dcip=`$SAMBAPREFIX/bin/nmblookup $addropt "$PASSTHROUGH#1c" | awk '/^[0-9.]+ / { print $1 ; exit }'`
+dcip=`nmblookup $addropt "$PASSTHROUGH#1c" | awk '/^[0-9.]+ / { print $1 ; exit }'`
echo "Domain controller IP address: $dcip"
[ -n "$dcip" ] || exit 1
# All right, we have the IP address of a domain controller,
# but we need its name too
-dcname=`$SAMBAPREFIX/bin/nmblookup -A $dcip | awk '$2 == "<00>" { print $1 ; exit }'`
+dcname=`nmblookup -A $dcip | awk '$2 == "<00>" { print $1 ; exit }'`
echo "Domain controller NETBIOS name: $dcname"
[ -n "$dcname" ] || exit 1
# Read the contents of the file $AUTHFILE on the $AUTHSHARE share
authfilebs=`echo "$AUTHFILE" | tr / '\\\\'`
-authinfo=`$SAMBAPREFIX/bin/smbclient "//$dcname/$AUTHSHARE" -I $dcip -d 0 -E -W "$DOMAINNAME" -c "get $authfilebs -" 2>/dev/null`
+authinfo=`smbclient "//$dcname/$AUTHSHARE" -I $dcip -d 0 -E -W "$DOMAINNAME" -c "get $authfilebs -" 2>/dev/null`
echo "Contents of //$dcname/$AUTHSHARE/$AUTHFILE: $authinfo"
# Allow for both \n and \r\n end-of-line termination
#!/bin/sh
-for prefix in ${SAMBAPREFIX} /usr/local /opt /opt/samba /usr/local/samba /usr
+for prefix in /usr/local /opt /opt/samba /usr/local/samba /usr
do
if [ -x ${prefix}/bin/smbclient ]; then
exit 0
fi
done
-exit 1
+echo "WARNING: Samba smbclient not found in default location. basic_smb_auth may not work on this machine"
+# allow script install anyway.
+exit 0
#!/bin/sh
-
-for sambaprefix in ${SAMBAPREFIX} /usr/local /opt /opt/samba /usr/local/samba /usr
+samba_found="no"
+for sambaprefix in /usr/local /opt /opt/samba /usr/local/samba /usr
do
- for perlprefix in /usr /usr/local /opt /opt/perl
- do
- if [ -x $sambaprefix/bin/wbinfo -a -x $perlprefix/bin/perl ]; then
- exit 0
- fi
- done
+ if [ -x $sambaprefix/bin/wbinfo ]; then
+ samba_found="yes"
+ fi
+done
+if test "$samba_found" = "no"; then
+ echo "WARNING: Samba wbinfo not found in default location. ext_wbinfo_group_acl may not work on this machine"
+fi
+for perlprefix in /usr /usr/local /opt /opt/perl
+do
+ if [ -x $perlprefix/bin/perl ]; then
+ exit 0
+ fi
done
exit 1