Skip to content

Commit c5889a9

Browse files
committed
add gufi_vt dir_match_uid/gid without values test
1 parent 8e0b332 commit c5889a9

File tree

3 files changed

+40
-2
lines changed

3 files changed

+40
-2
lines changed

src/gufi_vt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -723,8 +723,8 @@ gufi_vt_xConnect(VRPENTRIES, VRP, 0, 0, 1, 1)
723723
* a = <0|1|2> (see gufi_query)
724724
* min_level = <non-negative integer>
725725
* max_level = <non-negative integer>
726-
* dir_match_uid = <uid>
727-
* dir_match_gid = <gid>
726+
* dir_match_uid = <uid> (if just want euid, pass in no value i.e. dir_match_uid=)
727+
* dir_match_gid = <gid> (if just want egid, pass in no value i.e. dir_match_gid=)
728728
* setup_res_col_type = '<SQL>' (set up single temporary table to make columns available for getting result column types)
729729
* I = '<SQL>'
730730
* T = '<SQL>'

test/regression/gufi_vt.expected

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,37 @@ prefix/empty_directory
575575
prefix/leaf_directory
576576
prefix/unusual#? directory ,
577577

578+
# dir_match_uid/gid without values
579+
$ (
580+
echo ".load gufi_vt"
581+
echo "CREATE VIRTUAL TABLE gufi USING gufi_vt("prefix", dir_match_uid=, dir_match_gid=, E="SELECT rpath(sname, sroll, name) AS fullpath, level() AS level FROM vrpentries;", verbose=1);SELECT level, fullpath FROM gufi ORDER BY level ASC, fullpath ASC;"
582+
) | sqlite3
583+
Each line is one argv[i]:
584+
gufi_query \
585+
--print-tlv \
586+
-x \
587+
--threads \
588+
1 \
589+
--dir-match-uid \
590+
--dir-match-gid \
591+
-E \
592+
SELECT rpath(sname, sroll, name) AS fullpath, level() AS level FROM vrpentries; \
593+
prefix
594+
0|prefix/.hidden
595+
0|prefix/1KB
596+
0|prefix/1MB
597+
0|prefix/file_symlink
598+
0|prefix/old_file
599+
0|prefix/repeat_name
600+
1|prefix/directory/executable
601+
1|prefix/directory/readonly
602+
1|prefix/directory/writable
603+
1|prefix/leaf_directory/leaf_file1
604+
1|prefix/leaf_directory/leaf_file2
605+
1|prefix/unusual#? directory ,/unusual, name?#
606+
2|prefix/directory/subdirectory/directory_symlink
607+
2|prefix/directory/subdirectory/repeat_name
608+
578609
# ######################################
579610
# errors
580611
# Missing indexroot

test/regression/gufi_vt.sh.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,13 @@ query=$(
265265
)
266266
query_vt "${query}"
267267

268+
echo "# dir_match_uid/gid without values"
269+
query=$(
270+
echo -n "CREATE VIRTUAL TABLE gufi USING gufi_vt(\"${INDEXROOT}\", dir_match_uid=, dir_match_gid=, E=\"SELECT rpath(sname, sroll, name) AS fullpath, level() AS level FROM vrpentries;\", verbose=1);"
271+
echo -n "SELECT level, fullpath FROM gufi ORDER BY level ASC, fullpath ASC;"
272+
)
273+
query_vt "${query}"
274+
268275
echo "# ######################################"
269276
echo "# errors"
270277

0 commit comments

Comments
 (0)