[Pkg-samba-maint] Bug#739004: samba: can't save into a write-only directory

Michael Gold mgold at qnx.com
Fri Feb 14 20:17:42 UTC 2014


Package: samba
Version: 2:4.0.11+dfsg-1

Samba clients used to be able to copy files into write-only directories,
but at some point in the last year this stopped working.

To reproduce, create a write-only directory on the Samba server:
  mkdir -m 733 writeonly
Then mount it from a client and try to write into it:
  echo x > /in/writeonly/test
  /bin/sh: cannot create /in/writeonly/test: Permission denied
I have no trouble creating a file locally:
  su -s /bin/sh -c 'echo x > ~mgold/shared/inbox/writeonly/local' smbd

The strace output on the server shows that smbd is trying to open the
write-only directory:
  stat("writeonly/test", 0x7fff53c91a40)  = -1 ENOENT (No such file or directory)
  stat("writeonly", {st_mode=S_IFDIR|S_ISGID|0733, st_size=4096, ...}) = 0
  stat("writeonly/test", 0x7fff53c91a40)  = -1 ENOENT (No such file or directory)
  openat(AT_FDCWD, "writeonly", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 EACCES (Permission denied)

I'm guessing it wants the FD so it can pass that to another openat call
with the filename.  If so, the directory should be opened with O_SEARCH
(POSIX) or O_PATH (Linux) so read permission is not required.

- Michael


-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.12-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages samba depends on:
ii  adduser             3.113+nmu3
ii  dpkg                1.17.5
ii  libbsd0             0.6.0-1
ii  libc6               2.17-97
ii  libldb1             1:1.1.16-1
ii  libpam-modules      1.1.3-9
ii  libpam-runtime      1.1.3-9
ii  libpopt0            1.16-8
ii  libroken18-heimdal  1.6~git20131117+dfsg-3
ii  libtalloc2          2.1.0-1
ii  libtdb1             1.2.12-1
ii  libtevent0          0.9.19-1
ii  lsb-base            4.1+Debian12
ii  procps              1:3.3.4-2
ii  python              2.7.5-5
ii  python-dnspython    1.11.1-1
ii  python-samba        2:4.0.11+dfsg-1
pn  python2.7:any       <none>
ii  samba-common        2:4.0.11+dfsg-1
ii  samba-common-bin    2:4.0.11+dfsg-1
ii  samba-dsdb-modules  2:4.0.11+dfsg-1
ii  samba-libs          2:4.0.11+dfsg-1
ii  tdb-tools           1.2.12-1
ii  update-inetd        4.43

Versions of packages samba recommends:
ii  attr       1:2.4.47-1
ii  logrotate  3.8.6-1

Versions of packages samba suggests:
pn  bind9          <none>
pn  bind9utils     <none>
pn  ctdb           <none>
pn  ldb-tools      <none>
ii  ntp            1:4.2.6.p5+dfsg-3
pn  smbldap-tools  <none>
pn  winbind        <none>

-- debconf information:
  samba-common/title:
  samba/run_mode: daemons
  samba/generate_smbpasswd: true
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-samba-maint/attachments/20140214/278d09f4/attachment.sig>


More information about the Pkg-samba-maint mailing list