[projects/pld-ftp-admin] ftpiod: don't crash on rejected commands

arekm arekm at pld-linux.org
Sat Oct 24 11:45:08 CEST 2026


commit 0520344fbcf66ddb8021bffb51d30e72fc961e75
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Tue Oct 20 15:29:05 2026 +0200

    ftpiod: don't crash on rejected commands
    
    BailOut was a string, so raising it was a TypeError.

 modules/cmds.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/modules/cmds.py b/modules/cmds.py
index 9fa2b19..698bc5e 100644
--- a/modules/cmds.py
+++ b/modules/cmds.py
@@ -8,6 +8,10 @@ import hashlib
 import ftptree
 
 
+class BailOut(Exception):
+    pass
+
+
 def parse(con):
     if '\0' not in con.data:
         return
@@ -137,7 +141,7 @@ def cmd_login_cookie(con, cookie):
         con.sock.send(bytearray('OK '+cookies[cookie], encoding='utf-8'))
     else:
         # TODO: log this (or not)
-        con.sock.send(bytearray('FAIL'))
+        con.sock.send(bytearray('FAIL', encoding='utf-8'))
 
 def cmd_logout(con):
     if con.cookie in cookies:
@@ -179,7 +183,6 @@ cmdlist_noargs={'lout':cmd_logout, 'gett':cmd_gettree, 'slck':cmd_show_locks}
 
 # Global stuff and initializations
 
-BailOut="BailOut"
 locks={}
 logfile=open(common.ftpadmdir+'/var/log', 'a')
 load_creds()
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/pld-ftp-admin.git/commitdiff/e14cb7d4d74f8bdd9368d9645ecaf49593cf6335



More information about the pld-cvs-commit mailing list