[Samba] smbmount vs. mount -t cifs

Donald W Watson dwatson at us.ibm.com
Thu Jul 13 17:32:51 GMT 2006





Hi,

During testing I discovered something interesting with different mount
methods.  This is the environment:

PDC = RedHat rhel4, 2.6.9-34.0.2ELsmp kernel, samba version 3.0.10-1.4E.6
Client = SuSE sles9, 2.6.5-7244-smp kernel, samba version 3.0.20b-3.4-SUSE

 I have a share (shareB) with attribute "readonly = yes" (smb.conf is
included below).   Mounting the share as user1 and
opening a file in the share for writing and appending gives me the
following results:

      Could not open for writing mounted with "mount -t cifs"
      Could not open for writing mounted with "smbmount"
      Could not open for appending mounted with "mount -t cifs"
      Opened for appending mount with "smbmount" (unexpected result)

After changing the share attributes from "readonly = yes" to "writelist =
user1" and restarting smbd, I tried again with these results:

      Could not open for writing mounted with "mount -t cifs" (unexpected
result)
      Opened for writing mounted with "smbmount"
      Opened for appending mounted with "mount -t cifs"
      Opened for appending mounted with "smbmount"

I tried this with open in perl and fopen in c with identical results.  Is
this a (known) problem?

#
# Generated by /usr/share/doc/samba-3.0.10/misc/modify_samba_config.pl
#
[global]
      adminusers                = Administrator, root
      addgroupscript            = /usr/sbin/groupadd -p "%g"
      addsharecommand           = /usr/share/doc/samba-3.0.10
/misc/modify_samba_config.pl
      winbindusedefaultdomain   = no
      deletesharecommand        = /usr/share/doc/samba-3.0.10
/misc/modify_samba_config.pl
      deleteuserfromgroupscript = /usr/sbin/groupmod -x "%u" "%g"
      maxlogsize                = 50
      adduserscript             = /usr/sbin/useradd -m "%u"
      idmapuid                  = 16777216-33554431
      dnsproxy                  = no
      deleteprintercommand      = /usr/share/doc/samba-3.0.10
/misc/modify_samba_config.pl
      addmachinescript          = /usr/sbin/useradd "%u"
      setprimarygroupscript     = /usr/sbin/usermod -g "%g" "%u"
      addprintercommand         = /usr/share/doc/samba-3.0.10
/misc/modify_samba_config.pl
      printcapname              = /etc/printcap
      domainlogons              = yes
      deleteuserscript          = /usr/sbin/userdel -r "%u"
      passdbbackend             = tdbsam
      logfile                   = /var/log/samba/%m.log
      socketoptions             = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
      cupsoptions               = raw
      loadprinters              = yes
      addusertogroupscript      = /usr/sbin/groupmod -m "%u" "%g"
      workgroup                 = SAMBA_TEST
      templateshell             = /bin/false
      serverstring              = Samba Server
      security                  = user
      domainmaster              = yes
      idmapgid                  = 16777216-33554431

## Section - [shareD]
[shareD]
      read list                 = @root, at users
      write list                = user1
      path                      = /tmp/shareD

## Section - [printers]
[printers]
      comment                   = All Printers
      browseable                = no
      writable                  = no
      printable                 = yes
      path                      = /var/spool/samba
      guestok                   = no

## Section - [shareA]
[shareA]
      readlist                  = user1
      path                      = /tmp/shareA
      writelist                 = user1

## Section - [shareC]
[shareC]
      readlist                  = @root, at users
      path                      = /tmp/shareC
      writelist                 = user1,user2

## Section - [homes]
[homes]
      comment                   = Home Directories
      browseable                = no
      writable                  = yes

## Section - [shareB]
[shareB]
      readonly                  = yes
      path                      = /tmp/shareB

#
# end of generated smb.conf
#

## [pshareA]
[pshareA]
      printer           = filepr
      directorymask     = 0775
      createmask  = 0664
      comment           = filepr
      printable   = Yes
      path        = /var/spool/samba
      writelist   = @ntadmin root

## [pshareB]
[pshareB]
      printer           = filepr
      directorymask     = 0775
      createmask  = 0664
      comment           = filepr
      printable   = Yes
      path        = /var/spool/samba
      writelist   = @ntadmin root


Sincerely,    Don Watson
Linux Technology and Solutions; Beaverton, OR
503-578-4861/TL: 775-4861; dwatson at us.ibm.com


More information about the samba mailing list