initial commit of file from CVS for e-smith-samba on Sat Mar 23 16:28:38 AEDT 2024
This commit is contained in:
18
root/sbin/e-smith/samba_check_password
Normal file
18
root/sbin/e-smith/samba_check_password
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/perl -T
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use esmith::ConfigDB;
|
||||
use esmith::util;
|
||||
|
||||
our $db = esmith::ConfigDB->open or
|
||||
die "Couldn't open configuration database (permissions problems?)";
|
||||
|
||||
my $strength = $db->get_prop('passwordstrength', 'Users');
|
||||
my $password = <>;
|
||||
chomp $password;
|
||||
|
||||
my $reason = esmith::util::validatePassword($password, $strength);
|
||||
|
||||
exit 0 if (lc($reason) eq "ok");
|
||||
exit 1;
|
31
root/sbin/e-smith/systemd/nmbd-prepare
Normal file
31
root/sbin/e-smith/systemd/nmbd-prepare
Normal file
@@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Source networking configuration.
|
||||
. /etc/sysconfig/network
|
||||
|
||||
#if [ -f /etc/sysconfig/samba ]; then
|
||||
# . /etc/sysconfig/samba
|
||||
#fi
|
||||
# We currently don't care about /etc/sysconfig/samba, but that may change.
|
||||
|
||||
status=$(/sbin/e-smith/config getprop smb status)
|
||||
if [ "$status" = "disabled" ]
|
||||
then
|
||||
/sbin/e-smith/config setprop nmbd status disabled
|
||||
exit 1
|
||||
fi
|
||||
|
||||
nmbd=/usr/sbin/nmbd
|
||||
|
||||
[ -f $nmbd ] || exit 1
|
||||
|
||||
# Check that networking is up.
|
||||
[ ${NETWORKING} = "no" ] && exit 1
|
||||
|
||||
# Check that smb.conf exists.
|
||||
[ -f /etc/samba/smb.conf ] || exit 1
|
||||
|
||||
# Check that we can write to it... so non-root users stop here
|
||||
[ -w /etc/samba/smb.conf ] || exit 1
|
||||
|
||||
exit 0
|
43
root/sbin/e-smith/systemd/smbd-prepare
Normal file
43
root/sbin/e-smith/systemd/smbd-prepare
Normal file
@@ -0,0 +1,43 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Source networking configuration.
|
||||
. /etc/sysconfig/network
|
||||
|
||||
#if [ -f /etc/sysconfig/samba ]; then
|
||||
# . /etc/sysconfig/samba
|
||||
#fi
|
||||
# We currently don't care about /etc/sysconfig/samba, but that may change.
|
||||
|
||||
ldapauth=$(/sbin/e-smith/config getprop ldap Authentication || echo disabled)
|
||||
|
||||
status=$(/sbin/e-smith/config getprop smb status)
|
||||
if [ "$status" = "disabled" ]
|
||||
then
|
||||
/sbin/e-smith/config setprop smbd status disabled
|
||||
exit 1
|
||||
fi
|
||||
|
||||
smbd=/usr/sbin/smbd
|
||||
|
||||
[ -f $smbd ] || exit 1
|
||||
|
||||
# Check that networking is up.
|
||||
[ ${NETWORKING} = "no" ] && exit 1
|
||||
|
||||
# Check that smb.conf exists.
|
||||
[ -f /etc/samba/smb.conf ] || exit 1
|
||||
|
||||
# Check that we can write to it... so non-root users stop here
|
||||
[ -w /etc/samba/smb.conf ] || exit 1
|
||||
|
||||
# Delete the printing.tdb file if it exists to force it to rebuild.
|
||||
rm -f /var/cache/samba/printing.tdb
|
||||
|
||||
# Backup critical tdb files
|
||||
for tdb in /etc/samba/*.tdb \
|
||||
/var/lib/samba/*.tdb
|
||||
do
|
||||
[ -r "$tdb" ] && tdbbackup -l "$tdb" .bak
|
||||
done
|
||||
|
||||
exit 0
|
Reference in New Issue
Block a user