}
bool
-handleFile(char const *name, char const * display_name,
- struct stat const *exp_st)
+handleFile(char const *name, char const * display_name)
{
- int rc = vc_set_iattr_compat(name, exp_st->st_dev, exp_st->st_ino,
- global_args->ctx, 0, VC_IATTR_XID,
- &exp_st->st_mode);
+ int rc = vc_set_iattr(name, global_args->ctx, 0, VC_IATTR_XID);
if (rc==-1) {
perror(display_name);
// show current directory entry first
if (lstat(".", &cur_st)==-1) perror("lstat()");
- else err += handleFile(".", path, &cur_st) ? 0 : 1;
+ else err += handleFile(".", path) ? 0 : 1;
// strip trailing '/'
while (path_len>0 && path[path_len-1]=='/') --path_len;
{
CONCAT_PATHS(path, path_len, ent->d_name);
- err += handleFile(ent->d_name, new_path, &st) ? 0 : 1;
+ err += handleFile(ent->d_name, new_path) ? 0 : 1;
}
}
return iterateFilesystem(path);
}
else
- return handleFile(path, path, &st);
+ return handleFile(path, path) ? 0 : 1;
}
int main(int argc, char *argv[])
bool checkForRace(int fd, char const * name, struct stat const *exp_st);
void fixupParams(struct Arguments *, int argc);
-bool handleFile(char const *d_name, char const *full_name, struct stat const *);
+bool handleFile(char const *d_name, char const *full_name);
void showHelp(int fd, char const *cmd, int res);
void showVersion();
xid_t resolveCtx(char const *str);
}
static xid_t
-getFileContext(char const *name, struct stat const *exp_st)
+getFileContext(char const *name)
{
xid_t res;
uint32_t mask = VC_IATTR_XID;
- if (vc_get_iattr_compat(name, exp_st->st_dev, exp_st->st_ino,
- &res, 0, &mask, &exp_st->st_mode)==-1)
- perror("vc_get_iattr_compat()");
+ if (vc_get_iattr(name, &res, 0, &mask)==-1)
+ perror("vc_get_iattr()");
return (mask&VC_IATTR_XID) ? res : VC_NOCTX;
}
bool
-handleFile(char const *name, char const *display_name,
- struct stat const *exp_st)
+handleFile(char const *name, char const *display_name)
{
xid_t ctx = 0;
char buf[MAX(sizeof(ctx)*3+1, 20)];
memset(buf, ' ', sizeof buf);
#if 1
- ctx = getFileContext(name, exp_st);
+ ctx = getFileContext(name);
#else
# warning Compiling in debug-code
ctx = random() % 10 + 49213;
}
bool
-handleFile(char const *name, char const * display_name,
- struct stat const *exp_st)
+handleFile(char const *name, char const * display_name)
{
- int rc = vc_set_iattr_compat(name, exp_st->st_dev, exp_st->st_ino,
- 0,
- global_args->set_mask & ~global_args->del_mask,
- global_args->set_mask | global_args->del_mask,
- &exp_st->st_mode);
+ int rc = vc_set_iattr(name,
+ 0,
+ global_args->set_mask & ~global_args->del_mask,
+ global_args->set_mask | global_args->del_mask);
if (rc==-1) {
perror(display_name);
}
static bool
-getFlags(char const *name, struct stat const *exp_st, uint32_t *flags, uint32_t *mask)
+getFlags(char const *name, uint32_t *flags, uint32_t *mask)
{
xid_t xid;
*mask = ~0;
- if (vc_get_iattr_compat(name, exp_st->st_dev, exp_st->st_ino,
- &xid, flags, mask, &exp_st->st_mode)==-1) {
- perror("vc_get_iattr_compat()");
+ if (vc_get_iattr(name, &xid, flags, mask)==-1) {
+ perror("vc_get_iattr()");
return false;
}
}
bool
-handleFile(char const *name, char const *display_name,
- struct stat const *exp_st)
+handleFile(char const *name, char const *display_name)
{
bool res = true;
char buf[40];
memset(buf, ' ', sizeof buf);
- if (getFlags(name, exp_st, &flags, &mask)) {
+ if (getFlags(name, &flags, &mask)) {
// 1 1 0 0
// fedcba9876543210fedcba9876543210
static char const MARKER[33] = ".......x......ib.............hwa";