NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/49005: [patch] t_truncate: use /etc/motd instead of /usr/bin/fpr



On Jul 17, 2014, at 12:20, Garrett Cooper <yaneurabeya%gmail.com@localhost> wrote:

> The following reply was made to PR bin/49005; it has been noted by GNATS.
> 
> From: Garrett Cooper <yaneurabeya%gmail.com@localhost>
> To: "gnats-bugs%NetBSD.org@localhost" <gnats-bugs%netbsd.org@localhost>
> Cc: "gnats-admin%netbsd.org@localhost" <gnats-admin%netbsd.org@localhost>, 
> 	"netbsd-bugs%netbsd.org@localhost" <netbsd-bugs%netbsd.org@localhost>
> Subject: Re: bin/49005: [patch] t_truncate: use /etc/motd instead of /usr/bin/fpr
> Date: Thu, 17 Jul 2014 12:19:42 -0700
> 
> On Thu, Jul 17, 2014 at 12:19 PM, Garrett Cooper <yaneurabeya%gmail.com@localhost> wrote:
>> On Thu, Jul 17, 2014 at 2:10 AM, David Holland <dholland-bugs%netbsd.org@localhost> wrote:
>>> The following reply was made to PR bin/49005; it has been noted by GNATS.
>>> 
>>> From: David Holland <dholland-bugs%netbsd.org@localhost>
>>> To: gnats-bugs%NetBSD.org@localhost
>>> Cc:
>>> Subject: Re: bin/49005: [patch] t_truncate: use /etc/motd instead of
>>> /usr/bin/fpr
>>> Date: Thu, 17 Jul 2014 09:05:40 +0000
>>> 
>>> On Thu, Jul 17, 2014 at 05:40:00AM +0000, yaneurabeya%gmail.com@localhost wrote:
>>>>> Description:
>>>> FreeBSD doesn't have /usr/bin/fpr, but it does have /etc/motd, so the testcase should be changed to use /etc/motd.
>>> 
>>> /usr/bin/fpr was chosen on the grounds that it's expendable if
>>> something goes wrong and it gets truncated. The motd isn't.
>> 
>>    Ah, ok. It might be better to install a file into the source
> 
> source -> tests
> 
>> directory that's owned by root and 0644, then try and truncate it so
>> the test is more portable and doesn't accidentally hose a utility or
>> other file that it shouldn't as that's the purpose of the testcase (to
>> test EACESS). Does that sound like a good approach?

Here’s a better approach: https://svnweb.freebsd.org/base?view=revision&revision=273533 ; here’s the build target I’ll be adding to lib/libc/tests/sys/Makefile to generate the file:

> FILESGROUPS=            FILES truncate_test_FILES
>
> truncate_test_FILES=    truncate_test.root_owned
> truncate_test_FILESDIR= ${TESTSDIR}
> truncate_test_FILESMODE= 0600
> truncate_test_FILESOWNER= root
> truncate_test_FILESGRP= wheel
>
> CLEANFILES=     truncate_test.root_owned
> truncate_test.root_owned:
> 	dd if=/dev/null bs=1 count=1 of=${.TARGET}

Cheers!

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail



Home | Main Index | Thread Index | Old Index