Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 561672 | Differences between
and this patch

Collapse All | Expand All

(-)file_not_specified_in_diff (-12 / +24 lines)
Line  Link Here
0
-- polkit-0.113/configure.ac
0
++ polkit-0.113-optional-netgroup/configure.ac
Lines 158-164 AC_CHECK_LIB(expat,XML_ParserCreate,[EXP Link Here
158
	     [AC_MSG_ERROR([Can't find expat library. Please install expat.])])
158
	     [AC_MSG_ERROR([Can't find expat library. Please install expat.])])
159
AC_SUBST(EXPAT_LIBS)
159
AC_SUBST(EXPAT_LIBS)
160
160
161
AC_CHECK_FUNCS(clearenv fdatasync)
161
AC_CHECK_FUNCS(clearenv fdatasync getnetgrent)
162
162
163
if test "x$GCC" = "xyes"; then
163
if test "x$GCC" = "xyes"; then
164
  LDFLAGS="-Wl,--as-needed $LDFLAGS"
164
  LDFLAGS="-Wl,--as-needed $LDFLAGS"
165
-- polkit-0.113/src/polkitbackend/init.js
165
++ polkit-0.113-optional-netgroup/src/polkitbackend/init.js
Lines 29-35 function Subject() { Link Here
29
    };
29
    };
30
30
31
    this.isInNetGroup = function(netGroup) {
31
    this.isInNetGroup = function(netGroup) {
32
        return polkit._userIsInNetGroup(this.user, netGroup);
32
        if (polkit._userIsInNetGroup)
33
            return polkit._userIsInNetGroup(this.user, netGroup);
34
        else
35
            return false;
33
    };
36
    };
34
37
35
    this.toString = function() {
38
    this.toString = function() {
36
-- polkit-0.113/src/polkitbackend/polkitbackendinteractiveauthority.c
39
++ polkit-0.113-optional-netgroup/src/polkitbackend/polkitbackendinteractiveauthority.c
Lines 2214-2219 get_users_in_group (PolkitIdentity Link Here
2214
  return ret;
2214
  return ret;
2215
}
2215
}
2216
2216
2217
#ifdef HAVE_GETNETGRENT
2217
static GList *
2218
static GList *
2218
get_users_in_net_group (PolkitIdentity                    *group,
2219
get_users_in_net_group (PolkitIdentity                    *group,
2219
                        gboolean                           include_root)
2220
                        gboolean                           include_root)
Lines 2269-2274 get_users_in_net_group (PolkitIdentity Link Here
2269
  endnetgrent ();
2270
  endnetgrent ();
2270
  return ret;
2271
  return ret;
2271
}
2272
}
2273
#endif
2272
2274
2273
/* ---------------------------------------------------------------------------------------------------- */
2275
/* ---------------------------------------------------------------------------------------------------- */
2274
2276
Lines 2355-2364 authentication_agent_initiate_challenge Link Here
2355
        {
2357
        {
2356
          user_identities = g_list_concat (user_identities, get_users_in_group (identity, FALSE));
2358
          user_identities = g_list_concat (user_identities, get_users_in_group (identity, FALSE));
2357
        }
2359
        }
2360
#ifdef HAVE_GETNETGRENT
2358
      else if (POLKIT_IS_UNIX_NETGROUP (identity))
2361
      else if (POLKIT_IS_UNIX_NETGROUP (identity))
2359
        {
2362
        {
2360
          user_identities =  g_list_concat (user_identities, get_users_in_net_group (identity, FALSE));
2363
          user_identities =  g_list_concat (user_identities, get_users_in_net_group (identity, FALSE));
2361
        }
2364
        }
2365
#endif
2362
      else
2366
      else
2363
        {
2367
        {
2364
          g_warning ("Unsupported identity");
2368
          g_warning ("Unsupported identity");
2365
-- polkit-0.113/src/polkitbackend/polkitbackendjsauthority.c
2369
++ polkit-0.113-optional-netgroup/src/polkitbackend/polkitbackendjsauthority.c
Lines 189-201 static JSClass js_polkit_class = { Link Here
189
189
190
static JSBool js_polkit_log (JSContext *cx, unsigned argc, jsval *vp);
190
static JSBool js_polkit_log (JSContext *cx, unsigned argc, jsval *vp);
191
static JSBool js_polkit_spawn (JSContext *cx, unsigned argc, jsval *vp);
191
static JSBool js_polkit_spawn (JSContext *cx, unsigned argc, jsval *vp);
192
#ifdef HAVE_GETNETGRENT
192
static JSBool js_polkit_user_is_in_netgroup (JSContext *cx, unsigned argc, jsval *vp);
193
static JSBool js_polkit_user_is_in_netgroup (JSContext *cx, unsigned argc, jsval *vp);
193
194
#endif
194
static JSFunctionSpec js_polkit_functions[] =
195
static JSFunctionSpec js_polkit_functions[] =
195
{
196
{
196
  JS_FS("log",            js_polkit_log,            0, 0),
197
  JS_FS("log",            js_polkit_log,            0, 0),
197
  JS_FS("spawn",          js_polkit_spawn,          0, 0),
198
  JS_FS("spawn",          js_polkit_spawn,          0, 0),
199
#ifdef HAVE_GETNETGRENT
198
  JS_FS("_userIsInNetGroup", js_polkit_user_is_in_netgroup,          0, 0),
200
  JS_FS("_userIsInNetGroup", js_polkit_user_is_in_netgroup,          0, 0),
201
#endif
199
  JS_FS_END
202
  JS_FS_END
200
};
203
};
201
204
Lines 1498-1504 js_polkit_spawn (JSContext *cx, Link Here
1498
1501
1499
/* ---------------------------------------------------------------------------------------------------- */
1502
/* ---------------------------------------------------------------------------------------------------- */
1500
1503
1501
1504
#ifdef HAVE_GETNETGRENT
1502
static JSBool
1505
static JSBool
1503
js_polkit_user_is_in_netgroup (JSContext  *cx,
1506
js_polkit_user_is_in_netgroup (JSContext  *cx,
1504
                               unsigned    argc,
1507
                               unsigned    argc,
Lines 1535-1541 js_polkit_user_is_in_netgroup (JSContext Link Here
1535
 out:
1538
 out:
1536
  return ret;
1539
  return ret;
1537
}
1540
}
1538
1541
#endif
1539
1542
1540
1543
1541
/* ---------------------------------------------------------------------------------------------------- */
1544
/* ---------------------------------------------------------------------------------------------------- */
1542
-- polkit-0.113/test/polkitbackend/test-polkitbackendjsauthority.c
1545
++ polkit-0.113-optional-netgroup/test/polkitbackend/test-polkitbackendjsauthority.c
Lines 137-148 test_get_admin_identities (void) Link Here
137
        "unix-group:users"
137
        "unix-group:users"
138
      }
138
      }
139
    },
139
    },
140
#ifdef HAVE_GETNETGRENT
140
    {
141
    {
141
      "net.company.action3",
142
      "net.company.action3",
142
      {
143
      {
143
        "unix-netgroup:foo"
144
        "unix-netgroup:foo"
144
      }
145
      }
145
    },
146
    },
147
#endif
146
  };
148
  };
147
  guint n;
149
  guint n;
148
150
Lines 258-264 static const RulesTestCase rules_test_ca Link Here
258
    NULL,
260
    NULL,
259
    POLKIT_IMPLICIT_AUTHORIZATION_NOT_AUTHORIZED,
261
    POLKIT_IMPLICIT_AUTHORIZATION_NOT_AUTHORIZED,
260
  },
262
  },
261
263
#if HAVE_GETNETGRENT
262
  /* check netgroup membership */
264
  /* check netgroup membership */
263
  {
265
  {
264
    /* john is a member of netgroup 'foo', see test/etc/netgroup */
266
    /* john is a member of netgroup 'foo', see test/etc/netgroup */
Lines 276-282 static const RulesTestCase rules_test_ca Link Here
276
    NULL,
278
    NULL,
277
    POLKIT_IMPLICIT_AUTHORIZATION_NOT_AUTHORIZED,
279
    POLKIT_IMPLICIT_AUTHORIZATION_NOT_AUTHORIZED,
278
  },
280
  },
279
281
#endif
280
  /* spawning */
282
  /* spawning */
281
  {
283
  {
282
    "spawning_non_existing_helper",
284
    "spawning_non_existing_helper",

Return to bug 561672