Mercurial > gnulib
view tests/test-idpriv-drop.sh @ 17363:5a51fb7777a9
sys_select, sys_time: port 2013-01-30 Solaris 2.6 fix to Cygwin
Problem reported by Marco Atzeri in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-03/msg00000.html>.
* lib/sys_select.in.h [HAVE_SYS_SELECT_H && _CYGWIN_SYS_TIME_H]:
Simply delegate to the system <sys/select.h> in this case too.
Also, pay attention to _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H only
if OSF/1, since otherwise Cygwin breaks, and it doesn't seem to
be needed on Solaris either.
* lib/sys_time.in.h [_CYGWIN_SYS_TIME_H]:
Simply delgate to the system <sys/time.h> in this case.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Tue, 19 Mar 2013 09:08:47 -0700 |
parents | b3e5d914be7d |
children |
line wrap: on
line source
#!/bin/sh # A POSIX compliant 'id' program. if test -f /usr/xpg4/bin/id; then ID=/usr/xpg4/bin/id else ID=id fi # The user's original uid and gid. uid=`$ID -u` gid=`$ID -g` if test `$ID -u` = 0; then # No need to ask for a password. "${srcdir}/test-idpriv-drop.su.sh" "$uid" "$gid" else echo "Need root privileges for the 'test-idpriv-drop' test. Deny if you don't trust." > /dev/tty if (type sudo) > /dev/null 2>&1; then # Use the 'sudo' program. sudo "${srcdir}/test-idpriv-drop.su.sh" "$uid" "$gid" else # Use the 'su' program. su root -c "${srcdir}/test-idpriv-drop.su.sh \"$uid\" \"$gid\"" fi result=$? case $result in 0) exit 0;; 77) exit 77;; 13) exit 1;; *) echo "Skipping test: root privileges not granted"; exit 77;; esac fi