}
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)) {
- // 1 1 0 0
- // fedcba9876543210fedcba9876543210
- static char const MARKER[33] = ".......x......ib.............hwa";
+ if (getFlags(name, &flags, &mask)) {
+ // 1 1 0 0
+ // fedcba9876543210fedcba9876543210
+ static char const MARKER[33] = ".......x.....iub.............hwa";
int i;
uint32_t used_flags = (VC_IATTR_XID|VC_IATTR_ADMIN|
VC_IATTR_WATCH|VC_IATTR_HIDE|
- VC_IATTR_BARRIER|VC_IATTR_IUNLINK);
+ VC_IATTR_BARRIER|VC_IATTR_IUNLINK|
+ VC_IATTR_IMMUTABLE);
for (i=0; i<32; ++i) {
if (used_flags & 1) {
}
}
else {
- memcpy(buf, "ERR ", 6);
+ memcpy(buf, "ERR ", 7);
res = false;
}
- write(1, buf, 8);
- write(1, display_name, strlen(display_name));
- write(1, "\n", 1);
+ Vwrite(1, buf, 8);
+ Vwrite(1, display_name, strlen(display_name));
+ Vwrite(1, "\n", 1);
return res;
}