In the review lab the final task (Modify the global login scripts....) there are 2 issues that need addressing.
1. According to the grading script, unless you place the umask modifications in the /etc/profile file it grades that part as FAIL. However, as indicated in the comments at the top of the /etc/profile file:
It's NOT a good idea to change this file...It's a much better to create a custom.sh shell script in /etc/profile.d/
Perhaps direct the student to do something similar to what they were taught in Chapter 6 guided exercise where they created a custom sudoer file in the /etc/sudoers.d/ directory.
2. When creating the custom umask values for "normal users". A reasonable interpretation of that instruction is that you are looking to set a custom umask value for regular unprivileged users, not system process users or the root user. In Chapter 6 the UID Ranges section specifies that regular users have UID values of -gt 999.
The example expected content shows $UID -gt 199 and the text on the solutions also specifically references a value of 199.
When I created a custom.sh in the /etc/profile.d with the example content, that lab component graded as FAILED. When I placed it in the /etc/profile file it graded as PASSED. When I used $UID -gt 999, it also graded as PASSED.
I think the instructions need to be modified to have students:
1. Well... Not only that, but the script they suggest the student use...
if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; then umask 007 else umask 022 fi
... uses depricated code / techniques. It should have been written this way (or similar):
if [[ $UID -gt 199 && "$(id -gn)" == "$(id -un)" ]]; then umask 007 else umask 022 fi
2. Yes, the normal user UID range (since RHEL
1. and 2. If you look at /etc/bashrc, you'll see why they've stuck with the deprecated code and UID 199 -- most likely to retain compatibility with older software and scripts:
For RH124, I give my students this script and tell them to be very careful when typing it in.
Think about the larger implications: scripting, as a topic, isn't introduced until RH134. Why are they asking the students to do this in a RH124 class?
This is an example of RH's exam writers introducting a new topic / technique as an answer to an exam task.
I noticed they used the back tick as well and I use this a an opportunity to talk about the differences between " ". ' ' and ` ` and how ' and ` are often confused or mistaken but you can tell the difference when you see the results...( early troubleshoot skills)
Like you, I've also noted that either RH is simply providing a specific example (and I tell my students to not freak out about not understanding it right now, just type it exactly, sort of like when they are asked to use ausearch and AVC in RH134....) OR as a way to introduce a topic needed for the RHCSA but outside the specific scope of this class.
In fact, when we covered this topic in RH134, I specifically pulled this script back up and walked them through it again. I think, since this was the second time they've seen this code, it made understanding the [ command a little easier to grasp since there was something familiar to latch onto.