Начну сразу с описания ПО:
- FreeBSD 8.2-STABLE #0 amd64, вся файловая система на zfs
- mysql-server-5.5.19
- proftpd 1.3.3g + mod_sql
- conf и информация ниже
Имеем настроенный proftpd + mod_sql, mysql с настроенной базой юзеров. Проблема состоит в том, что при записи нового файла, groupowner=0.
Код: Выделить всё
# lf /www/ftp/
-rw-r--r-- 1 2003 wheel 3.2k Feb 14 15:19 proftpd.sql
dump.sql
Код: Выделить всё
select * from groups;
+------+----------+--------+---------+---------------------+
| id | name | enable | members | created |
+------+----------+--------+---------+---------------------+
| 2003 | ftpusers | y | test | 2012-02-14 00:00:00 |
+------+----------+--------+---------+---------------------+
select * from users;
+------+-------+--------+-------------------------------------------+----------+-----------+---------+---------------------+
| id | name | enable | pass | group_id | home | shell | created |
+------+-------+--------+-------------------------------------------+----------+-----------+---------+---------------------+
| 2003 | test | y | .... | 2003 | /www/ftp/ | /bin/sh | 2012-02-14 00:00:00 |
+------+-------+--------+-------------------------------------------+----------+-----------+---------+---------------------+
Код: Выделить всё
ServerType standalone
Port 21
DefaultServer off
User nobody
Group nogroup
SystemLog /var/log/proftpd/system.log
MaxInstances 30
CommandBufferSize 512
ScoreboardFile /var/run/proftpd/proftpd.scoreboard
ServerName "..."
ServerAdmin "..."
ServerIdent on "..."
DefaultAddress 127.0.0.1
AccessDenyMsg "..."
AccessGrantMsg "..."
Umask 022
AllowOverwrite on
RootLogin off
<virtualhost ip1>
ServerName "..."
ServerAdmin "..."
ServerIdent on "..."
AccessDenyMsg "..."
AccessGrantMsg "..."
ServerLog /var/log/proftpd/ip1.log
Umask 022
AllowOverwrite on
</virtualhost>
<virtualhost ip2>
ServerName "..."
ServerAdmin "..."
ServerIdent on "..."
ServerLog /var/log/proftpd/ip2.log
PassivePorts min max
AccessDenyMsg "..."
AccessGrantMsg "..."
AuthOrder mod_sql.c
SQLAuthenticate users groups
SQLAuthTypes Backend
SQLBackend mysql
SQLDefaultUID 2001
SQLDefaultGID 2001
SQLMinUserUID 2001
SQLMinUserGID 2001
SQLConnectInfo ...
SQLGroupInfo groups name id members
SQLGroupWhereClause "enable='y'"
SQLUserInfo users name pass id group_id home shell
SQLUserWhereClause "enable='y'"
DirFakeUser off
DirFakeGroup off
DefaultChdir ~
DefaultRoot ~
Umask 022
AllowOverwrite on
SQLLogFile /var/log/proftpd/sql.log
</virtualhost>
Server(ip2.log):
Код: Выделить всё
Feb 14 15:19:10 proftpd[4927] ...: FTP session opened.
Feb 14 15:19:17 proftpd[4927] ...: Preparing to chroot to directory '/www/ftp'
Feb 14 15:19:17 proftpd[4927] ...: USER test: Login successful.
Feb 14 15:19:44 proftpd[4927] ...: FTP session closed.
Код: Выделить всё
Feb 14 15:19:10 mod_sql/4.2.5[4927]: defaulting to 'mysql' backend
Feb 14 15:19:10 mod_sql/4.2.5[4927]: backend module 'mod_sql_mysql/4.0.8'
Feb 14 15:19:10 mod_sql/4.2.5[4927]: backend api 'mod_sql_api_v1'
Feb 14 15:19:10 mod_sql/4.2.5[4927]: >>> sql_sess_init
Feb 14 15:19:10 mod_sql/4.2.5[4927]: entering mysql cmd_defineconnection
Feb 14 15:19:10 mod_sql/4.2.5[4927]: name: 'default'
Feb 14 15:19:10 mod_sql/4.2.5[4927]: user: '...'
Feb 14 15:19:10 mod_sql/4.2.5[4927]: host: '...'
Feb 14 15:19:10 mod_sql/4.2.5[4927]: db: '...'
Feb 14 15:19:10 mod_sql/4.2.5[4927]: port: '...'
Feb 14 15:19:10 mod_sql/4.2.5[4927]: ttl: '0'
Feb 14 15:19:10 mod_sql/4.2.5[4927]: exiting mysql cmd_defineconnection
Feb 14 15:19:10 mod_sql/4.2.5[4927]: mod_sql engine : on
Feb 14 15:19:10 mod_sql/4.2.5[4927]: negative_cache : off
Feb 14 15:19:10 mod_sql/4.2.5[4927]: authenticate : users groups
Feb 14 15:19:10 mod_sql/4.2.5[4927]: usertable : users
Feb 14 15:19:10 mod_sql/4.2.5[4927]: userid field : name
Feb 14 15:19:10 mod_sql/4.2.5[4927]: password field : pass
Feb 14 15:19:10 mod_sql/4.2.5[4927]: UID field : id
Feb 14 15:19:10 mod_sql/4.2.5[4927]: GID field : group_id
Feb 14 15:19:10 mod_sql/4.2.5[4927]: homedir field : home
Feb 14 15:19:10 mod_sql/4.2.5[4927]: shell field : shell
Feb 14 15:19:10 mod_sql/4.2.5[4927]: group table : groups
Feb 14 15:19:10 mod_sql/4.2.5[4927]: groupname field : name
Feb 14 15:19:10 mod_sql/4.2.5[4927]: grp GID field : id
Feb 14 15:19:10 mod_sql/4.2.5[4927]: grp members field : members
Feb 14 15:19:10 mod_sql/4.2.5[4927]: SQLMinUserUID : 2001
Feb 14 15:19:10 mod_sql/4.2.5[4927]: SQLMinUserGID : 2001
Feb 14 15:19:10 mod_sql/4.2.5[4927]: SQLDefaultUID : 2001
Feb 14 15:19:10 mod_sql/4.2.5[4927]: SQLDefaultGID : 2001
Feb 14 15:19:10 mod_sql/4.2.5[4927]: <<< sql_sess_init
Feb 14 15:19:17 mod_sql/4.2.5[4927]: >>> sql_pre_pass
Feb 14 15:19:17 mod_sql/4.2.5[4927]: <<< sql_pre_pass
Feb 14 15:19:17 mod_sql/4.2.5[4927]: >>> cmd_getpwnam
Feb 14 15:19:17 mod_sql/4.2.5[4927]: entering mysql cmd_escapestring
Feb 14 15:19:17 mod_sql/4.2.5[4927]: entering mysql cmd_open
Feb 14 15:19:17 mod_sql/4.2.5[4927]: MySQL client version: 5.5.20
Feb 14 15:19:17 mod_sql/4.2.5[4927]: MySQL server version: 5.5.19
Feb 14 15:19:17 mod_sql/4.2.5[4927]: MySQL connection character set now 'utf8' (from 'UTF-8')
Feb 14 15:19:17 mod_sql/4.2.5[4927]: connection 'default' opened
Feb 14 15:19:17 mod_sql/4.2.5[4927]: connection 'default' count is now 2
Feb 14 15:19:17 mod_sql/4.2.5[4927]: exiting mysql cmd_open
Feb 14 15:19:17 mod_sql/4.2.5[4927]: entering mysql cmd_close
Feb 14 15:19:17 mod_sql/4.2.5[4927]: connection 'default' count is now 1
Feb 14 15:19:17 mod_sql/4.2.5[4927]: exiting mysql cmd_close
Feb 14 15:19:17 mod_sql/4.2.5[4927]: exiting mysql cmd_escapestring
Feb 14 15:19:17 mod_sql/4.2.5[4927]: cache miss for user 'test'
Feb 14 15:19:17 mod_sql/4.2.5[4927]: : entering mysql cmd_select
Feb 14 15:19:17 mod_sql/4.2.5[4927]: entering mysql cmd_open
Feb 14 15:19:17 mod_sql/4.2.5[4927]: connection 'default' count is now 2
Feb 14 15:19:17 mod_sql/4.2.5[4927]: exiting mysql cmd_open
Feb 14 15:19:17 mod_sql/4.2.5[4927]: query "SELECT name, pass, id, group_id, home, shell FROM users WHERE (name='test') AND (((enable='y'))) LIMIT 1"
Feb 14 15:19:17 mod_sql/4.2.5[4927]: entering mysql cmd_close
Feb 14 15:19:17 mod_sql/4.2.5[4927]: connection 'default' count is now 1
Feb 14 15:19:17 mod_sql/4.2.5[4927]: exiting mysql cmd_close
Feb 14 15:19:17 mod_sql/4.2.5[4927]: exiting mysql cmd_select
Feb 14 15:19:17 mod_sql/4.2.5[4927]: cache miss for user 'test'
Feb 14 15:19:17 mod_sql/4.2.5[4927]: user 'test' cached
Feb 14 15:19:17 mod_sql/4.2.5[4927]: + pwd.pw_name : test
Feb 14 15:19:17 mod_sql/4.2.5[4927]: + pwd.pw_uid : 2003
Feb 14 15:19:17 mod_sql/4.2.5[4927]: + pwd.pw_gid : 2003
Feb 14 15:19:17 mod_sql/4.2.5[4927]: + pwd.pw_dir : /www/ftp/
Feb 14 15:19:17 mod_sql/4.2.5[4927]: + pwd.pw_shell : /bin/sh
Feb 14 15:19:17 mod_sql/4.2.5[4927]: <<< cmd_getpwnam
Feb 14 15:19:17 mod_sql/4.2.5[4927]: >>> cmd_gid2name
Feb 14 15:19:17 mod_sql/4.2.5[4927]: cache miss for GID '2003'
Feb 14 15:19:17 mod_sql/4.2.5[4927]: : entering mysql cmd_select
Feb 14 15:19:17 mod_sql/4.2.5[4927]: entering mysql cmd_open
Feb 14 15:19:17 mod_sql/4.2.5[4927]: connection 'default' count is now 2
Feb 14 15:19:17 mod_sql/4.2.5[4927]: exiting mysql cmd_open
Feb 14 15:19:17 mod_sql/4.2.5[4927]: query "SELECT name FROM groups WHERE (id = 2003) AND (((enable='y'))) LIMIT 1"
Feb 14 15:19:17 mod_sql/4.2.5[4927]: entering mysql cmd_close
Feb 14 15:19:17 mod_sql/4.2.5[4927]: connection 'default' count is now 1
Feb 14 15:19:17 mod_sql/4.2.5[4927]: exiting mysql cmd_close
Feb 14 15:19:17 mod_sql/4.2.5[4927]: exiting mysql cmd_select
Feb 14 15:19:17 mod_sql/4.2.5[4927]: : entering mysql cmd_select
Feb 14 15:19:17 mod_sql/4.2.5[4927]: entering mysql cmd_open
Feb 14 15:19:17 mod_sql/4.2.5[4927]: connection 'default' count is now 2
Feb 14 15:19:17 mod_sql/4.2.5[4927]: exiting mysql cmd_open
Feb 14 15:19:17 mod_sql/4.2.5[4927]: query "SELECT name, id, members FROM groups WHERE (name = 'ftpusers') AND (((enable='y')))"
Feb 14 15:19:17 mod_sql/4.2.5[4927]: entering mysql cmd_close
Feb 14 15:19:17 mod_sql/4.2.5[4927]: connection 'default' count is now 1
Feb 14 15:19:17 mod_sql/4.2.5[4927]: exiting mysql cmd_close
Feb 14 15:19:17 mod_sql/4.2.5[4927]: exiting mysql cmd_select
Feb 14 15:19:17 mod_sql/4.2.5[4927]: cache miss for group 'ftpusers'
Feb 14 15:19:17 mod_sql/4.2.5[4927]: group 'ftpusers' cached
Feb 14 15:19:17 mod_sql/4.2.5[4927]: + grp.gr_name : ftpusers
Feb 14 15:19:17 mod_sql/4.2.5[4927]: + grp.gr_gid : 2003
Feb 14 15:19:17 mod_sql/4.2.5[4927]: + grp.gr_mem : test
Feb 14 15:19:17 mod_sql/4.2.5[4927]: <<< cmd_gid2name
Feb 14 15:19:17 mod_sql/4.2.5[4927]: >>> cmd_getgroups
Feb 14 15:19:17 mod_sql/4.2.5[4927]: cache hit for user 'test'
Feb 14 15:19:17 mod_sql/4.2.5[4927]: cache hit for group 'ftpusers'
Feb 14 15:19:17 mod_sql/4.2.5[4927]: entering mysql cmd_escapestring
Feb 14 15:19:17 mod_sql/4.2.5[4927]: entering mysql cmd_open
Feb 14 15:19:17 mod_sql/4.2.5[4927]: connection 'default' count is now 2
Feb 14 15:19:17 mod_sql/4.2.5[4927]: exiting mysql cmd_open
Feb 14 15:19:17 mod_sql/4.2.5[4927]: entering mysql cmd_close
Feb 14 15:19:17 mod_sql/4.2.5[4927]: connection 'default' count is now 1
Feb 14 15:19:17 mod_sql/4.2.5[4927]: exiting mysql cmd_close
Feb 14 15:19:17 mod_sql/4.2.5[4927]: exiting mysql cmd_escapestring
Feb 14 15:19:17 mod_sql/4.2.5[4927]: : entering mysql cmd_select
Feb 14 15:19:17 mod_sql/4.2.5[4927]: entering mysql cmd_open
Feb 14 15:19:17 mod_sql/4.2.5[4927]: connection 'default' count is now 2
Feb 14 15:19:17 mod_sql/4.2.5[4927]: exiting mysql cmd_open
Feb 14 15:19:17 mod_sql/4.2.5[4927]: query "SELECT name, id, members FROM groups WHERE (members = 'test' OR members LIKE 'test,%' OR members LIKE '%,test' OR members LIKE '%,test,%') AND (((enable='y')))"
Feb 14 15:19:17 mod_sql/4.2.5[4927]: entering mysql cmd_close
Feb 14 15:19:17 mod_sql/4.2.5[4927]: connection 'default' count is now 1
Feb 14 15:19:17 mod_sql/4.2.5[4927]: exiting mysql cmd_close
Feb 14 15:19:17 mod_sql/4.2.5[4927]: exiting mysql cmd_select
Feb 14 15:19:17 mod_sql/4.2.5[4927]: cache hit for group 'ftpusers'
Feb 14 15:19:17 mod_sql/4.2.5[4927]: <<< cmd_getgroups
Feb 14 15:19:17 mod_sql/4.2.5[4927]: >>> cmd_auth
Feb 14 15:19:17 mod_sql/4.2.5[4927]: entering mysql cmd_escapestring
Feb 14 15:19:17 mod_sql/4.2.5[4927]: entering mysql cmd_open
Feb 14 15:19:17 mod_sql/4.2.5[4927]: connection 'default' count is now 2
Feb 14 15:19:17 mod_sql/4.2.5[4927]: exiting mysql cmd_open
Feb 14 15:19:17 mod_sql/4.2.5[4927]: entering mysql cmd_close
Feb 14 15:19:17 mod_sql/4.2.5[4927]: connection 'default' count is now 1
Feb 14 15:19:17 mod_sql/4.2.5[4927]: exiting mysql cmd_close
Feb 14 15:19:17 mod_sql/4.2.5[4927]: exiting mysql cmd_escapestring
Feb 14 15:19:17 mod_sql/4.2.5[4927]: cache hit for user 'test'
Feb 14 15:19:17 mod_sql/4.2.5[4927]: >>> cmd_check
Feb 14 15:19:17 mod_sql/4.2.5[4927]: checking password using SQLAuthType 'Backend'
Feb 14 15:19:17 mod_sql/4.2.5[4927]: entering mysql cmd_checkauth
Feb 14 15:19:17 mod_sql/4.2.5[4927]: exiting mysql cmd_checkauth
Feb 14 15:19:17 mod_sql/4.2.5[4927]: 'Backend' SQLAuthType handler reports success
Feb 14 15:19:17 mod_sql/4.2.5[4927]: cache hit for user 'test'
Feb 14 15:19:17 mod_sql/4.2.5[4927]: <<< cmd_check
Feb 14 15:19:17 mod_sql/4.2.5[4927]: <<< cmd_auth
Feb 14 15:19:17 mod_sql/4.2.5[4927]: >>> cmd_getpwnam
Feb 14 15:19:17 mod_sql/4.2.5[4927]: cache hit for user 'test'
Feb 14 15:19:17 mod_sql/4.2.5[4927]: <<< cmd_getpwnam
Feb 14 15:19:17 mod_sql/4.2.5[4927]: >>> cmd_getpwnam
Feb 14 15:19:17 mod_sql/4.2.5[4927]: cache hit for user 'test'
Feb 14 15:19:17 mod_sql/4.2.5[4927]: <<< cmd_getpwnam
Feb 14 15:19:41 mod_sql/4.2.5[4927]: >>> sql_post_stor
Feb 14 15:19:41 mod_sql/4.2.5[4927]: <<< sql_post_stor
Feb 14 15:19:44 mod_sql/4.2.5[4927]: entering mysql cmd_exit
Feb 14 15:19:44 mod_sql/4.2.5[4927]: entering mysql cmd_close
Feb 14 15:19:44 mod_sql/4.2.5[4927]: connection 'default' closed
Feb 14 15:19:44 mod_sql/4.2.5[4927]: connection 'default' count is now 0
Feb 14 15:19:44 mod_sql/4.2.5[4927]: exiting mysql cmd_close
Feb 14 15:19:44 mod_sql/4.2.5[4927]: exiting mysql cmd_exit