Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] mkiocccentry(1) UUID type 4 is too strict #1035

Closed
1 task done
lcn2 opened this issue Dec 7, 2024 · 10 comments
Closed
1 task done

[Bug] mkiocccentry(1) UUID type 4 is too strict #1035

lcn2 opened this issue Dec 7, 2024 · 10 comments
Assignees
Labels
bug Something isn't working top priority This a top priory critical path issue for next milestone

Comments

@lcn2
Copy link
Contributor

lcn2 commented Dec 7, 2024

Is there an existing issue for this?

  • I have searched for existing issues and did not find anything like this

Describe the bug

The mkiocccentry(1) tool version: 1.0.8 2024-08-23, requires the UUID based username to be of this form:

xxxxxxxx-xxxx-4xxx-axxx-xxxxxxxxxxxx

A UUID type 4 can be anything of this form:

xxxxxxxx-xxxx-4xxx-[89ab]xxx-xxxxxxxxxxxx

What you expect

The mkiocccentry(1) tool will allow any valid UUID type 4 for a username.

Environment

  • OS: yes
  • Device: of course
  • Compiler: good idea

bug_report.sh output

n/a

Anything else?

The ioccc_passwd.py, version "1.6.1 2024-12-07", in the submit-tool repo contains a work-a-round of the following form:

# The IOCCC mkiocccentry(1) tool, version: 1.0.8 2024-08-23,
# requires the UUID based username to be of this form:
#
#   xxxxxxxx-xxxx-4xxx-axxx-xxxxxxxxxxxx
#
# While str(uuid.uuid4()) does generate a '4' in the
# 14th character postion, the 19th position seems
# to be able to be any of [89ab].  We force the 19th
# character position to be an 'a' for now.
#
tmp = list(username)
# paranoia
tmp[14] = '4'
# mkiocccentry(1) tool, version: 1.0.8 2024-08-23 workaround
tmp[19] = 'a'
username = ''.join(tmp)

When this issue is resolved, the above work-a-round needs to be removed.

@lcn2 lcn2 added bug Something isn't working post-IOCCC28 All work and comments delayed until post-IOCCC28 and post IOCCC judge vacation. labels Dec 7, 2024
@lcn2 lcn2 self-assigned this Dec 7, 2024
@xexyl
Copy link
Contributor

xexyl commented Dec 7, 2024

Do you mean that the new check should be ...

xxxxxxxx-xxxx-4xxx-[89ab]xxx-xxxxxxxxxxxx

in form?

@xexyl
Copy link
Contributor

xexyl commented Dec 7, 2024

And you're welcome to assign this to me .. though I guess the other part, testing the server and so on, is more important for now.

@lcn2
Copy link
Contributor Author

lcn2 commented Dec 7, 2024

Do you mean that the new check should be ...

xxxxxxxx-xxxx-4xxx-[89ab]xxx-xxxxxxxxxxxx

in form?

Yes.

This generates valid UUID type 4 strings:

python3 -m uuid -u uuid4

The mkiocccentry(1) tool needs to check for UUID strings of the form:

xxxxxxxx-xxxx-4xxx-[89ab]xxx-xxxxxxxxxxxx

For further verification, here is a check of 1000 random UUID type 4 strings:

for i in $(seq 1 1000); do
    python3 -m uuid -u uuid4 | sed -e 's/^........-....-....-//' -e 's/\(.\).*/\1/';
done | grep -v '^[89ab]'

UPDATE 0c

Corrected typos above.

@xexyl
Copy link
Contributor

xexyl commented Dec 8, 2024

I might look into doing this sometime soon if I have the energy and time.

I know it's post IOCCC28 but it might be nice to have it ready for that time so it can just be committed and be done and then you can remove the workaround.

I am going to be booting up the laptop shortly and if I can I will look at the FAQ at the website repo and also the documentation for the submit server but it has been some early mornings unfortunately.

Hope that you are sleeping well!

@lcn2
Copy link
Contributor Author

lcn2 commented Dec 8, 2024

