• J
    t/lib-httpd: switch SANITY check for NOT_ROOT · 1767c517
    Jeff King 提交于
    The SANITY prerequisite is really about whether the
    filesystem will respect the permissions we set, and being
    root is only one part of that. But the httpd tests really
    just care about not being root, as they are trying to avoid
    weirdness in apache (see a1a30111 for details).
    
    Let's switch out SANITY for a new NOT_ROOT prerequisite,
    which will let us tweak SANITY more freely.
    
    We implement NOT_ROOT by checking `id -u`, which is in POSIX
    and seems to be available even on MSYS.  Note that we cannot
    just call this "ROOT" and ask for "!ROOT". The possible
    outcomes are:
    
      1. we know we are root
    
      2. we know we are not root
    
      3. we could not tell, because `id` was not available
    
    We should conservatively treat (3) as "does not have the
    prerequisite", which means that a naive negation would not
    work.
    Helped-by: NKyle J. McKay <mackyle@gmail.com>
    Signed-off-by: NJeff King <peff@peff.net>
    Signed-off-by: NJunio C Hamano <gitster@pobox.com>
    1767c517
lib-httpd.sh 6.2 KB