Talk:Time-of-check to time-of-use

I think this is most known as toctou not tocttou

compare with google


 * http://download.oracle.com/javase/tutorial/essential/io/check.html mentions it as TOCTTOU --173.25.223.151 (talk) 02:55, 29 January 2011 (UTC)

linux
someone should mention that you can prevent tocttou under linux via the following sysctl settings: fs.protected_hardlinks = 1 and fs.protected_symlinks = 1 79.230.118.243 (talk) —Preceding undated comment added 14:14, 18 June 2013 (UTC)

Other examples and solutions
File systems aren't the only place TOCTOU shows up. Here are some other familiar examples that might be worth working into the article.


 * "Avoiding the lost update problem with optimistic locking" https://developer.mozilla.org/en-US/docs/Web/HTTP/Conditional_requests#Use_cases
 * "git push --force" vs. "git push --force-with-lease" — Preceding unsigned comment added by 207.61.188.74 (talk) 14:26, 29 November 2017 (UTC)

TOCTOU vs. TOCTTOU
We list the TOCTTOU acronym first, and use it preferentially. I think that's backwards. I tried some searches:

There's a clear preference for TOCTOU in actual usage in both the general purpose and technical corpora. I can only assume that the ACM outlier is due to a house style preference, which the IEEE doesn't share. Surprisingly, kernel.org's bugzilla comes up with "Zarro Boogs" for either term. Unclear what to make of that.

I think we should go with the most common usage.

External links modified
Hello fellow Wikipedians,

I have just modified 2 external links on Time of check to time of use. Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:
 * Added archive https://archive.is/20130116041403/http://cdblp.cn/paper/UNIX%E7%9A%84%E4%B8%80%E4%B8%AA%E6%BC%8F%E6%B4%9E/94334.html to http://cdblp.cn/paper/UNIX%E7%9A%84%E4%B8%80%E4%B8%AA%E6%BC%8F%E6%B4%9E/94334.html
 * Added archive https://web.archive.org/web/20170213004928/http://www.employees.org/~satch/ssh/faq/TheWholeSSHFAQ.html to http://www.employees.org/~satch/ssh/faq/TheWholeSSHFAQ.html

When you have finished reviewing my changes, you may follow the instructions on the template below to fix any issues with the URLs.

Cheers.— InternetArchiveBot  (Report bug) 18:07, 9 January 2018 (UTC)

This needs a plainer-English summary for non-technical folks
I know "people with no technology background interested in TOCTOU" is probably a very small group, but it would be great to have a really plain English, non-technical summary of what this is. 50.72.32.79 (talk) 00:47, 8 April 2023 (UTC)


 * Suppose you call up your neighborhood Widget store and ask, "Do you have any sprockets?" And they say, "We have one left." And you say "Great!", and hang up, and race to the store, and say, "I want a sprocket".  But they say, "We're all out", and you say, "But you just told me you had one!", and they say, "Well, yeah, but in the meantime someone else came in and bought it."


 * In other words, something significant happened between the time you called and checked ("TOC") and the time you tried to buy ("TOU"), and this affected your ability to successfully complete your task.


 * If, instead, you had gone to the store first, you could have — maybe — found the sprocket on the shelf, and walked up to the counter with it in your hand, and said "I want to buy this sprocket". That way, no one else could have taken it away from you.  (Well, at least not without a fight.)


 * Going to the store and then trying to buy the item doesn't guarantee you'll get one — it's possible that when you get there you'll discover they don't have any — but it does guarantee that you won't have the extra-disappointing surprise of getting your hopes up, thinking you had access to your item, but then not getting it after all.


 * Another solution is that when you called in advance to ask if they had one, and they told you they did, you could have asked, "Can you hold it for me?". That's the real-life analogy to "adopting transactions in the file system or the OS kernel" as mentioned in the article. —scs (talk) 22:04, 21 August 2023 (UTC)