I might look into doing this sometime soon if I have the energy and time.

I know it's post IOCCC28 but it might be nice to have it ready for that time so it can just be committed and be done and then you can remove the workaround.

Please don't right now. We created this just as a placeholder so that we won't forget the details after several months. But now we regret doing that because of this distraction.

In general, PRs related to such post-IOCCC28 issues would need to rejected today such PRs are not being ready for consideration until IOCCC28 closes and the IOCCC28 winning entries are published.

I am going to be booting up the laptop shortly and if I can I will look at the FAQ at the website repo and also the documentation for the submit server but it has been some early mornings unfortunately.

Hope that you are sleeping well!

Thank you, hope you are too.

@xexyl
Copy link
Contributor

xexyl commented Dec 8, 2024

I might look into doing this sometime soon if I have the energy and time.
I know it's post IOCCC28 but it might be nice to have it ready for that time so it can just be committed and be done and then you can remove the workaround.

Please don't right now. We created this just as a placeholder so that we won't forget the details after several months. But now we regret doing that because of this distraction.

In general, PRs related to such post-IOCCC28 issues would need to rejected today such PRs are not being ready for consideration until IOCCC28 closes and the IOCCC28 winning entries are published.

Oh I wasn't thinking of doing any commit. I was just thinking of editing the file to get it out of the way. But that was also just a passing thought. I don't feel any need to do it either. The workaround is fine and I do have other things to do too, including things for the contest.

I am going to be booting up the laptop shortly and if I can I will look at the FAQ at the website repo and also the documentation for the submit server but it has been some early mornings unfortunately.
Hope that you are sleeping well!

Thank you, hope you are too.

Awake since at least 4 but doing okay right now at least. Going to look at other comments but I don't think I'll do anything else here today .. have too many other things to take care of.

Hope your day goes well!

@lcn2 lcn2 added top priority This a top priory critical path issue for next milestone and removed post-IOCCC28 All work and comments delayed until post-IOCCC28 and post IOCCC judge vacation. labels Dec 24, 2024
@lcn2
Copy link
Contributor Author

lcn2 commented Dec 25, 2024

We believe we have addressed all of the current questions that still need answering at this time. If we've missed something or something else needs to be clarified, please ask again.

@xexyl
Copy link
Contributor

xexyl commented Dec 25, 2024

I see this is now top priority even with the workaround in the server. Do you wish me to look at this after all, before IOCCC28 ?

@lcn2
Copy link
Contributor Author

lcn2 commented Dec 26, 2024

I see this is now top priority even with the workaround in the server. Do you wish me to look at this after all, before IOCCC28 ?

It needs to happen before IOCCC28 goes form pending to open .. post 2024 / early 2025.

@xexyl
Copy link
Contributor

xexyl commented Dec 26, 2024

I believe this is done now too .. have to run make test first but should be okay. However I have to go afk now .. back in a while. If nothing else today I at least got three things done. Very tired but hopefully I can get more done too.

xexyl added a commit to xexyl/mkiocccentry that referenced this issue Dec 26, 2024
The issues in respective order:

- Typo fix in mkiocccentry.c ('You title must ...' -> 'Your title must
...').
- mkiocccentry UUID type 4 was too strict
- Renamed makefile.local -> Makefile.local. This does NOT address issue ioccc-src#1034!

Updated version of mkiocccentry due to the above changes. For the second
one new macros are in soup/limit_ioccc.h so the soup version has been
updated as well.

Due to the mkiocccentry version change many JSON files were updated so
this is a large commit.

Something that should be pointed out is that the dyn_array and dbg repos
should be updated to match the Makefile changes. This can be done later.
I am too tired to do that now but what this means is that if one were to
sync dbg or dyn_array to here it would roll it back.

Another thing to point out is that another couple commits will likely be
included as a mistake was made on my end and unfortunately that commit
was pushed to my fork. This means I had to do git revert on it.
@lcn2 lcn2 closed this as completed Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working top priority This a top priory critical path issue for next milestone
Projects
None yet
Development

No branches or pull requests

2 participants