public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: "Jiří Paleček" <jpalecek@web.de>
To: michal.simek@petalogix.com, Garrett Cooper <yanegomi@gmail.com>
Cc: "ltp-list@lists.sourceforge.net" <ltp-list@lists.sourceforge.net>
Subject: Re: [LTP] lchown test case
Date: Fri, 08 Jan 2010 16:40:03 +0100	[thread overview]
Message-ID: <op.u570gsxru2flwt@debian> (raw)
In-Reply-To: <4B45E989.2000903@petalogix.com>

[-- Attachment #1: Type: text/plain, Size: 3699 bytes --]

On Thu, 07 Jan 2010 15:02:49 +0100, Michal Simek  
<michal.simek@petalogix.com> wrote:

> Garrett Cooper wrote:
>> On Wed, Jan 6, 2010 at 5:33 PM, Jiri Palecek <jpalecek@web.de> wrote:
>>> Garrett Cooper napsal(a):
>>>> On Tue, Jan 5, 2010 at 5:41 PM, Garrett Cooper<yanegomi@gmail.com>   
>>>> wrote:
>>>>> On Tue, Jan 5, 2010 at 5:27 PM, Jiri Palecek<jpalecek@web.de>  wrote:
>>>>>> Michal Simek napsal(a):
>>>>>>> Hi,
>>>>>> Hi,
>>>>>>> I have some problems with lchown02 test which is caused with this
>>>>>>> patch.
>>>>>>> What is prep_create_link?
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Michal
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> http://git.kernel.org/?p=linux/kernel/git/galak/ltp.git;a=commitdiff;h=ee1a022fc76076d7fc1b6b1797c195244414c038
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> diff --git a/runtest/syscalls b/runtest/syscalls
>>>>>>> index fbe8641..34631ed 100644 (file)
>>>>>>> --- a/runtest/syscalls
>>>>>>> +++ b/runtest/syscalls
>>>>>>> @@ -462,10 +462,10 @@ kill12 kill12
>>>>>>>
>>>>>>> lchown01 lchown01
>>>>>>> lchown01_16 lchown01_16
>>>>>>> -lchown02 cp -p $LTPROOT/testcases/bin/create_link $TMP; lchown02
>>>>>>> -lchown02_16 cp -p $LTPROOT/testcases/bin/create_link $TMP;  
>>>>>>> lchown02_16
>>>>>>> +lchown02 prep_create_link; lchown02
>>>>>>> +lchown02_16 prep_create_link; lchown02_16
>>>>>> IMHO it should do the same as the line above. But I think the whole
>>>>>> thing
>>>>>> could be deleted without causing any grief:
>>>>>>
>>>>>>
>>>>>> http://repo.or.cz/w/ltp-debian.git?a=commit;h=a5499edcf368fa88df924f94ffcbe63c22b46e82
>>>>> The test needs create_link in $TMP; that's why I scripted it as a
>>>>> one-liner (but stupid me probably forgot to add the script to CVS
>>>>> -_-).
>>>>> Let me look and I'll get back to you shortly.
>>>> Fixed. The executable needed CAP_CHOWN capability and that's part of
>>>> the point behind that script...
>>> Couldn't the executable just get CAP_CHOWN with cap_set_proc in case  
>>> it is
>>> running under root with restricted capabilities?
>>>
>>> I'm not sure it wouldn't fail even with the suid-root executable under  
>>> such
>>> condition - are you really sure it doesn't (esp. in the face of  
>>> lchown01,
>>> which would fail almost surely and doesn't have this hack)?
>>      This requires libcap though, which means that any system under
>> test without it would fail the test:
>>  NAME
>>        cap_get_proc,  cap_set_proc,  capgetp - capability manipulation  
>> on pro-
>>        cesses
>>  SYNOPSIS
>>        #include <sys/capability.h>
>>         cap_t cap_get_proc(void);
>>         int cap_set_proc(cap_t cap_p);
>>         #include <sys/types.h>
>>         cap_t cap_get_pid(pid_t pid);
>>         Link with -lcap.
>>      I agree though, this is the best / cleanest solution...
>
>
> Please keep in your mind that not everybody has capability.h in  
> toolchain. For example we don't have it. I can imagine that this could

True, but do you have a capability restricted root and NOT have  
capability.h.

> be one option. You can check if is capability.h and then use it. But if  
> is not there still should be able to run that tests.

Yet I'm still unconviced about the motivation behind this. I tried running  
the *chown* tests under root with CAP_CHOWN dropped. As you can see in the  
attachment, all the tests failed (except for chown01, which is because  
this test doesn't actually test the functionality of chown). But, only  
lchown02 has this prep_create_link hack (and I'm actually unsure it would  
help in this case). So I don't know if these tests are actually meant to  
be working under these conditions, and if not, I can't see the reason of  
this prep_create_link script.

Regards
    Jiri Palecek

[-- Attachment #2: output --]
[-- Type: application/octet-stream, Size: 12170 bytes --]

<<<test_start>>>
tag=chown01 stime=1262958701
cmdline="chown01"
contacts=""
analysis=exit
<<<test_output>>>
chown01     1  TPASS  :  chown(t_10233, 0,0) returned 0
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=0 corefile=no
cutime=0 cstime=0
<<<test_end>>>
<<<test_start>>>
tag=chown02 stime=1262958701
cmdline="chown02"
contacts=""
analysis=exit
<<<test_output>>>
chown02     1  TFAIL  :  chown() Fails on testfile1, errno=1
chown02     2  TFAIL  :  chown() Fails on testfile2, errno=1
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=1 corefile=no
cutime=0 cstime=0
<<<test_end>>>
<<<test_start>>>
tag=chown03 stime=1262958701
cmdline="chown03"
contacts=""
analysis=exit
<<<test_output>>>
chown03     1  TBROK  :  fchown(testfile) failed: errno=EPERM(1): Operation not permitted
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=2 corefile=no
cutime=0 cstime=1
<<<test_end>>>
<<<test_start>>>
tag=chown04 stime=1262958701
cmdline="chown04"
contacts=""
analysis=exit
<<<test_output>>>
chown04     1  TBROK  :  Fail to modify tfile_1 ownership(s)!: errno=EPERM(1): Operation not permitted
chown04     2  TBROK  :  Remaining cases broken
chown04     3  TBROK  :  Remaining cases broken
chown04     4  TBROK  :  Remaining cases broken
chown04     5  TBROK  :  Remaining cases broken
chown04     6  TBROK  :  Remaining cases broken
chown04     7  TBROK  :  Remaining cases broken
chown04     8  TBROK  :  chmod(testdir_1) failed: errno=ENOENT(2): No such file or directory
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=2 corefile=no
cutime=0 cstime=0
<<<test_end>>>
<<<test_start>>>
tag=chown05 stime=1262958701
cmdline="chown05"
contacts=""
analysis=exit
<<<test_output>>>
chown05     1  TFAIL  :  chown() Fails to Change Owner/Group ids, errno=1
chown05     2  TFAIL  :  chown() Fails to Change Owner id only, errno=1
chown05     3  TFAIL  :  chown() Fails to Change Owner id only, errno=1
chown05     4  TFAIL  :  chown() Fails to Change Group id only, errno=1
chown05     5  TFAIL  :  chown() Fails to Change Group id only, errno=1
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=1 corefile=no
cutime=0 cstime=0
<<<test_end>>>
<<<test_start>>>
tag=fchown01 stime=1262958701
cmdline="fchown01"
contacts=""
analysis=exit
<<<test_output>>>
fchown01    1  TPASS  :  fchown(Fd, geteuid(), getegid()) returned 0
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=0 corefile=no
cutime=0 cstime=0
<<<test_end>>>
<<<test_start>>>
tag=fchown02 stime=1262958701
cmdline="fchown02"
contacts=""
analysis=exit
<<<test_output>>>
fchown02    1  TFAIL  :  fchown() Fails on testfile1, errno=1
fchown02    2  TFAIL  :  fchown() Fails on testfile2, errno=1
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=1 corefile=no
cutime=0 cstime=0
<<<test_end>>>
<<<test_start>>>
tag=fchown03 stime=1262958701
cmdline="fchown03"
contacts=""
analysis=exit
<<<test_output>>>
fchown03    1  TBROK  :  Fail to modify Ownership of testfile: Operation not permitted
<<<execution_status>>>
initiation_status="ok"
duration=1 termination_type=exited termination_id=2 corefile=no
cutime=0 cstime=1
<<<test_end>>>
<<<test_start>>>
tag=fchown04 stime=1262958702
cmdline="fchown04"
contacts=""
analysis=exit
<<<test_output>>>
fchown04    1  TBROK  :  Fail to modify tfile_1 ownership(s)! Operation not permitted
fchown04    2  TBROK  :  Remaining cases broken
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=2 corefile=no
cutime=0 cstime=0
<<<test_end>>>
<<<test_start>>>
tag=fchown05 stime=1262958702
cmdline="fchown05"
contacts=""
analysis=exit
<<<test_output>>>
fchown05    1  TFAIL  :  fchown() Fails to Change Owner/Group ids, errno=1
fchown05    2  TFAIL  :  fchown() Fails to Change Owner id only, errno=1
fchown05    3  TFAIL  :  fchown() Fails to Change Owner id only, errno=1
fchown05    4  TFAIL  :  fchown() Fails to Change Group id only, errno=1
fchown05    5  TFAIL  :  fchown() Fails to Change Group id only, errno=1
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=1 corefile=no
cutime=0 cstime=0
<<<test_end>>>
<<<test_start>>>
tag=lchown01 stime=1262958702
cmdline="lchown01"
contacts=""
analysis=exit
<<<test_output>>>
lchown01    1  TFAIL  :  lchown() Fails to Change Owner/Group ids, errno=1
lchown01    2  TFAIL  :  lchown() Fails to Change Owner id only, errno=1
lchown01    3  TFAIL  :  lchown() Fails to Change Owner id only, errno=1
lchown01    4  TFAIL  :  lchown() Fails to Change Group id only, errno=1
lchown01    5  TFAIL  :  lchown() Fails to Change Group id only, errno=1
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=1 corefile=no
cutime=0 cstime=1
<<<test_end>>>
<<<test_start>>>
tag=lchown02 stime=1262958702
cmdline="lchown02"
contacts=""
analysis=exit
<<<test_output>>>
lchown02    1  TBROK  :  chown() of tfile_1 failed, error 1: Operation not permitted

lchown02    2  TBROK  :  Remaining cases broken
lchown02    3  TBROK  :  Remaining cases broken
lchown02    4  TBROK  :  Remaining cases broken
lchown02    5  TBROK  :  Remaining cases broken
lchown02    6  TBROK  :  Remaining cases broken
lchown02    7  TBROK  :  Remaining cases broken
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=2 corefile=no
cutime=0 cstime=0
<<<test_end>>>
<<<test_start>>>
tag=chown01_16 stime=1262958702
cmdline="chown01_16"
contacts=""
analysis=exit
<<<test_output>>>
chown01     1  TPASS  :  chown(t_10245, 0,0) returned 0
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=0 corefile=no
cutime=0 cstime=0
<<<test_end>>>
<<<test_start>>>
tag=chown02_16 stime=1262958702
cmdline="chown02_16"
contacts=""
analysis=exit
<<<test_output>>>
chown02     1  TFAIL  :  chown() Fails on testfile1, errno=1
chown02     2  TFAIL  :  chown() Fails on testfile2, errno=1
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=1 corefile=no
cutime=0 cstime=0
<<<test_end>>>
<<<test_start>>>
tag=chown03_16 stime=1262958702
cmdline="chown03_16"
contacts=""
analysis=exit
<<<test_output>>>
chown03     1  TBROK  :  fchown(testfile) failed: errno=EPERM(1): Operation not permitted
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=2 corefile=no
cutime=0 cstime=1
<<<test_end>>>
<<<test_start>>>
tag=chown04_16 stime=1262958702
cmdline="chown04_16"
contacts=""
analysis=exit
<<<test_output>>>
chown04     1  TBROK  :  Fail to modify tfile_1 ownership(s)!: errno=EPERM(1): Operation not permitted
chown04     2  TBROK  :  Remaining cases broken
chown04     3  TBROK  :  Remaining cases broken
chown04     4  TBROK  :  Remaining cases broken
chown04     5  TBROK  :  Remaining cases broken
chown04     6  TBROK  :  Remaining cases broken
chown04     7  TBROK  :  Remaining cases broken
chown04     8  TBROK  :  chmod(testdir_1) failed: errno=ENOENT(2): No such file or directory
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=2 corefile=no
cutime=0 cstime=0
<<<test_end>>>
<<<test_start>>>
tag=chown05_16 stime=1262958702
cmdline="chown05_16"
contacts=""
analysis=exit
<<<test_output>>>
chown05     1  TFAIL  :  chown() Fails to Change Owner/Group ids, errno=1
chown05     2  TFAIL  :  chown() Fails to Change Owner id only, errno=1
chown05     3  TFAIL  :  chown() Fails to Change Owner id only, errno=1
chown05     4  TFAIL  :  chown() Fails to Change Group id only, errno=1
chown05     5  TFAIL  :  chown() Fails to Change Group id only, errno=1
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=1 corefile=no
cutime=0 cstime=0
<<<test_end>>>
<<<test_start>>>
tag=fchown01_16 stime=1262958702
cmdline="fchown01_16"
contacts=""
analysis=exit
<<<test_output>>>
fchown01    1  TPASS  :  fchown(Fd, geteuid(), getegid()) returned 0
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=0 corefile=no
cutime=1 cstime=0
<<<test_end>>>
<<<test_start>>>
tag=fchown02_16 stime=1262958702
cmdline="fchown02_16"
contacts=""
analysis=exit
<<<test_output>>>
fchown02    1  TFAIL  :  fchown() Fails on testfile1, errno=1
fchown02    2  TFAIL  :  fchown() Fails on testfile2, errno=1
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=1 corefile=no
cutime=0 cstime=1
<<<test_end>>>
<<<test_start>>>
tag=fchown03_16 stime=1262958702
cmdline="fchown03_16"
contacts=""
analysis=exit
<<<test_output>>>
fchown03    1  TBROK  :  Fail to modify Ownership of testfile: Operation not permitted
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=2 corefile=no
cutime=0 cstime=0
<<<test_end>>>
<<<test_start>>>
tag=fchown04_16 stime=1262958702
cmdline="fchown04_16"
contacts=""
analysis=exit
<<<test_output>>>
fchown04    1  TBROK  :  Fail to modify tfile_1 ownership(s)! Operation not permitted
fchown04    2  TBROK  :  Remaining cases broken
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=2 corefile=no
cutime=0 cstime=1
<<<test_end>>>
<<<test_start>>>
tag=fchown05_16 stime=1262958702
cmdline="fchown05_16"
contacts=""
analysis=exit
<<<test_output>>>
fchown05    1  TFAIL  :  fchown() Fails to Change Owner/Group ids, errno=1
fchown05    2  TFAIL  :  fchown() Fails to Change Owner id only, errno=1
fchown05    3  TFAIL  :  fchown() Fails to Change Owner id only, errno=1
fchown05    4  TFAIL  :  fchown() Fails to Change Group id only, errno=1
fchown05    5  TFAIL  :  fchown() Fails to Change Group id only, errno=1
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=1 corefile=no
cutime=0 cstime=0
<<<test_end>>>
<<<test_start>>>
tag=fchownat01 stime=1262958702
cmdline="fchownat01"
contacts=""
analysis=exit
<<<test_output>>>
fchownat01    1  TPASS  :  fchownat() returned the expected  errno 0: Success
fchownat01    2  TPASS  :  fchownat() returned the expected  errno 0: Success
fchownat01    3  TPASS  :  fchownat() returned the expected  errno 20: Not a directory
fchownat01    4  TPASS  :  fchownat() returned the expected  errno 9: Bad file descriptor
fchownat01    5  TPASS  :  fchownat() returned the expected  errno 22: Invalid argument
fchownat01    6  TPASS  :  fchownat() returned the expected  errno 0: Success
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=0 corefile=no
cutime=0 cstime=0
<<<test_end>>>
<<<test_start>>>
tag=lchown01_16 stime=1262958702
cmdline="lchown01_16"
contacts=""
analysis=exit
<<<test_output>>>
lchown01    1  TFAIL  :  lchown() Fails to Change Owner/Group ids, errno=1
lchown01    2  TFAIL  :  lchown() Fails to Change Owner id only, errno=1
lchown01    3  TFAIL  :  lchown() Fails to Change Owner id only, errno=1
lchown01    4  TFAIL  :  lchown() Fails to Change Group id only, errno=1
lchown01    5  TFAIL  :  lchown() Fails to Change Group id only, errno=1
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=1 corefile=no
cutime=0 cstime=0
<<<test_end>>>
<<<test_start>>>
tag=lchown02_16 stime=1262958702
cmdline="lchown02_16"
contacts=""
analysis=exit
<<<test_output>>>
lchown02    1  TBROK  :  chown() of tfile_1 failed, error 1: Operation not permitted

lchown02    2  TBROK  :  Remaining cases broken
lchown02    3  TBROK  :  Remaining cases broken
lchown02    4  TBROK  :  Remaining cases broken
lchown02    5  TBROK  :  Remaining cases broken
lchown02    6  TBROK  :  Remaining cases broken
lchown02    7  TBROK  :  Remaining cases broken
incrementing stop
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=2 corefile=no
cutime=0 cstime=1
<<<test_end>>>

[-- Attachment #3: Type: text/plain, Size: 390 bytes --]

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 

[-- Attachment #4: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

      reply	other threads:[~2010-01-08 15:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-04 15:10 [LTP] lchown test case Michal Simek
2010-01-06  1:27 ` Jiri Palecek
2010-01-06  1:41   ` Garrett Cooper
2010-01-06  2:31     ` Garrett Cooper
2010-01-06 12:13       ` Michal Simek
2010-01-06 19:24         ` Garrett Cooper
2010-01-07  1:33       ` Jiri Palecek
2010-01-07  5:57         ` Garrett Cooper
2010-01-07 14:02           ` Michal Simek
2010-01-08 15:40             ` Jiří Paleček [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=op.u570gsxru2flwt@debian \
    --to=jpalecek@web.de \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=michal.simek@petalogix.com \
    --cc=yanegomi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox