Try to work even if fetching Smack label of current process fails in
off-line client mode. In most cases it won't be needed anyway.
It is needed for proper image building by mic. When mic is run on system
that doesn't support Smack natively (e.g. developer's workstation), fetching
process Smack label will fail. Somehow it managed to work despite that
problem until now, but libsmack 1.3.0 has better checks in function
smack_new_label_from_self, validating the label before sending it to the
caller.
Change-Id: I3a96851cab5e71bde749c68413b967571690e162
#include <unistd.h>
#include <sys/socket.h>
+#include "smack-check.h"
#include "smack-labels.h"
#include "credentials.h"
Credentials Credentials::getCredentialsFromSelf(void)
{
return Credentials(getpid(), geteuid(), getegid(),
- SmackLabels::getSmackLabelFromSelf());
+ smack_check() ? SmackLabels::getSmackLabelFromSelf() : "");
}
Credentials Credentials::getCredentialsFromSocket(int sock)