Tech Support Guy banner
Status
Not open for further replies.
1 - 1 of 1 Posts

·
Registered
Joined
·
431 Posts
There are a lot of questions embedded in your post!

1. link() simply creates a new directory entry for a file. There is still only one file,
but link() creates a new name for that file.

2. unlink() deletes a directory entry and is what you'll use in unlock_passwd(). The file is not erased, but its directory entry is gone.

3. link() sets errno to EEXISTS when it attempts to create a directory entry where one already exists by the same name.

4. The whole idea of using this approach is to make the file modification atomic. Atomicity refers to the concept of grouping one or more tasks together so that each of them must succeed or none of them succeeds.

5. I would look at the stat() function in answering item d.

6. The problem is unlikely to occur in changing of passwords, because the likelihood of two users changing their passwords at EXACTLY the same time is very low. However, I've had the same file opened in vi in two different windows and saved the file in the "wrong" order before. I hate it when that happens.

Hope this helps...
 
1 - 1 of 1 Posts
Status
Not open for further replies.
Top