Messages in this thread | | | Date | Thu, 8 Apr 1999 16:19:28 +0200 | From | Pavel Machek <> | Subject | Re: [PATCH] So you want capabilities? |
| |
Hi!
> > Here is trivial uitility for adding headers: (GPL) [It needs to be > > improved _very_ much in order to be usefull. We should probably aim > > for compatibility with similar utilities on other systems. Also > > utility for listing these info is needed.] > > Speaking of which... how would you like the ps program to show them? > I can have ps print capabilities as soon as I find a good format. > (hex is not friendly, but text is far too wide -- preferences?)
What about -R----I---L---- format? - for capability you don't have, letter for capability you do have.
Pavel
> In the kernel, the UID handling goes like this: > > int uids[8]; > uids[0] = current->uid; > uids[1] = current->euid; > uids[2] = current->suid; > uids[3] = current->fsuid; > uids[4] = cap.uids[0]; /* must add length checking */ > uids[5] = cap.uids[1]; > uids[6] = cap.uids[2]; > uids[7] = cap.uids[3]; > foo->uid = uids[(cap.uidmap >> 0) & 7]; > foo->euid = uids[(cap.uidmap >> 4) & 7]; > foo->suid = uids[(cap.uidmap >> 8) & 7]; > foo->fsuid = uids[(cap.uidmap >> 12) & 7]; > > As you can see, this lets the executable select all 4 UID values > from those of the executable or from those of the process. > There is room to add a login ID or audit ID as an additional source.
:-) I'm just not quite sure right place for mapping uids to other uids is this header...
-- I'm really pavel@atrey.karlin.mff.cuni.cz. Pavel Look at http://atrey.karlin.mff.cuni.cz/~pavel/ ;-).
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |