Group :: System/Configuration/Other
RPM: installer-feature-samba-usershares
Main Changelog Spec Patches Sources Download Gear Bugs and FR Repocop
installer-feature-samba-usershares-0.4/ 0000755 0000000 0000000 00000000000 11716215101 0020237 5 ustar 00root root 0000000 0000000 installer-feature-samba-usershares-0.4/85-samba-usershares.sh 0000755 0000000 0000000 00000002454 11716215101 0024302 0 ustar 00root root 0000000 0000000 #!/bin/sh -efu
a= . install2-init-functions
. shell-config
USERSHARES_DIR="/var/lib/samba/usershares"
USERSHARES_GROUP="sambashare"
DEFAULT_GROUPS='cdwriter cdrom audio proc radio camera floppy xgrp scanner uucp'
GROUPS_FILE="/usr/share/install3/default-groups"
mkdir -p "$destdir/$USERSHARES_DIR"
exec_chroot groupadd -r "$USERSHARES_GROUP"
exec_chroot chown root:"$USERSHARES_GROUP" "$USERSHARES_DIR"
exec_chroot chmod 01770 "$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/" \
"$destdir/etc/samba/smb.conf"
# Create group file for alterator-users
if [ ! -s "$destdir/$GROUPS_FILE" ]; then
mkdir -p "$destdir/${GROUPS_FILE%/*}"
echo "$DEFAULT_GROUPS" >"$destdir/$GROUPS_FILE"
fi
# Add USERSHARES_GROUP to the default groups list.
echo "$USERSHARES_GROUP" >>"$destdir/$GROUPS_FILE"
# Permissions for home dir must be 0701
tab="$(printf "\t")"
shell_config_set "$destdir/etc/login.defs" UMASK 076 "$tab" "$tab"
# Enable samba
exec_chroot chkconfig smb on >/dev/null 2>&1 ||:
exec_chroot chkconfig nmb on >/dev/null 2>&1 ||: