Commit f4ac3f5d authored by Anton Midyukov's avatar Anton Midyukov

net-usershares: remove UMASK for home dirs to 076

These permissions must be set by the user himself if necessary. Thanks Mikhail Efremov sem@ and Sergey V Turchin zerg@. Link: https://bugzilla.altlinux.org/44144
parent 602cfd55
# requires thunar-shares-plugin or mate-user-share to make sense # requires thunar-shares-plugin or mate-user-share to make sense
use/net-usershares: use/services use/deflogin use/net-usershares: use/control use/services \
@$(call add,GROUPS,sambashare) @$(call add,CONTROL,libnss-role:enabled)
@$(call add,DEFAULT_SERVICES_ENABLE,smb nmb) @$(call add,CONTROL,role-usershares:enabled)
@$(call add,THE_PACKAGES,libshell) @$(call add,CONTROL,smb-conf-usershares:enabled)
@$(call add,SYSTEMD_SERVICES_ENABLE,nmb.service)
@$(call add,SYSTEMD_SERVICES_ENABLE,smb.service)
@$(call add,THE_PACKAGES,alterator-roles-common)
@$(call add,THE_PACKAGES,libnss-role)
@$(call add,THE_PACKAGES,samba-usershares)
#!/bin/sh -efu
[ -s /etc/samba/smb.conf ] || exit 0
. shell-config
USERSHARES_DIR="/var/lib/samba/usershares"
USERSHARES_GROUP="sambashare"
DEFAULT_GROUPS='cdwriter cdrom audio video proc radio camera floppy xgrp scanner uucp'
GROUPS_FILE="/usr/share/install3/default-groups"
mkdir -p "$USERSHARES_DIR"
groupadd -r "$USERSHARES_GROUP"
chown root:"$USERSHARES_GROUP" "$USERSHARES_DIR"
chmod 1770 "$USERSHARES_DIR"
USERSHARES_OPTIONS="# ----------------------- User Shares Options -------------------------\n\tusershare path = $USERSHARES_DIR\n\tusershare max shares = 100\n\tusershare allow guests = yes\n\tusershare owner only = yes"
sed -i -e "\|^\[global\]|a$USERSHARES_OPTIONS" \
-e "s/workgroup = MYGROUP/workgroup = WORKGROUP/" \
"/etc/samba/smb.conf"
# Create group file for alterator-users
if [ ! -s "$GROUPS_FILE" ]; then
mkdir -p "${GROUPS_FILE%/*}"
echo "$DEFAULT_GROUPS" >"$GROUPS_FILE"
fi
# Add USERSHARES_GROUP to the default groups list.
echo "$USERSHARES_GROUP" >>"$GROUPS_FILE"
# Permissions for home dir must be 0701
tab="$(printf "\t")"
shell_config_set "/etc/login.defs" UMASK 076 "$tab" "$tab"
# smb and nmb services must be enabled
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment