Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.5.4.3 / test_posix failing on HPUX systems #49363

Closed
andreask mannequin opened this issue Jan 30, 2009 · 22 comments
Closed

2.5.4.3 / test_posix failing on HPUX systems #49363

andreask mannequin opened this issue Jan 30, 2009 · 22 comments
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@andreask
Copy link
Mannequin

andreask mannequin commented Jan 30, 2009

BPO 5113
Nosy @pitrou, @vstinner, @bitdancer
Files
  • bug-test_posix-hpux.log: Output of regrtest.py -v test_posix
  • chown_hpux.diff
  • chown_hpux-3.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2012-04-17.18:03:15.546>
    created_at = <Date 2009-01-30.20:12:12.156>
    labels = ['type-bug', 'tests']
    title = '2.5.4.3 / test_posix failing on HPUX systems'
    updated_at = <Date 2012-04-17.18:03:15.544>
    user = 'https://bugs.python.org/andreask'

    bugs.python.org fields:

    activity = <Date 2012-04-17.18:03:15.544>
    actor = 'neologix'
    assignee = 'none'
    closed = True
    closed_date = <Date 2012-04-17.18:03:15.546>
    closer = 'neologix'
    components = ['Tests']
    creation = <Date 2009-01-30.20:12:12.156>
    creator = 'andreask'
    dependencies = []
    files = ['12897', '22780', '23038']
    hgrepos = []
    issue_num = 5113
    keywords = ['patch', 'needs review']
    message_count = 22.0
    messages = ['80835', '80913', '80973', '80976', '81012', '81014', '81015', '116648', '141267', '142938', '142940', '142944', '142945', '142946', '142948', '142985', '158152', '158155', '158179', '158181', '158562', '158563']
    nosy_count = 7.0
    nosy_names = ['pitrou', 'vstinner', 'r.david.murray', 'andreask', 'neologix', 'adiroiban', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue5113'
    versions = ['Python 2.7', 'Python 3.2', 'Python 3.3']

    @andreask
    Copy link
    Mannequin Author

    andreask mannequin commented Jan 30, 2009

    The 'test_posix' of Python's 2.5.4.3 testsuite fails on HPUX. This has
    happened on parisc and ia64 systems. On the parisc system failure occurs
    for both parisc1.1 and parisc2.0w builds. The HPUX versions are 11.00
    (parisc) and 11.22 (ia64).

    The attached file contains the output of executing

    ./apy/bin/python2.5 ./apy/lib/python2.5/test/regrtest.py -v test_posix

    @andreask andreask mannequin added tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error labels Jan 30, 2009
    @pitrou
    Copy link
    Member

    pitrou commented Feb 1, 2009

    If you try "chown root foobar", with <foobar> being a valid file you
    own, does it succeed?

    @andreask
    Copy link
    Mannequin Author

    andreask mannequin commented Feb 2, 2009

    Yes.

    Session log:

    andreask@bertha:~/tmp/x> ll
    total 0

    andreask@bertha:/tmp/x> touch foobar
    andreask@bertha:
    /tmp/x> ll
    total 0
    -rw-rw-r-- 1 andreask DomainUsers 0 Feb 2 10:17 foobar

    andreask@bertha:/tmp/x> chown root foobar
    andreask@bertha:
    /tmp/x> ll
    total 0
    -rw-rw-r-- 1 root DomainUsers 0 Feb 2 10:17 foobar

    @pitrou
    Copy link
    Member

    pitrou commented Feb 2, 2009

    That explains what the test fails then. The test expects that you can't
    chown a file to root as a normal user, and it verifies that an exception
    is raised in that case.
    Do you know if this behaviour is standard under HP-UX? If so, what do
    sys.platform and platform.system() return?

    (this won't be fixed in 2.5 by the way: 2.5 only receives security
    fixes. 2.6 is the current stable branch and 2.7 is the in-development
    version)

    @andreask
    Copy link
    Mannequin Author

    andreask mannequin commented Feb 2, 2009

    I do not know if this is standard for hpux or not.

    I can say that right now we have six different HPUX machines which
    behave in this manner, i.e. do not throw an error for the 'chown root
    foobar' command for an ordinary (non-root) user.

    Regarding the platform codes, here are the results.

    andreask@bertha:~/tmp/autotest> ./apy/bin/python2.5
    ActivePython 2.5.4.3 (ActiveState Software Inc.) based on
    Python 2.5.4 (r254:67916, Jan 20 2009, 14:48:58) [C] on hp-ux11
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import sys, platform
    >>> sys.platform
    'hp-ux11'
    >>> platform.system()
    'HP-UX'
    >>> quit()

    The six machines I mentioned are

    bertha - HP-UX 11.00 (PA-RISC)
    bigsur03 - HP-UX 11.22 (Itanium)
    hpa180 - HP-UX 11.00 (PA-RISC)
    bigsur03 - HP-UX 11.22 (Itanium)
    hpl3000 - HP-UX 11.23 (PA-RISC)
    bigsur05 - HP-UX 11.32 (Itanium)

    @pitrou
    Copy link
    Member

    pitrou commented Feb 2, 2009

    Ok, and when you try to chown back to yourself the root-owned foobar,
    does it fail?

    @andreask
    Copy link
    Mannequin Author

    andreask mannequin commented Feb 2, 2009

    Yes, that does fail with error 'not owner'.

    andreask@bertha:/tmp> mkdir x
    andreask@bertha:
    /tmp> cd x
    andreask@bertha:/tmp/x> touch foobar
    andreask@bertha:
    /tmp/x> ll
    total 0
    -rw-rw-r-- 1 andreask DomainUsers 0 Feb 2 15:06 foobar
    andreask@bertha:/tmp/x> chown root foobar
    andreask@bertha:
    /tmp/x> ll
    total 0
    -rw-rw-r-- 1 root DomainUsers 0 Feb 2 15:06 foobar
    andreask@bertha:/tmp/x> chown andreask foobar
    foobar: Not owner
    andreask@bertha:
    /tmp/x>

    @neologix
    Copy link
    Mannequin

    neologix mannequin commented Sep 17, 2010

    Actually, looking at the man page, this seems to be normal:

    ---
    In order to change the owner or group, you must own the file and have the CHOWN privilege (see setprivgrp(1M)). [...] Note that a given user's or group's ability to use this command can be restricted by setprivgrp (see setprivgrp(1M)).
    ---

    So depending on the setting of setprivgrp, chown'ing a file to root may be allowed or not.
    It might be a good idea to skip this test on HP-UX. Solaris apparently behaves in the same way.

    @neologix
    Copy link
    Mannequin

    neologix mannequin commented Jul 27, 2011

    Patch attached.

    @vstinner
    Copy link
    Member

    It's surprising to raise a SkipTest *at the end* of the test. Here is another patch.

    @vstinner
    Copy link
    Member

    Using chown_hpux-4.diff, we don't skip anything on HP-UX.

    @neologix
    Copy link
    Mannequin

    neologix mannequin commented Aug 24, 2011

    Using chown_hpux-4.diff, we don't skip anything on HP-UX.

    Victor, I don't understand your patch: if we try chown()ing a file to root, then this will fail on HP-UX (because chown won't fail with EPERM). That's the whole point of the patch.

    @vstinner
    Copy link
    Member

    if we try chown()ing a file to root, then this will fail on HP-UX

    Oooh, I'm confused. I removed this stupid patch.

    @vstinner
    Copy link
    Member

    # HP-UX and Solaris allow a non-root user to chown to root

    I didn't see failure on our Solaris / OpenIndiana buildbot. Should we really skip the test on Solaris?

    @neologix
    Copy link
    Mannequin

    neologix mannequin commented Aug 24, 2011

    Well, IIRC, I read in the Solaris man pages that it behaves like HP-UX
    in this regard. But this it can be changed with setprivgrp, so it
    might work on some machines, and fail on others.
    According to http://unix.derkeiler.com/Newsgroups/comp.unix.solaris/2004-03/2579.html,
    the test should work with the default setting (maybe the OP was
    testing on a HP-UX machine with the non-default setting).
    Anyway, since it depends on the system configuration, I wanted to stay
    on the safe side, and just skip on both OS.
    But I honestly don't have a strong opinion about this.

    @neologix
    Copy link
    Mannequin

    neologix mannequin commented Aug 25, 2011

    Oooh, I'm confused. I removed this stupid patch.

    chown_hpux-3.diff has a problem too: it skips the successful chown call (that's why I put the SkipTest at the end).

    @neologix
    Copy link
    Mannequin

    neologix mannequin commented Apr 12, 2012

    Adi, since you have access to an HP-UX box, could you test the attached patch (chown_hpux.diff)?
    Also, if you're interested, you could search for other isues HP-UX-specific to see if you can help.

    @adiroiban
    Copy link
    Mannequin

    adiroiban mannequin commented Apr 12, 2012

    Hi,

    Not sure what codebase was used for the patch.

    I have manually patched the test on 2.5.6 and the test_posix tests passed.

    Thanks!
    Adi

    @adiroiban
    Copy link
    Mannequin

    adiroiban mannequin commented Apr 12, 2012

    I am not sure how the search works, but for example I was not able to reach http://bugs.python.org/issue5895 while searching for hpux or hp-ux using the internal search.

    Also I was not able to find any aix or solaris bug.

    In case you bump over an hpux, aix, solaris bug, please add me to the noisy list and I will take a look.

    Thanks!
    Adi

    @bitdancer
    Copy link
    Member

    Search is currently not returning all matching issues, unfortunately. You might get a few more hits by searching for hpux in the title field via advanced search.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Apr 17, 2012

    New changeset 8a4c9a168d09 by Charles-François Natali in branch '2.7':
    Issue bpo-5113: Fix a test_posix failure on HP-UX, where non-root users can
    http://hg.python.org/cpython/rev/8a4c9a168d09

    New changeset 428bece48029 by Charles-François Natali in branch '3.2':
    Issue bpo-5113: Fix a test_posix failure on HP-UX, where non-root users can
    http://hg.python.org/cpython/rev/428bece48029

    New changeset 3d4922cf0d65 by Charles-François Natali in branch 'default':
    Issue bpo-5113: Fix a test_posix failure on HP-UX, where non-root users can
    http://hg.python.org/cpython/rev/3d4922cf0d65

    @neologix
    Copy link
    Mannequin

    neologix mannequin commented Apr 17, 2012

    Committed, thanks.

    @neologix neologix mannequin closed this as completed Apr 17, 2012
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants