Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Merge of b_md to HEAD:
[fs/lustre-release.git]
/
lustre
/
tests
/
setuid.c
1
#include <stdio.h>
2
#include <sys/types.h>
3
#include <sys/stat.h>
4
#include <time.h>
5
#include <errno.h>
6
#include <string.h>
7
#include <fcntl.h>
8
#include <unistd.h>
9
#include <stdlib.h>
10
#include <sys/fsuid.h>
11
12
int main(int argc, char ** argv)
13
{
14
int rc, fsuid;
15
16
if (argc < 2) {
17
printf("Usage %s fsuid\n", argv[0]);
18
return 1;
19
}
20
21
fsuid = strtoul(argv[2], NULL, 0);
22
rc = setfsuid(fsuid);
23
if (rc) {
24
printf("mknod(%s) error: %s\n", argv[1], strerror(errno));
25
}
26
return rc;
27
}