You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This do-while in tang-gen.c is problematic. I'm not sure why loop is needed but
either existance/access checks are needed or, as a last resort, bail out after
a set number of loops.
Happy to patch this myself but needed to find out why the do-while is there
first :)
} else {
do {
r = keyfilegen(dbdir, filename);
if (r != 0)
error(EXIT_FAILURE, r, "Error generating keyfile name");
file = fopen(filename, "wx");
} while (!file);
}
The text was updated successfully, but these errors were encountered:
The loop is there to catch random name collisions (unlikely, but a possibility). keyfilegen() creates a random filename and fopen(filename, "wx") creates the file with that name. If it fails, it may indicate a name collision. Maybe something like:
while (!file && errno == EEXIST)
This do-while in tang-gen.c is problematic. I'm not sure why loop is needed but
either existance/
access
checks are needed or, as a last resort, bail out aftera set number of loops.
Happy to patch this myself but needed to find out why the do-while is there
first :)
The text was updated successfully, but these errors were encountered: