% cat /proc/self/attr/current
% echo 'value' > /proc/self/attr/current
If my value is a struct, how to set in /proc/self/attr/current? I
tested the procfs using the following codes:
struct mystruct{
int v1;
int v2;
} my_struct;
my_struct.v1 = 1;
my_struct.v2 = 2;
sprintf(path, "/proc/%d/attr/current", pid); // pid is the process id
int fd = open(path, O_WRONLY);
if (fd != -1) {
rc = write(fd, my_struct, sizeof(mystruct));
close(fd);
}
return rc;
After the code running, I got the error message:-1. It seems that I
have not permission to write the current. What's wrong with it? I run
the above test code as root, it is important of no permission to write
the file.
-
To unsubscribe from this list: send the line "unsubscribe
linux-security-module" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html