Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #70256

Re: Python, Linux, and the setuid bit

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.datemas.de!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.004
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'subject:Python': 0.06; 'practice,': 0.07; 'bits': 0.09; 'cc:addr:python-list': 0.11; '4gb': 0.16; 'disaster,': 0.16; 'discarded': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'likely.': 0.16; 'subject:bit': 0.16; 'unlikely': 0.16; 'work"': 0.16; 'size,': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'integer': 0.24; 'pointer': 0.24; 'environment': 0.24; 'cc:2**0': 0.24; '15,': 0.26; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'message-id:@mail.gmail.com': 0.30; 'usually': 0.31; 'compatible': 0.32; 'used,': 0.33; 'subject:the': 0.34; 'could': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'done,': 0.36; 'ibm': 0.36; 'possible': 0.36; 'so,': 0.37; 'pm,': 0.38; 'even': 0.60; 'most': 0.60; 'lowest': 0.74; 'to:none': 0.92
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=HwUp4mRLqgrIk18ORdpio4G0xL4w/cGmjdUDns/WjxM=; b=p3RSnbJ1TcnKbLgohqp5JM/MvJIGW0sZbwtEQWPK5H0A6/LecP5JIqm7tOLVk451A7 1MUUwSeXJGrMntQ50UTgVFpyMNPrjlCjyZZt+ZX9FH9L6ADR954qiN5D/8iL7m8wClFL 27DYviyNbg6LLPQE33rt9YJmfTC9Eya92JIS8/YcEGwaepJZrIybcZ4mRvoq09kBT54f f/ofbXYK3zyVSTDf2lWloYEP16cZT/7T1vUUnjwQT5Vdj4gefpZswV6mTC7sEoS3QwJM 1pz4JMYFodDvtj2JTo7Ny/jhA9f+dAM3+C/KuSOBXr6Ii4JEWo47umZQ4TpcRvd//S5R A41g==
MIME-Version 1.0
X-Received by 10.52.76.102 with SMTP id j6mr167770vdw.38.1397549910713; Tue, 15 Apr 2014 01:18:30 -0700 (PDT)
In-Reply-To <CAPTjJmrDb5YFi094ZSQXV=Vz1QnBQJNbWUMc309QTpNVPQNUaA@mail.gmail.com>
References <mailman.9260.1397511440.18130.python-list@python.org> <wwv7g6rqax4.fsf@l1AntVDjLrnP7Td3DQJ8ynzIq3lJMueXf87AxnpFoA.invalid> <CAPTjJmrDb5YFi094ZSQXV=Vz1QnBQJNbWUMc309QTpNVPQNUaA@mail.gmail.com>
Date Tue, 15 Apr 2014 18:18:30 +1000
Subject Re: Python, Linux, and the setuid bit
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.9273.1397549919.18130.python-list@python.org> (permalink)
Lines 13
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1397549919 news.xs4all.nl 2873 [2001:888:2000:d::a6]:55208
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:70256

Show key headers only | View raw


On Tue, Apr 15, 2014 at 6:15 PM, Chris Angelico <rosuav@gmail.com> wrote:
> then two's complement arithmetic will give the right result
> even if the discarded bits differ.

Clarification: Two's complement isn't the only way this could be done,
but it is the most likely. So, in theory, there are several possible
causes of disaster, but in practice, on any IBM PC compatible
architecture, casting a pointer to an integer will usually take the
lowest N bits, and two's complement arithmetic will be used, and the
environment is unlikely to hit 4GB in size, so the program will
"happen to work" in >99.999% of cases.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Python, Linux, and the setuid bit Ethan Furman <ethan@stoneleaf.us> - 2014-04-14 14:13 -0700
  Re: Python, Linux, and the setuid bit John Gordon <gordon@panix.com> - 2014-04-14 21:55 +0000
    Re: Python, Linux, and the setuid bit Grant Edwards <invalid@invalid.invalid> - 2014-04-14 22:04 +0000
      Re: Python, Linux, and the setuid bit Grant Edwards <invalid@invalid.invalid> - 2014-04-14 22:07 +0000
  Re: Python, Linux, and the setuid bit Richard Kettlewell <rjk@greenend.org.uk> - 2014-04-15 09:00 +0100
    Re: Python, Linux, and the setuid bit Chris Angelico <rosuav@gmail.com> - 2014-04-15 18:15 +1000
      Re: Python, Linux, and the setuid bit Richard Kettlewell <rjk@greenend.org.uk> - 2014-04-15 10:28 +0100
        Re: Python, Linux, and the setuid bit Chris Angelico <rosuav@gmail.com> - 2014-04-15 19:35 +1000
    Re: Python, Linux, and the setuid bit Chris Angelico <rosuav@gmail.com> - 2014-04-15 18:18 +1000

csiph-web