setexeccon(3)


NAME

   getexeccon,  setexeccon  - get or set the SELinux security context used
   for executing a new process

   rpm_execcon - run a helper for rpm in an appropriate security context

SYNOPSIS

   #include <selinux/selinux.h>

   int getexeccon(char **context);

   int getexeccon_raw(char **context);

   int setexeccon(char * context);

   int setexeccon_raw(char * context);

   int setexecfilecon(const char *filename, const char *fallback_type);

   int rpm_execcon(unsigned  int  verified,  const  char  *filename,  char
   *const argv[] , char *const envp[]);

DESCRIPTION

   getexeccon()  retrieves  the  context used for executing a new process.
   This returned context should be  freed  with  freecon(3)  if  non-NULL.
   getexeccon()  sets  *context  to  NULL  if  no  exec  context  has been
   explicitly set by the program (i.e. using the default policy behavior).

   setexeccon() sets the context used for the next execve(2)  call.   NULL
   can  be passed to setexeccon() to reset to the default policy behavior.
   The exec context is automatically reset after the next execve(2), so  a
   program doesn't need to explicitly sanitize it upon startup.

   setexeccon()  can be applied prior to library functions that internally
   perform an execve(2), e.g.  execl*(3), execv*(3), popen(3), in order to
   set an exec context for that operation.

   getexeccon_raw()  and setexeccon_raw() behave identically to their non-
   raw counterparts but do not perform context translation.

   Note: Signal handlers that perform an execve(2) must take care to save,
   reset, and restore the exec context to avoid unexpected behavior.

   setexecfilecon()  sets  the  context  used for the next execve(2) call,
   based on the policy for the filename, and falling back to a new context
   with a fallback_type in case there is no transition.

   rpm_execcon() is deprecated; please use setexecfilecon() in conjunction
   with execve(2) in all new code. This function runs a helper for rpm  in
   an appropriate security context.  The verified parameter should contain
   the return code  from  the  signature  verification  (0  ==  ok,  1  ==
   notfound,  2 == verifyfail, 3 == nottrusted, 4 == nokey), although this
   information is not yet used by the function.  The  function  determines
   the  proper  security  context for the helper based on policy, sets the
   exec context accordingly, and then executes the specified filename with
   the provided argument and environment arrays.

RETURN VALUE

   On error -1 is returned.

   On  success  getexeccon(),  setexeccon() and setexecfilecon() return 0.
   rpm_execcon() only returns upon errors, as it calls execve(2).

SEE ALSO

   selinux(8), freecon(3), getcon(3)





Opportunity


Personal Opportunity - Free software gives you access to billions of dollars of software at no cost. Use this software for your business, personal use or to develop a profitable skill. Access to source code provides access to a level of capabilities/information that companies protect though copyrights. Open source is a core component of the Internet and it is available to you. Leverage the billions of dollars in resources and capabilities to build a career, establish a business or change the world. The potential is endless for those who understand the opportunity.

Business Opportunity - Goldman Sachs, IBM and countless large corporations are leveraging open source to reduce costs, develop products and increase their bottom lines. Learn what these companies know about open source and how open source can give you the advantage.





Free Software


Free Software provides computer programs and capabilities at no cost but more importantly, it provides the freedom to run, edit, contribute to, and share the software. The importance of free software is a matter of access, not price. Software at no cost is a benefit but ownership rights to the software and source code is far more significant.


Free Office Software - The Libre Office suite provides top desktop productivity tools for free. This includes, a word processor, spreadsheet, presentation engine, drawing and flowcharting, database and math applications. Libre Office is available for Linux or Windows.





Free Books


The Free Books Library is a collection of thousands of the most popular public domain books in an online readable format. The collection includes great classical literature and more recent works where the U.S. copyright has expired. These books are yours to read and use without restrictions.


Source Code - Want to change a program or know how it works? Open Source provides the source code for its programs so that anyone can use, modify or learn how to write those programs themselves. Visit the GNU source code repositories to download the source.





Education


Study at Harvard, Stanford or MIT - Open edX provides free online courses from Harvard, MIT, Columbia, UC Berkeley and other top Universities. Hundreds of courses for almost all major subjects and course levels. Open edx also offers some paid courses and selected certifications.


Linux Manual Pages - A man or manual page is a form of software documentation found on Linux/Unix operating systems. Topics covered include computer programs (including library and system calls), formal standards and conventions, and even abstract concepts.