On 04/21/2015 06:02 PM, Wietse Venema wrote:
> Mika Ilmaranta:
>>
>> dymap_init() reads /etc/postfix/dynamicmaps.cf.d directory and we seem
>> to constantly get "warning: /etc/postfix/dynamicmaps.cf.d: directory
>> read error: No such file or directory".
> 
> Postfix is the messenger, don't blame the messenger for bad news.
> 
>> ---8<---
>> Apr 21 16:41:47 foo7 postfix/qmgr[3538]: scan_dir_push: open
>> /etc/postfix/dynamicmaps.cf.d
>> Apr 21 16:41:47 foo7 postfix/qmgr[3538]: scan_dir_next: skip .
>> Apr 21 16:41:47 foo7 postfix/qmgr[3538]: scan_dir_next: skip ..
>> Apr 21 16:41:47 foo7 postfix/qmgr[3538]: warning:
>> /etc/postfix/dynamicmaps.cf.d: directory read error: No such file or
>> directory
> 
> ENOENT after reading '.' and '..' is bogus.
> 
> The file system is corrupted (for example, a directory entry contains
> the number of an unallocated inode), or some "security" software
> reports a fake error because it has not been updated to permit
> access to files under the dynamicmaps.cf.d directory which is new
> with Postfix 3.x.
> 
> Try without Apparmor or Selinux.
> 
>       Wietse
> 

I don't think this is SeLinux related.

[root@foo7 ~]# getenforce
Permissive


Patch:
diff -up postfix-3.0.1/src/global/dynamicmaps.c.reset-errno
postfix-3.0.1/src/global/dynamicmaps.c
--- postfix-3.0.1/src/global/dynamicmaps.c.reset-errno  2015-04-21
18:37:29.641532865 +0300
+++ postfix-3.0.1/src/global/dynamicmaps.c      2015-04-21 18:40:35.594131643
+0300
@@ -329,6 +329,12 @@ void    dymap_init(const char *conf_path
     if (access(conf_path_d, R_OK | X_OK) == 0
        && (dir = scan_dir_open(conf_path_d)) != 0) {
        sub_conf_path = vstring_alloc(100);
+
+       if(errno != 0)
+           msg_warn("%s: errno set before scan_dir_next while loop, resetting
now: %m", myname);
+
+       errno = 0;
+
        while ((conf_name = scan_dir_next(dir)) != 0) {
            vstring_sprintf(sub_conf_path, "%s/%s", conf_path_d, conf_name);
            dymap_read_conf(vstring_str(sub_conf_path), plugin_dir);


And I get log:

Apr 21 18:51:11 foo7 postfix/postmap[5099]: warning: dymap_init: errno
set before scan_dir_next while loop, resetting now: No such file or
directory
Apr 21 18:51:12 foo7 postfix/postmap[5104]: warning: dymap_init: errno
set before scan_dir_next while loop, resetting now: No such file or
directory
Apr 21 18:51:12 foo7 postfix/postmap[5109]: warning: dymap_init: errno
set before scan_dir_next while loop, resetting now: No such file or
directory
Apr 21 18:51:12 foo7 postfix/postmap[5114]: warning: dymap_init: errno
set before scan_dir_next while loop, resetting now: No such file or
directory
Apr 21 18:51:12 foo7 postfix/postmap[5119]: warning: dymap_init: errno
set before scan_dir_next while loop, resetting now: No such file or
directory
Apr 21 18:51:12 foo7 postfix/postmap[5124]: warning: dymap_init: errno
set before scan_dir_next while loop, resetting now: No such file or
directory
Apr 21 18:51:12 foo7 postfix/postmap[5129]: warning: dymap_init: errno
set before scan_dir_next while loop, resetting now: No such file or
directory
Apr 21 18:51:12 foo7 postfix/postmap[5134]: warning: dymap_init: errno
set before scan_dir_next while loop, resetting now: No such file or
directory
Apr 21 18:51:12 foo7 postfix/postmap[5139]: warning: dymap_init: errno
set before scan_dir_next while loop, resetting now: No such file or
directory
Apr 21 18:51:12 foo7 postfix/postfix-script[5221]: starting the Postfix
mail system
Apr 21 18:51:12 foo7 postfix/master[5223]: daemon started -- version
3.0.1, configuration /etc/postfix
Apr 21 18:51:12 foo7 postfix/pickup[5224]: warning: dymap_init: errno
set before scan_dir_next while loop, resetting now: No such file or
directory
Apr 21 18:51:12 foo7 postfix/qmgr[5225]: warning: dymap_init: errno set
before scan_dir_next while loop, resetting now: No such file or directory

//Mika


-- 
Mika Ilmaranta <il...@foobar.fi>
Foobar Linux services
+358 50 3023638
Foobar Oy <http://foobar.fi/>

Reply via email to