#fileuid()
DESCRIPTION
returns the user id (uid) of a file's owner
SYNOPSIS
#fileuid(s)
ARGUMENTS
s - a quoted string, or string expression, representing a filepath
EXAMPLES
# pikt +C 'output $text(#fileuid("/etc/passwd"))'
0
rule
set #fu = #fileuid($inlin)
rule
if #fu != %fu
output mail "for $inlin, uid has changed"
fi
rule // check devfile ownerships and permissions
set $devfile = =devfile($mount)
# ifdef debug
output $devfile
# endifdef
if #fileuid($devfile) != 0 // root
output "$mount devfile $devfile not root-owned"
fi
if #filegid($devfile) != =sysgid
output "$mount devfile $devfile not sys-owned"
fi
if $filemode($devfile) ne "060640"
output "$mount devfile $devfile perms not 060640,
are $filemode($devfile)"
fi
rule // check rawdevfile ownerships and permissions
set $rawdevfile = =rawdevfile($mount)
# ifdef debug
output $rawdevfile
# endifdef
if #fileuid($rawdevfile) != 0 // root
output "$mount rawdevfile $rawdevfile not root-owned"
fi
if #filegid($rawdevfile) != =sysgid
output "$mount rawdevfile $rawdevfile not sys-owned"
fi
if $filemode($rawdevfile) ne "020640"
output "$mount rawdevfile $rawdevfile perms not 020640,
are $filemode($rawdevfile)"
fi
SEE ALSO
#fileino()
#filelinks()
#filegid()
#fileatime()
#filectime()
#filemtime()
#filesize()
Numerical Functions
String Functions