commoncap.c (39fe5434cb9de5da40510028b17b96bc4eb312b3) commoncap.c (34b4e4aa3c470ce8fa2bd78abb1741b4b58baad7)
1/* Common capabilities, needed by capability.o and root_plug.o
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 */

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

310
311int cap_syslog (int type)
312{
313 if ((type != 3 && type != 10) && !capable(CAP_SYS_ADMIN))
314 return -EPERM;
315 return 0;
316}
317
1/* Common capabilities, needed by capability.o and root_plug.o
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 */

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

310
311int cap_syslog (int type)
312{
313 if ((type != 3 && type != 10) && !capable(CAP_SYS_ADMIN))
314 return -EPERM;
315 return 0;
316}
317
318int cap_vm_enough_memory(long pages)
318int cap_vm_enough_memory(struct mm_struct *mm, long pages)
319{
320 int cap_sys_admin = 0;
321
322 if (cap_capable(current, CAP_SYS_ADMIN) == 0)
323 cap_sys_admin = 1;
319{
320 int cap_sys_admin = 0;
321
322 if (cap_capable(current, CAP_SYS_ADMIN) == 0)
323 cap_sys_admin = 1;
324 return __vm_enough_memory(pages, cap_sys_admin);
324 return __vm_enough_memory(mm, pages, cap_sys_admin);
325}
326
327EXPORT_SYMBOL(cap_capable);
328EXPORT_SYMBOL(cap_settime);
329EXPORT_SYMBOL(cap_ptrace);
330EXPORT_SYMBOL(cap_capget);
331EXPORT_SYMBOL(cap_capset_check);
332EXPORT_SYMBOL(cap_capset_set);

--- 12 unchanged lines hidden ---
325}
326
327EXPORT_SYMBOL(cap_capable);
328EXPORT_SYMBOL(cap_settime);
329EXPORT_SYMBOL(cap_ptrace);
330EXPORT_SYMBOL(cap_capget);
331EXPORT_SYMBOL(cap_capset_check);
332EXPORT_SYMBOL(cap_capset_set);

--- 12 unchanged lines hidden ---