Date: Wed, 21 Jan 2015 18:32:53 +0000 (UTC) From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277496 - head/sys/kern Message-ID: <201501211832.t0LIWrvJ055769@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mjg Date: Wed Jan 21 18:32:53 2015 New Revision: 277496 URL: https://svnweb.freebsd.org/changeset/base/277496 Log: filedesc: avoid spurious copying of capabilities in fget_unlocked We obtain a stable copy and store it in local 'fde' variable. Storing another copy (based on aforementioned variable) does not serve any purpose. No functional changes. Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Wed Jan 21 18:05:42 2015 (r277495) +++ head/sys/kern/kern_descrip.c Wed Jan 21 18:32:53 2015 (r277496) @@ -2337,7 +2337,7 @@ fget_unlocked(struct filedesc *fdp, int u_int count; #ifdef CAPABILITIES seq_t seq; - cap_rights_t haverights; + cap_rights_t *haverights; int error; #endif @@ -2367,9 +2367,9 @@ fget_unlocked(struct filedesc *fdp, int if (fp == NULL) return (EBADF); #ifdef CAPABILITIES - haverights = *cap_rights_fde(&fde); + haverights = cap_rights_fde(&fde); if (needrightsp != NULL) { - error = cap_check(&haverights, needrightsp); + error = cap_check(haverights, needrightsp); if (error != 0) return (error); if (cap_rights_is_set(needrightsp, CAP_FCNTL)) { @@ -2408,7 +2408,7 @@ fget_unlocked(struct filedesc *fdp, int *fpp = fp; if (haverightsp != NULL) { #ifdef CAPABILITIES - *haverightsp = haverights; + *haverightsp = *haverights; #else CAP_ALL(haverightsp); #endif
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501211832.t0LIWrvJ055769>