Precise 5.5 PureFTPd Flash drive problem

Please post any bugs you have found
Post Reply
Message
Author
User avatar
Packetteer
Posts: 73
Joined: Sat 12 May 2012, 19:33
Location: Long Island Ny

Precise 5.5 PureFTPd Flash drive problem

#1 Post by Packetteer »

Hi All
I do not know if anyone else is seeing this or not.
But if you are I have a work around.

Problem: The root/ftpd directory is not being saved to the precisesave.2fs
file. I have two lap tops one is using a live cd to boot puppy and the
precisesave.2fs file is being saved on the hard drive as in a frugal install.
On this lap top when a file is put into the root/ftpd directory on next boot
the file is still there in the directory as it should be.

On the other lap top puppy is being booted from a USB flash drive.
the precisesave.2fs file is being saved to the same flash drive.
On this lap top when a file is put into the root/ftpd directory on next boot the file is not in the root/ftpd directory. In fact the root/ftpd
directory is empty.

The work around for this problem is
in the file /etc/passwd you will find the following line.
ftp:x:1000:1000:Linux User,,,:/root/ftpd:/bin/sh
Change the directory in the above line to read
ftp:x:1000:1000:Linux User,,,:/root/my-documents/ftpd:/bin/sh

Create a new directory in root/my-documents/ftpd
Delete the root/ftpd directory.

Note I have only used PureFTPd with anonymous log ins.

Again I do not know if somehow I am the only person who has seen
this.
Sorry if this has already been discussed. I did a search and found
nothing about this problem any where on the net.

I hope that this will help someone.

Thank you for your time in reading this.

npierce
Posts: 858
Joined: Tue 29 Dec 2009, 01:40

#2 Post by npierce »

Hi Packetteer,

Thanks for this work-around.

Surprisingly, the exclusion of the /root/ftpd/ directory from the save file appears to be intentional.

When using a flash drive, saving to the save file involves the /usr/sbin/snapmergepuppy script. Apparently Barry added the exclusion on 2010-Apr-22, as documented in this comment in the script:

Code: Select all

#100422 added ^root/ftpd exclusion.
Barry's blog entries for that and nearby dates makes no mention of this change, so I don't know his reasons for it. Some people use that directory only occasionally by temporarily copying files to it for sharing, with the originals safely stored elsewhere. So perhaps this was considered to be a "temporary" storage area, and not worth taking up space in a save file.

Of course others, such as yourself, may want the files to remain available for a longer period, so prefer that directory to be persistent. Your work-around solves that problem nicely.

Alternatively, one could make a backup of the /usr/sbin/snapmergepuppy script and remove the exclusion from the original. It is in this very long line (in Precise 5.7.1 it is line 133):

Code: Select all

find . -mount -not \( -regex '.*/\.wh\.[^/]*' -type f \) -not -type d |  sed -e 's/\.\///' | grep -v -E '^mnt|^initrd|^proc|^sys|^tmp|^pup_|^zdrv_|^root/tmp|_zdrv_|^dev/\.|^dev/fd|^dev/pts|^dev/shm|^\.wh\.|^var/run|^root/ftpd|^var/tmp|\.XLOADED$' | grep -v -E -i '\.thumbnails|\.trash|trash/|\.part$'  |
Removing |^root/ftpd so that the line becomes:

Code: Select all

find . -mount -not \( -regex '.*/\.wh\.[^/]*' -type f \) -not -type d |  sed -e 's/\.\///' | grep -v -E '^mnt|^initrd|^proc|^sys|^tmp|^pup_|^zdrv_|^root/tmp|_zdrv_|^dev/\.|^dev/fd|^dev/pts|^dev/shm|^\.wh\.|^var/run|^var/tmp|\.XLOADED$' | grep -v -E -i '\.thumbnails|\.trash|trash/|\.part$'  |
should allow the /root/ftpd/ directory to be saved.

User avatar
Packetteer
Posts: 73
Joined: Sat 12 May 2012, 19:33
Location: Long Island Ny

#3 Post by Packetteer »

Hi npierce
Thank you for the information.
What you said about the contents of the ftpd directory being
temporary makes a lot of sense.

One thing I need to add to the work around is that after you create
the ftpd directory in the my-documents directory you have to
set the permissions. Basically you set all the permissions so everyone
can do what ever they like in the ftpd directory. But since the only way to
this directory is through FTP and since I have set it up to use anonymous
logins no one can delete files or cause other harm.

One other thing is that the Linux box that is running this server is not
connected to the internet. It is connected to an amateur radio mesh network.

The wifi router that the server is connected to cannot be connected to via
Wifi. The only way to connect to the server is to use a another router that
has the mesh software flashed on it.

Only reason I mention the mesh stuff is so that someone does not come
back and say that the permissions cause a security risk. Not in this case.
The mesh network is a private one. Plus the server Linux box has nothing
else on it. It is just some old pc with an empty hard drive.

Again thank you npierce for your time in replying to my post and the
information you provided.

Originally I thought that the not saving of the ftpd directory contents
was a mistake. Now I know thanks to you that it is designed that way.

npierce
Posts: 858
Joined: Tue 29 Dec 2009, 01:40

#4 Post by npierce »

You're welcome.

Amateur radio mesh networks sound like a great idea.

Post Reply