Highlighted
Absent Member.
Absent Member.
1040 views

PureFTPD count.txt

Hi Forum,

every logout will cause one entry in the pureftpd logfile like this one:
[ERROR] UN-AUTH: Failed to open file: /var/opt/novell/pure-ftpd/%USER%/count.txt, error: 2

The file does exist with 644 permissions.
Does anyone have a clue how to get rid of this message?

Thanks,
Pascal

"Have you tried turn it off and on again?"
Labels (2)
0 Likes
4 Replies
Highlighted
Knowledge Partner
Knowledge Partner

Re: PureFTPD count.txt

bendeichp;2398819 wrote:
Hi Forum,

every logout will cause one entry in the pureftpd logfile like this one:
[ERROR] UN-AUTH: Failed to open file: /var/opt/novell/pure-ftpd/%USER%/count.txt, error: 2

The file does exist with 644 permissions.
Does anyone have a clue how to get rid of this message?

Thanks,
Pascal


It seems like this is a bug#779871 that is fixed but not yet released, if you are able to open a SR then you could request for the PTF otherwise you need to wait until later this year when the update gets pushed out.

Thomas
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: PureFTPD count.txt

Hi Thomas,

thanks for the information. Unfortunately I 'm not allowed to view that bug.
I will open an SR like you suggested and see whats happening 🙂

Cheers,
Pascal

"Have you tried turn it off and on again?"
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: PureFTPD count.txt

There are more than one possible cause of failure to open count.txt. One involves cases where the session is chrooted. That case is what has recently been fixed by Novell but is not yet in maintenance. (I had hoped it would be in September maintenance but it looks like it will be November instead). I will post a script here (as a reply to this entry) which can work-around that problem.

The other cause is if file permissions get set in such a way as to prevent count.txt from getting created or accessed correctly. Once case seen was that /var/opt/novell/pure-ftpd/ was created with perms of 700 (because of custom umask setting for root). So user sessions could not work with their count.txt files. This can be corrected by setting perms of 755 on /var/opt/novell/pure-ftpd/.
0 Likes
Absent Member.
Absent Member.

Re: PureFTPD count.txt

The following script could be run (and left running) in order to work-around the case where chrooted ftp sessions are preventing proper access to count.txt file. After a permanent fix is released (probably OES November Maintenance) this script should be disabled.

#! /bin/sh

# Variable PAUSE sets interval in seconds for this script to repeat check for count.txt files that can be removed. Configure value 0 for continuous repetition.

PAUSE=60

# Please do not change any next variable value

OLDIFS=$IFS
IFS=$'\n'
USERDIR=""
OWNER=""
P_OWNER=""

while true; do
for USERDIR in `/usr/bin/find /var/opt/novell/pure-ftpd/ -maxdepth 1 -type d`; do
OWNER=`/bin/ls -lnd "$USERDIR" | cut -d " " -f 3`
/usr/bin/printf "no" > /tmp/pure-ftpd-owner-match
P_OWNER=""
/bin/ps -C pure-ftpd h -o uid | /usr/bin/grep $OWNER | /usr/bin/tr -d [:blank:] | while read P_OWNER; do
if test "$P_OWNER" = "$OWNER"; then
/usr/bin/printf "yes" > /tmp/pure-ftpd-owner-match
fi
done
if test "`/bin/cat /tmp/pure-ftpd-owner-match`" = "no" -a -e "$USERDIR" -a -e "$USERDIR"/count.txt; then
/bin/rm "$USERDIR"/count.txt
fi
done
/bin/sleep $PAUSE
done

IFS=$OLDIFS
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.