Olf fashioned 'anonynous' FTP 'incoming' directory

TAKAHASHI Motonobu monyo at monyo.com
Sat Jan 8 00:23:07 MST 2011


> Or does this yield something different on your machine ? Or am I making a conceptual mistake ?

Perhaps I do not understand what you want to do.

> And while a mount succeeds -

What does your "mount" mean?
And Why do you have to set 111 to the directory?

In the previous response, I tested on Debian Lenny + self-built Samba 3.5.6.

Now I tested on FreeBSD 8.1-RELEASE (just running in my lab)  + Samba 3.4.8
from Packages.

1) Create a samba user:
 'pdbedit -a local'

2) Create a directory:

# mkdir -p /var/lib/samba/shares/incoming
# chmod 1777 /var/lib/samba/shares/incoming
# chown root /var/lib/samba/shares/incoming

3) Setting smb.conf:
-----
[global]

# nothing is set.

[incoming]
 path = /var/lib/samba/incoming
 writeable = yes
 inherit owner = yes
 force create mode = 444
 hide unwriteable files = yes
-----

4) Access from Windows XP:
 type 'net use \\fbsd81-3\incoming <password> /user:local'

 # the name of my Samba server is fbsd81-3.

5) Create a text file and read from Windows:
  echo test1 > \\fbsd81-3\incoming\test1.txt
  dir \\fbsd81-3\incoming\test1.txt
  dir \\fbsd81-3\incoming
  # Both dir does not show test1.txt.
  type \\fbsd81-3\incoming\test1.txt
  # shows the content of test1.txt.

This behavior is 'FTP style incoming directory'?

2011/1/7 Dirk-Willem van Gulik <Dirk-willem.Van.gulik at bbc.co.uk>:
> So on unix I have:
>
>  SETUP:
>        $ mkdir -p /data/foo/bar
>        $ echo Hi > /data/foo/bar/test.txt
>        $ chmod 0111 /data/foo
>
>  CHECK denied
>        $ ls /data
>        foo
>        $ ls /data/foo
>        ls: /data/foo: Permission denied
>
>  CHECK ok:
>        $ ls /data/foo/bar
>        test.txt
>        $ cat /data/foo/bar/test.txt
>        Hi

It's OK but the settings above have something to do with Samba?

> Foregoing the 'posix' behaviour of allowing a 0111-directory/xx/0666-file to be in fact accessible.  (Hence my patch/modifies in [1],[2] which I think are done at the wrong level).

If you archieve like that via Samba, setting below

-----
[incoming2]
  path = /some/where/incoming2
  writeable = yes
  hide unreadable = yes
-----

# mkdir  -p /some/where/incoming2/testdir1/testdir11

# chmod 111 /some/where/incoming2/testdir1
# chmod 555 /some/where/incoming2/testdir1/testdir11

# echo test1 > /some/where/incoming2/testdir1/testdir1/test1.txt
# chmod 444 /some/where/incoming2/testdir1/testdir11/test1.txt

You can not see testdir1 from Windows (SMB client) but you
can 'cd' into it and dir \\server\incoming2\testdir1\testdir11 shows test1.txt.

---
TAKAHASHI Motonobu <monyo at samba.gr.jp>


More information about the samba-technical mailing list