newsyslog problems with -C

From: Riccardo Torrini <riccardo_at_torrini.org>
Date: Sat, 2 Aug 2003 02:03:32 +0200
I have created a private newsyslog.conf with this contents:

-----8<-----
/var/tmp/foo	foo:mail	600	7	*	_at_T00	ZBCN
/var/tmp/bar	bar:mail	600	7	*	_at_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/ )
Received on Fri Aug 01 2003 - 15:03:41 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:17 UTC