shawn
shawn****@gmail*****
Thu Feb 9 12:56:27 JST 2012
The problem that I went out to solve was that it was very tedious to select and delete a bunch of auto-generated ACL lines that are all similar after making a general rule. IE file_open /tmp12345; file_open /tmp12346, and the like, and then AGAIN and AGAIN for truncate, chmod, etc, etc.The ultimate way would be to have some sort of heuristic autodetection or even just groupings like AppArmor has, where you can apply multiple permissions to the same path match (doesn't really matter if this is in user-space or kernel-space) I think the user-space tools could do alot better. On the specifics of the patch, after making this work I tried to add css_shift_click1, that stored a new pivot int in the css_screen struct, however I struggled with the implementation and haven't revised my failed attempt. Thank you, Shawn On Thu, 2012-02-09 at 12:25 +0900, Tetsuo Handa wrote: > shawn wrote: > > I added click-to-select, and am trying to get ranges with ctrl-click > > working. Notice-this makes it were to select text in the application you > > have to use shift-click. > > > > What do people think? > > Thank you for the patch. > If we want to allow use of mouse only for selecting a line, your patch is OK. > > Index: editpolicy.c > =================================================================== > --- editpolicy.c (revision 5828) > +++ editpolicy.c (working copy) > @@ -2270,6 +2270,20 @@ > } > > /** > + * ccs_click1 - Callback for clicking the left mouse button > + * > + * Returns nothing. > + */ > +static void ccs_click1(MEVENT mevent) > +{ > + struct ccs_screen *ptr = &ccs_screen[ccs_current_screen]; > + if (mevent.y < CCS_HEADER_LINES) > + return; > + ptr->y = mevent.y - CCS_HEADER_LINES; > + ccs_show_current(); > +} > + > +/** > * ccs_resize_window - Callback for resize event. > * > * Returns nothing. > @@ -3221,6 +3235,7 @@ > ptr->current = saved_cursor[ccs_current_screen].current; > ptr->y = saved_cursor[ccs_current_screen].y; > } > + mousemask(ALL_MOUSE_EVENTS, NULL); > start: > if (ccs_current_screen == CCS_SCREEN_DOMAIN_LIST) { > if (!ccs_domain_sort_type) { > @@ -3280,6 +3295,14 @@ > if (c == ERR) > continue; /* Ignore invalid key. */ > switch (c) { > + case KEY_MOUSE: > + { > + MEVENT mevent; > + if (getmouse(&mevent) == OK) > + if (mevent.bstate & BUTTON1_CLICKED) > + ccs_click1(mevent); > + } > + break; > case KEY_RESIZE: > ccs_resize_window(); > ccs_show_list(); > > But people will surely ask for scrolling via mouse wheel if we allow use of > mouse for selecting a line. Currently it is difficult to support mouse wheel > without understanding terminal dependent behavior. > > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=230990 > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=455585 > > I'm keeping the policy editor terminal/distribution independent as much as > possible (e.g. not assigning function keys which may result in different scan > codes on different terminals). > > If you want mouse support on the policy editor, you might be interested in > GPET project ( http://sourceforge.jp/projects/gpet/ ). > > _______________________________________________ > tomoyo-dev-en mailing list > tomoy****@lists***** > http://lists.sourceforge.jp/mailman/listinfo/tomoyo-dev-en