Deleted Added
full compact
test_owner_parse.c (302408) test_owner_parse.c (311041)
1/*-
2 * Copyright (c) 2003-2009 Tim Kientzle
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25#include "test.h"
1/*-
2 * Copyright (c) 2003-2009 Tim Kientzle
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25#include "test.h"
26__FBSDID("$FreeBSD: stable/11/contrib/libarchive/cpio/test/test_owner_parse.c 232153 2012-02-25 10:58:02Z mm $");
26__FBSDID("$FreeBSD: stable/11/contrib/libarchive/cpio/test/test_owner_parse.c 311041 2017-01-02 01:41:31Z mm $");
27
28#include "../cpio.h"
29#include "err.h"
30
31#if !defined(_WIN32)
32#define ROOT "root"
33static const int root_uids[] = { 0 };
34static const int root_gids[] = { 0, 1 };
35#elif defined(__CYGWIN__)
36/* On cygwin, the Administrator user most likely exists (unless
37 * it has been renamed or is in a non-English localization), but
38 * its primary group membership depends on how the user set up
39 * their /etc/passwd. Likely values are 513 (None), 545 (Users),
40 * or 544 (Administrators). Just check for one of those...
27
28#include "../cpio.h"
29#include "err.h"
30
31#if !defined(_WIN32)
32#define ROOT "root"
33static const int root_uids[] = { 0 };
34static const int root_gids[] = { 0, 1 };
35#elif defined(__CYGWIN__)
36/* On cygwin, the Administrator user most likely exists (unless
37 * it has been renamed or is in a non-English localization), but
38 * its primary group membership depends on how the user set up
39 * their /etc/passwd. Likely values are 513 (None), 545 (Users),
40 * or 544 (Administrators). Just check for one of those...
41 * TODO: Handle non-English localizations...e.g. French 'Administrateur'
41 * TODO: Handle non-English localizations... e.g. French 'Administrateur'
42 * Use CreateWellKnownSID() and LookupAccountName()?
43 */
44#define ROOT "Administrator"
45static const int root_uids[] = { 500 };
46static const int root_gids[] = { 513, 545, 544 };
47#endif
48
49#if defined(ROOT)

--- 72 unchanged lines hidden ---
42 * Use CreateWellKnownSID() and LookupAccountName()?
43 */
44#define ROOT "Administrator"
45static const int root_uids[] = { 500 };
46static const int root_gids[] = { 513, 545, 544 };
47#endif
48
49#if defined(ROOT)

--- 72 unchanged lines hidden ---