Menu

#860 samba GUI aux params does not apply to config

open
nobody
5
2012-10-28
2011-03-28
ikke
No

Hi,

running 8RC3 here. I try to re-apply my 7.1 configs to 8, and noticed that the options in GUI "Auxiliary Parameters:" don't end up in /usr/local/etc/smb.conf.

This is what I have in my GUI:

force group = bar
force user = foo
create mask = 666
force create mode = 666
directory mask = 777
force directory mode = 777

and this is what ends up in smb.conf:

force group = bar

Thanks,
ikke

Discussion

  • ikke

    ikke - 2011-03-29

    Maybe the variable handling in while loop doesn't work due newlines in the input field.

    in file: /etc/rc.d/ix-samba , version 8rc3 lines:

    384         while read name comment mountpoint cifsro browsable inheritperms \
    385                 recyclebin showhiddenfiles guest guestok guestonly hostsallow hostsdeny auxsmbconf;
    

    and

    437                         if [ -n "${auxsmbconf}" ]; then
    438                                 echo ${auxsmbconf}
    
     
  • ikke

    ikke - 2011-03-30

    definately a bug in aux params handling due mis-handling the multi-line input from SQL database. I modified the script in this way:

    --- /etc/rc.d/ix-samban/2011-03-14 16:24:51.000000000 +0200c.d/ix-samba ix-samba
    +++ ix-samba 2011-03-30 21:22:39.271557735 +0300
    @@ -9,7 +9,7 @@

    . /etc/rc.subr

    -: ${SMB_CONF:="/usr/local/etc/smb.conf"}
    +: ${SMB_CONF:="smb.conf.debug"}

    generate_smbconf()
    {
    @@ -380,10 +380,15 @@

        ORDER BY
                cs.id ASC
    
    • " | \
    • " | tee smb.echo | \ while read name comment mountpoint cifsro browsable inheritperms \ recyclebin showhiddenfiles guest guestok guestonly hostsallow hostsdeny auxsmbconf;
      do
    • echo "------------------ test --------------------" >> smb.echo
    • echo $name $comment $mountpoint $cifsro $browsable $inheritperms \
    • $recyclebin $showhiddenfiles $guest $guestok $guestonly \
    • $hostsallow $hostsdeny $auxsmbconf >> smb.echo
    • echo "------------------ /test -------------------" >> smb.echo
      if [ -d "${mountpoint}" ]; then
      echo "[${name}]"
      echo "path = ${mountpoint}"

    and it's like i suspected, the newlines in last param (auxsmbconf) causes while to all paramaters after the first one to $name.

    this is the output:

    cat smb.echo

    someshare|some comment|/mnt/sharer/sharebox|0|1|0|0|0|sharer|0|0|10.10.10.0/24 10.10.11.0/24 10.10.12.0/24||force group = groupa
    force user = sharer
    create mask = 666
    force create mode = 666
    directory mask = 777
    force directory mode = 777

    usera|Usera Levy|/mnt/iken/usera|0|0|0|0|1|www|0|0|10.10.10.10/24|ALL|valid users = usera
    ------------------ test --------------------
    someshare some comment /mnt/sharer/sharebox 0 1 0 0 0 sharer 0 0 10.10.10.0/24 10.10.11.0/24 10.10.12.0/24 force group = groupa
    ------------------ /test -------------------
    ------------------ test --------------------
    force user = sharer
    ------------------ /test -------------------
    ------------------ test --------------------
    create mask = 666
    ------------------ /test -------------------
    ------------------ test --------------------
    force create mode = 666
    ------------------ /test -------------------
    ------------------ test --------------------
    directory mask = 777
    ------------------ /test -------------------
    ------------------ test --------------------
    force directory mode = 777
    ------------------ /test -------------------
    ------------------ test --------------------

    ------------------ /test -------------------
    ------------------ test --------------------
    usera Usera Levy /mnt/iken/usera 0 0 0 0 1 www 0 0 10.10.10.10/24 ALL valid users = usera
    ------------------ /test -------------------

     

Log in to post a comment.