jail_getname.c

Go to the documentation of this file.
00001 /*********************************** */
00002 /* Rule Set Based Access Control     */
00003 /* Author and (c) 1999-2005:         */
00004 /*   Amon Ott <ao@rsbac.org>         */
00005 /* Getname functions for JAIL module */
00006 /* Last modified: 27/May/2005        */
00007 /*********************************** */
00008 
00009 #include <rsbac/getname.h>
00010 #include <rsbac/jail_getname.h>
00011 #include <rsbac/helpers.h>
00012 #include <rsbac/error.h>
00013 
00014 #ifdef __KERNEL__
00015 #include <linux/string.h>
00016 #include <linux/sched.h>
00017 #include <rsbac/debug.h>
00018 #include <rsbac/aci.h>
00019 #include <rsbac/rkmem.h>
00020 #else
00021 #include <string.h>
00022 #endif
00023 
00024 #ifdef __KERNEL__
00025 #ifdef CONFIG_RSBAC_JAIL_LOG_MISSING
00026 void rsbac_jail_log_missing_cap(int cap)
00027   {
00028     char * tmp;
00029     union rsbac_target_id_t       i_tid;
00030     union rsbac_attribute_value_t i_attr_val1;
00031 
00032     i_tid.process = current->pid;
00033     if (rsbac_get_attr(JAIL,
00034                        T_PROCESS,
00035                        i_tid,
00036                        A_jail_max_caps,
00037                        &i_attr_val1,
00038                        FALSE))
00039       {
00040         rsbac_ds_get_error("rsbac_jail_log_missing_cap()", A_jail_max_caps);
00041       }
00042     else
00043       {
00044         if(!(i_attr_val1.jail_max_caps & (1 << cap)))
00045           {
00046             tmp = rsbac_kmalloc(RSBAC_MAXNAMELEN);
00047             if(tmp)
00048               {
00049                 get_cap_name(tmp, cap);
00050                 rsbac_printk(KERN_DEBUG
00051                              "capable(): pid %u(%.15s), uid %u: missing jail_max_cap %s!\n",
00052                              current->pid, current->comm,
00053                              current->uid,
00054                              tmp);
00055                   rsbac_kfree(tmp);
00056               }
00057           }
00058       }
00059   }
00060 #endif
00061 #endif

Generated on Sun May 21 14:30:55 2006 for RSBAC by  doxygen 1.4.2