[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Mtree exit code
- To: misc_(_at_)_openbsd_(_dot_)_org
- Subject: Re: Mtree exit code
- From: Jason McIntyre <jasonmcintyre_(_at_)_f2s_(_dot_)_com>
- Date: Tue, 28 Dec 2004 23:08:05 +0000
- Mail-followup-to: misc_(_at_)_openbsd_(_dot_)_org
On Tue, Dec 28, 2004 at 04:40:59PM -0500, Roy Morris wrote:
>
> I think mtree is exiting with the wrong error code.
>
> Here is what the man page says ..
> The mtree utility exits with a status of 0 on success, 1 if any error oc-
> curred, and 2 if the file hierarchy did not match the specification. A
> status of 2 is converted to a status of 0 if the -U option is used.
>
> here is what I did as a test ..
> cd /sbin
> # mtree -ck md5digest,cksum,uid,gid,nlink,mode,type >/root/sbin.mtree
> # mtree </root/sbin.mtree
> # touch /sbin/roy.txt
> # mtree </root/sbin.mtree
> extra: roy.txt
> # echo $?
> 0
>
i think you're correct that sth is not right...
poking around a bit, this seems to happen if *either* the `time' keyword
is not specified, *or* extra() in verify.c is the last routine to return.
that is,
# mtree -ck md5digest,cksum,uid,gid,nlink,mode,type,time
seems to work ok, or if there is another change in the hierarchy (not
just an added file) e.g. i alter a file and the md5 check comes after
the extra() check, it works ok too.
i guess sth is not setting the return value correctly.
jmc
Visit your host, monkey.org