1.1 --- a/tests/dstest_file_readdir.cc Thu Jan 27 23:45:17 2022 +0100
1.2 +++ b/tests/dstest_file_readdir.cc Sun Feb 06 18:05:23 2022 +0100
1.3 @@ -1,7 +1,7 @@
1.4 /*
1.5 * Test directory reading operations.
1.6 *
1.7 - * Copyright (C) 2020, 2021 Paul Boddie <paul@boddie.org.uk>
1.8 + * Copyright (C) 2020, 2021, 2022 Paul Boddie <paul@boddie.org.uk>
1.9 *
1.10 * This program is free software; you can redistribute it and/or
1.11 * modify it under the terms of the GNU General Public License as
1.12 @@ -31,47 +31,19 @@
1.13
1.14
1.15
1.16 -static file_t *open_directory(char *filename, bool have_uid, sys_uid_t uid)
1.17 -{
1.18 - /* With a user, open a user-specific file opener. */
1.19 -
1.20 - if (have_uid)
1.21 - {
1.22 - l4_cap_idx_t opener = client_open_for_user((user_t) {uid, uid, 0022});
1.23 -
1.24 - if (l4_is_invalid_cap(opener))
1.25 - {
1.26 - printf("Could not obtain opener for file.\n");
1.27 - return NULL;
1.28 - }
1.29 -
1.30 - /* Invoke the open method to receive the file reference. */
1.31 -
1.32 - return client_opendir_using(filename, opener);
1.33 - }
1.34 - else
1.35 - {
1.36 - return client_opendir(filename);
1.37 - }
1.38 -}
1.39 -
1.40 -
1.41 -
1.42 int main(int argc, char *argv[])
1.43 {
1.44 if (argc < 2)
1.45 {
1.46 - printf("Need a directory name and an optional user identifier (if used with a filesystem).\n");
1.47 + printf("Need a directory name.\n");
1.48 return 1;
1.49 }
1.50
1.51 char *filename = argv[1];
1.52 - bool have_uid = (argc > 2) && strlen(argv[2]);
1.53 - sys_uid_t uid = have_uid ? atoi(argv[2]) : 0;
1.54
1.55 printf("Opening %s...\n", filename);
1.56
1.57 - file_t *reader = open_directory(filename, have_uid, uid);
1.58 + file_t *reader = client_opendir(filename);
1.59
1.60 if (reader == NULL)
1.61 {
1.62 @@ -93,7 +65,7 @@
1.63
1.64 /* Open again, reading a single entry only. */
1.65
1.66 - reader = open_directory(filename, have_uid, uid);
1.67 + reader = client_opendir(filename);
1.68
1.69 if (reader == NULL)
1.70 {