fix #64 set SMB2 minimum default, and enable it to be disabled

This commit is contained in:
David Personette 2017-07-13 17:51:59 -04:00
parent 14c3a1856f
commit c72d17eee3
5 changed files with 17 additions and 1 deletions

View File

@ -27,6 +27,7 @@ RUN export DEBIAN_FRONTEND='noninteractive' && \
echo ' vfs objects = recycle' >>/etc/samba/smb.conf && \ echo ' vfs objects = recycle' >>/etc/samba/smb.conf && \
echo ' recycle:keeptree = yes' >>/etc/samba/smb.conf && \ echo ' recycle:keeptree = yes' >>/etc/samba/smb.conf && \
echo ' recycle:versions = yes' >>/etc/samba/smb.conf && \ echo ' recycle:versions = yes' >>/etc/samba/smb.conf && \
echo ' min protocol = SMB2' >>/etc/samba/smb.conf && \
echo '' >>/etc/samba/smb.conf && \ echo '' >>/etc/samba/smb.conf && \
apt-get clean && \ apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* rm -rf /var/lib/apt/lists/* /tmp/*

View File

@ -27,6 +27,7 @@ RUN export DEBIAN_FRONTEND='noninteractive' && \
echo ' vfs objects = recycle' >>/etc/samba/smb.conf && \ echo ' vfs objects = recycle' >>/etc/samba/smb.conf && \
echo ' recycle:keeptree = yes' >>/etc/samba/smb.conf && \ echo ' recycle:keeptree = yes' >>/etc/samba/smb.conf && \
echo ' recycle:versions = yes' >>/etc/samba/smb.conf && \ echo ' recycle:versions = yes' >>/etc/samba/smb.conf && \
echo ' min protocol = SMB2' >>/etc/samba/smb.conf && \
echo '' >>/etc/samba/smb.conf && \ echo '' >>/etc/samba/smb.conf && \
apt-get clean && \ apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* rm -rf /var/lib/apt/lists/* /tmp/*

View File

@ -27,6 +27,7 @@ RUN export DEBIAN_FRONTEND='noninteractive' && \
echo ' vfs objects = recycle' >>/etc/samba/smb.conf && \ echo ' vfs objects = recycle' >>/etc/samba/smb.conf && \
echo ' recycle:keeptree = yes' >>/etc/samba/smb.conf && \ echo ' recycle:keeptree = yes' >>/etc/samba/smb.conf && \
echo ' recycle:versions = yes' >>/etc/samba/smb.conf && \ echo ' recycle:versions = yes' >>/etc/samba/smb.conf && \
echo ' min protocol = SMB2' >>/etc/samba/smb.conf && \
echo '' >>/etc/samba/smb.conf && \ echo '' >>/etc/samba/smb.conf && \
apt-get clean && \ apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* rm -rf /var/lib/apt/lists/* /tmp/*

View File

@ -37,6 +37,7 @@ OR set local storage:
-n Start the 'nmbd' daemon to advertise the shares -n Start the 'nmbd' daemon to advertise the shares
-p Set ownership and permissions on the shares -p Set ownership and permissions on the shares
-r Disable recycle bin for shares -r Disable recycle bin for shares
-S Disable SMB2 minimun version
-s "<name;/path>[;browse;readonly;guest;users;admins;wl]" Config a share -s "<name;/path>[;browse;readonly;guest;users;admins;wl]" Config a share
required arg: "<name>;</path>" required arg: "<name>;</path>"
<name> is how it's called for clients <name> is how it's called for clients
@ -66,6 +67,7 @@ ENVIRONMENT VARIABLES (only available with `docker run`)
* `CHARMAP` - As above, configure character mapping * `CHARMAP` - As above, configure character mapping
* `NMBD` - As above, enable nmbd * `NMBD` - As above, enable nmbd
* `SMB` - As above, disabel SMB2 minimun version
* `TZ` - As above, set a zoneinfo timezone, IE `EST5EDT` * `TZ` - As above, set a zoneinfo timezone, IE `EST5EDT`
* `WORKGROUP` - As above, set workgroup * `WORKGROUP` - As above, set workgroup
* `USERID` - Set the UID for the samba server * `USERID` - Set the UID for the samba server

View File

@ -97,6 +97,14 @@ share() { local share="$1" path="$2" browsable=${3:-yes} ro=${4:-yes} \
echo "" >>$file echo "" >>$file
} }
### smb: disable SMB2 minimun
# Arguments:
# none)
# Return: result
smb() { local file=/etc/samba/smb.conf
sed -i '/min protocol/d' $file
}
### timezone: Set the timezone for the container ### timezone: Set the timezone for the container
# Arguments: # Arguments:
# timezone) for example EST5EDT # timezone) for example EST5EDT
@ -150,6 +158,7 @@ Options (fields in '[]' are optional, '<>' are required):
-n Start the 'nmbd' daemon to advertise the shares -n Start the 'nmbd' daemon to advertise the shares
-p Set ownership and permissions on the shares -p Set ownership and permissions on the shares
-r Disable recycle bin for shares -r Disable recycle bin for shares
-S Disable SMB2 minimun version
-s \"<name;/path>[;browse;readonly;guest;users;admins;wl]\" Config a share -s \"<name;/path>[;browse;readonly;guest;users;admins;wl]\" Config a share
required arg: \"<name>;</path>\" required arg: \"<name>;</path>\"
<name> is how it's called for clients <name> is how it's called for clients
@ -181,7 +190,7 @@ The 'command' (if provided and valid) will be run instead of samba
[[ "${USERID:-""}" =~ ^[0-9]+$ ]] && usermod -u $USERID -o smbuser [[ "${USERID:-""}" =~ ^[0-9]+$ ]] && usermod -u $USERID -o smbuser
[[ "${GROUPID:-""}" =~ ^[0-9]+$ ]] && groupmod -g $GROUPID -o users [[ "${GROUPID:-""}" =~ ^[0-9]+$ ]] && groupmod -g $GROUPID -o users
while getopts ":hc:i:nprs:t:u:w:" opt; do while getopts ":hc:i:nprs:St:u:w:" opt; do
case "$opt" in case "$opt" in
h) usage ;; h) usage ;;
c) charmap "$OPTARG" ;; c) charmap "$OPTARG" ;;
@ -190,6 +199,7 @@ while getopts ":hc:i:nprs:t:u:w:" opt; do
p) PERMISSIONS="true" ;; p) PERMISSIONS="true" ;;
r) recycle ;; r) recycle ;;
s) eval share $(sed 's/^\|$/"/g; s/;/" "/g' <<< $OPTARG) ;; s) eval share $(sed 's/^\|$/"/g; s/;/" "/g' <<< $OPTARG) ;;
S) smb ;;
t) timezone "$OPTARG" ;; t) timezone "$OPTARG" ;;
u) eval user $(sed 's|;| |g' <<< $OPTARG) ;; u) eval user $(sed 's|;| |g' <<< $OPTARG) ;;
w) workgroup "$OPTARG" ;; w) workgroup "$OPTARG" ;;
@ -203,6 +213,7 @@ shift $(( OPTIND - 1 ))
[[ "${PERMISSIONS:-""}" ]] && perms [[ "${PERMISSIONS:-""}" ]] && perms
[[ "${RECYCLE:-""}" ]] && recycle [[ "${RECYCLE:-""}" ]] && recycle
[[ "${TZ:-""}" ]] && timezone "$TZ" [[ "${TZ:-""}" ]] && timezone "$TZ"
[[ "${SMB:-""}" ]] && smb
[[ "${WORKGROUP:-""}" ]] && workgroup "$WORKGROUP" [[ "${WORKGROUP:-""}" ]] && workgroup "$WORKGROUP"
if [[ $# -ge 1 && -x $(which $1 2>&-) ]]; then if [[ $# -ge 1 && -x $(which $1 2>&-) ]]; then