newsyslog problems with -C

Riccardo Torrini riccardo at torrini.org
Fri Aug 1 17:03:41 PDT 2003


I have created a private newsyslog.conf with this contents:

-----8<-----
/var/tmp/foo	foo:mail	600	7	*	@T00	ZBCN
/var/tmp/bar	bar:mail	600	7	*	@T00	ZBCN
-----8<-----

Without creating by hand /var/tmp/{foo,bar} this command fail leaving the
temporary mkstemp /var/tmp/{foo,bar}.zXXXXXX (with XXXXXX variable):

# cd /var/tmp
# newsyslog -vvvvv -F -C -f /usr/local/etc/rotatemailbackup.conf
        --> [creating entry for /var/tmp/foo]
        --> [creating entry for /var/tmp/bar]
/var/tmp/foo <7Z>: does not exist -> will create.
newsyslog: can't fchmod temp file '/var/tmp/foo.z8FjDcW': Bad file descriptor

# newsyslog -vvvvv -F -CC -f /silos/usr/local/etc/rotatemailbackup.conf
        --> [creating entry for /var/tmp/foo]
        --> [creating entry for /var/tmp/bar]
/var/tmp/foo <7Z>: does not exist -> will create.
newsyslog: can't fchmod temp file '/var/tmp/foo.zyXVe1U': Bad file descriptor

But it works if I manually 'touch' both {foo,bar}

# touch foo bar
# newsyslog -vvvvv -F -C -f /silos/usr/local/etc/rotatemailbackup.conf
        --> [creating entry for /var/tmp/foo]
        --> [creating entry for /var/tmp/bar]
/var/tmp/foo <7Z>: --> trimming log....
        --> [freeing entry for /var/tmp/foo]
/var/tmp/bar <7Z>: --> trimming log....
        --> [freeing entry for /var/tmp/bar]

# newsyslog -vvvvv -F -CC -f /silos/usr/local/etc/rotatemailbackup.conf
        --> [creating entry for /var/tmp/foo]
        --> [creating entry for /var/tmp/bar]
/var/tmp/foo <7Z>: --> trimming log....
        --> [freeing entry for /var/tmp/foo]
/var/tmp/bar <7Z>: --> trimming log....
        --> [freeing entry for /var/tmp/bar]


It also fails if I remove the mandatory "C" flag from config file.
So, how the -C and C parameters are supposed to works?


NB: this happens on both 4.8 and recent -CURRENT and only when user:group
    are specified...


-- 
Riccardo. ( http://www.GUFI.org/~vic/ )


More information about the freebsd-current mailing list