| 
    
 [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2 2/6] test/depriv: Add a tool to check process-level depriv
 George Dunlap writes ("[PATCH v2 2/6] test/depriv: Add a tool to check 
process-level depriv"):
> Add a tool to check whether the various process-level deprivileging
> operations have actually taken place on the process.
...
> +# Example input:
> +# Uid:       1193    1193    1193    1193
> +input=$(grep Uid /proc/$dmpid/status)
Are you sure this grep does not need to be more specific ?  What if a
new thing gets added, I don't know,
  Sponglefleep-Uid-Blarking: yes 42
?
> +if [[ "$input" =~ 
> ^Uid:[[:space:]]*([0-9]+)[[:space:]]*([0-9]+)[[:space:]]*([0-9]+)[[:space:]]*([0-9]+)$
>  ]] ; then
I think I made most of my comments about this script in my other
review comments.
But, specifically, here: if you are confident about the format of the
line in /proc/*/status, you could do
   fields=($input)
   for uid in ${fields[*]:1}; do
      compare uid with expected
Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
 
 
  | 
  
![]()  | 
            
         Lists.xenproject.org is hosted with RackSpace, monitoring our  |