Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Aug 2003 02:03:32 +0200
From:      Riccardo Torrini <riccardo@torrini.org>
To:        freebsd-current@FreeBSD.ORG
Subject:   newsyslog problems with -C
Message-ID:  <20030802000332.GD73426@trudy.torrini.home>

next in thread | raw e-mail | index | archive | help
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/ )



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030802000332.GD73426>