Twitter privacy levels
I have been a Twitter user for nearly one year now. It has been an generally pleasant experience. Microblogging is now part of my array my information tools, which also include: RSS (through Google Reader), Email, IRC. A more complete post about own I see Twitter as useful is something I need to do eventually.
I have recently made my Twitter page protected due to the rampant increase in the prevalence of spamming on Twitter. Doing this has bought me peace of mind, but it is pretty unfortunate that Twitter privacy is an all-or-nothing option. If you want keep spammers away from your profile, you need to set your profile to protected and you have no other options. A protected account has the following restriction:
- People that want to follow you need to be approved
- Your tweets don’t appear on search.twitter.com
- “@replies” to user not following you will not be seen
- You cannot share direct links to your tweet with others
For Twitter outsiders, it is interesting to know that, on Twitter, spammers are not like the obscure, badly worded email that sometimes slip through your email spam filter. A mom an pop plumbing shop hunting potential clients using keywords on Twitter search is also considered to be spamming, admittedly to a lesser level. Some people will call this marketing but it’s a pretty thin line between that a really spamming, especially if the shop is located in the central US where it’s unlikely I’ll ever end up travelling.
The third limitation is what has annoyed me the most about protecting my profile. I follow several people that have good reasons not to follow me and yet I would like to sometimes directly address those persons. For this purpose, I had to create another unprotected account. This is not unpractical as long as your Twitter client supports multiple Twitter account.
It seems to me that those problems would not happen if the privacy options were more fine-grained. I don’t need the full protection of a protected profile, but there are some features of it I can’t live without. Here is how I would split the privacy options.
Visibility
This would determine if only followers can see your tweets. If the user decides that his tweets are private then its of course the should not be searchable.
Followability
It should be possible to screen people that want to follow you on Twitter. Most people I have seen using a protected profile will accept being followed by just any human being, and just the fact of making the profile protected puts it out of reach of majority of spammers.
I understand why this is a feature reserved to protected accounts: if your tweets are public and searchable, then whoever really wants to follow you can do it manually without adding you to their followers list. So, without making the profile private, this option is next to useless to protect keep your profile away from spammers.
Still, there is nothing keeping Twitter from making this feature available independently of private profile. Weeding out your Followers page of the many spammers that stitches to any unprotected profile is something know to all Twitter users and it’s not a fun task if you ever forget it for a few months.
Searchability
Some users might not want their profile to be found on search.twitter.com. I simply don’t need that level of privacy, but it’s not unconceivable that some particular users of Twitter would want to be of the public view.
@replies to you
This would determine if you want to messages directly addressed to you from users you don’t follow. Since Twitter already has a Block feature which does that on an user per user basis, this would be like automatically blocking all users.
This could be useful for star Twitter users with little tons of followers that want to limit who can address them. Most of those people probably don’t read all those tweets anyway, so why give people the illusion they can talk to them?
This of course would be of no use to me since there is just not enough people sending me tweets.
@replies to others
This would determine if want your @replies to be automatically public. This would allow you to communicate with people You want.
This is of particular interest with low-rank Twitter user like me who just want to send messages to Twitter microcelebrities that have few enough fan to read what they say to them and that sometimes might even reply.
Findability
Since we are into adding privacy levels, why not put that in too? Some users might not want to be found using the Twitter “Search User” feature. A privacy setting could be added to disable that.
I’m proposing this just because I thought of it… The Twitter Search User page is pretty crappy and already ensure a base level of privacy which suits me fine.
Explicitely public tweets?
I think most of the problems I have with Twitter privacy settings would be solved if tweets could be made public on an individual basis. It would then be possible to address directly people that don’t follow you and take part in your favorite meme without leaving the comfy cloak of your protected account.
I must say that I have not checked what other microblogging platforms, like Jaiku and identi.ca have to offer. I admit that what I’m suggesting in this post might already exists somewhere else.
Google Wave invites
I have received 8 Google Wave invites to give away. I know this is still in demand, but it seems everyone that was interested in Google Wave in my immediate cyber-vicinity already surfing the Wave.
So, I’m opening up my invites to the whole Internet and will give away a invite to the first 8 interested people that comments on this entry. Don’t forget to write a reachable email address.
I expect nothing in return but if want to spend a few minutes considering the rests of the posts on my blog, I’ll be grateful.
On String.intern()
Where the author realizes the significance of the String.intern() method
I might have hinted about in in my previous post on the subject of strings in Java, yet I did not realize the significance of String.intern() method. The following code sample demonstrates the behavior of the String.intern() method, similar to what I demonstrated in the post.
public class TestClass2 {
public static void main(String[] args) {
String s1 = "hello";
String s2 = new String("hello");
// This is going to be false.
if (s1 == s2) System.out.println("s1 == s2");
// This is going to be true.
if (s1 == s2.intern()) System.out.println("s1 == s2.intern()");
}
}
It’s a didactic example at best. It’s when you consider that strings also come from input/output that it String.intern() becomes a thing of interest.
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class TestClass2 {
public static void main(String[] args) {
String s1 = "hello";
String s2 = null;
try {
// Enter hello at this point.
s2 = new BufferedReader(new InputStreamReader(System.in)).readLine();
// This is going to be false.
if (s1 == s2) System.out.println("s1 == s3");
// This is going to be true.
if (s1 == s2.intern()) System.out.println("s1 == s2.intern()");
} catch (IOException e) {
e.printStackTrace();
}
}
}
As you can see in that example, the String.intern() method returns a reference to the string “hello” already in the constant pool. The virtual machine maintains an table of string instances that can be shared between all the string references in the program.
An immediate and obvious benefit of this technique called String interning is reduced memory footprint because of object reuse. Wikipedia also describes that the technique is also used by programs that need to do fast string comparisons such as compiler. This allow to compare strings by simple comparing references instead of possibly scanning the full length of both strings.
The JDK documentation gives a better description of the behavior of the String.intern() method. It’s a surprise to me that I never took the time to understand this behavior of such a core class of the Java library.
Microsofties might also find interesting that the .NET Framework also has a String.intern() method which behaves approximatively in the same way.
Don’t dust off your tinfoil hat for Skype just yet…
So Skype is evil because it’s proprietary?
It’s not hard to find rumors about spyware being deployed with the Skype VOIP software. What is hard to find amongst those rumors are concrete facts. Most of the rumors seems to be unsubstantiated, and some other are based on interpretation on the EULA of Skype. I won’t bother with the later case since legalese is not a language I speak.
This blog is one of the few blog around that take seem to take the matter seriously and brings forward something looking like a real proof that Skype may be stepping over the boundary of user privacy.
For the people who don’t read french, I will summarize the article. The author’s hypothesis is that when a new profile is registered through the Skype desktop client, the software accesses bookmarks stored in the user’s Mozilla Firefox profile. Since it’s not immediately obvious why Skype needs to be doing that, he concludes that the Skype software must be sending that information home for data warehousing, or some other shady practices.
For proof he shows his data that he obtained using the strace command on Linux. strace is a lovely, lovely utility I’ve learned to master in the last few years. It is an utility which shows the system calls that are used by a Linux application. strace is not hard to use but its output can be very voluminous and difficult to decipher. This is not the case here.
…Naaah
The data he obtained looked inoffensive to my eyes just 2 seconds after examining it (I won’t claim I’m the first that saw that: several commenter have pointed it to him).
The blogger singles out several calls to stat64(), which is a system call returns information about a file like its size and last modifications or last access date.
[pid 23964] stat64("/home/phil/.mozilla/firefox/bstiq480.default/bookmarkbackups/bookmarks-2008-12-17.json", {st_mode=S_IFREG|0600, st_size=41718, ...}) = 0
[pid 23964] stat64("/home/phil/.mozilla/firefox/bstiq480.default/bookmarkbackups/bookmarks-2008-12-20.json", {st_mode=S_IFREG|0600, st_size=42052, ...}) = 0
An higher level view of the data shows that Skype actually calls stat64() on all files on the the Mozilla profile of the user, and call open() on the directories he finds, then call getdents() to obtain the list of entries in that directory and so on…. Like any software recursively scanning the filesystem would do. The scan in the profile is stopped at the moment the software finds the user preference file.
This is easily explainable: Skype tries to install a FireFox plugin. It seems the Windows version has an option in the installer to disable that plugin but I have not found the same option in the Skype package.
So, Skype does search inside the user’s Firefox profile, but the only thing he does with the result it obtains is the installation of a plugin for the user’s convenience. It’s not even useful to search the place where it might be sending data since there is no data to send other that what it gathered through its registration wizard.
The final nail can be driven in the coffin on this theory by simple listing all the files opened by Skype during registration. None of the files contain personal information. You can see list of opened files I have extracted from the strace output at the end of this post.
Not evil on an evil operating system either…
Those results have been independently confirmed on Windows by DrFrakenstein, a twitterful, but blogless Code Ninja. He used Process Monitor and confirmed me roughly the same behavior but targeted at Internet Explorer.
So, probably not evil…
I can’t conclude this post by saying that Skype doesn’t include spyware. I simply spent one hour examining very limited data on the activity of the software during registration. Yet, I’m confident enough about my result to keep recommending its use to my family. Use Free alternatives such as Ekiga if you give high important to software freedom. It’s a opinion I respect. Just make sure you have something better that crappy strace analysis before dissing good but proprietary software.
See for yourself…
Here are the data I have obtained by running strace during Skype account creation server.
Since I love some good shell-one-liner action, here is the command that extracts the list of opened files from the strace data.
grep open skype.trace | perl -ne '/\"(.*)\"/ && print $1."\n"' | sort | uniq
Bits on info on Java strings
Update: I don’t keep IRC logs and thus cited the wrong guy. Sorry Vince.
On this blog entry I will take on an assertion stated by systemfault. He declared on the #programmeur IRC channel on Freenode that:
<systemfault> String foo = new String("lol"); est pareil que String foo = "lol";
<systemfault> Quand le compilo voit: String foo = "lol";
quand il compile, il va vraiment faire String foo = new String("lol");
Which in english means that:
String s = "hello";
is syntaxic sugar for:
String s = new String("hello");
Afterward, on the same subject, this behavior was regarded as a lack of consistency was deemed a fault of the Java language and the subject was closed. If I was a language lawyer, I would bore people to death by including the proper reference in the Java Language Specification. Since I’m more practically minded and that I have some experience with Java bytecode, I will dig and explain a bit of Java internal you my reader (or more optimistically, my readers).
An Elegant Proof
Vince is right that there is some syntactic sugar around Java string, but the example he gave isn’t correct. He failed to see consider the fact that, in Java, string literals are in fact first class objects.
Since This associates the reference s to the "hello" String object,
String s = "hello";
The next snippet creates a new reference s to a String object which is copied from the "hello" String object. It creates another object having the exact same content as the object "hello". Since Java strings are immutable, it’s really not that useful to make to duplicate references to the same string content this way.
String s = new String("hello")
That behavior is summarized by the following code snippet. If you run this code in your Java virtual machine, you will see that all conditions are satisfied.
String s1 = "hello";
String s2 = new String("hello");
if (s1.equals(s2)) System.out.println("String are equal");
if (s1 == "hello") System.out.println("s1 refers to the \"hello\" object.");
if (s2 != "hello") System.out.println("s2 doesn't refer to the \"hello\" object.");
if (s1 != s2) System.out.println("String references are not equal.");
In line 3 we see that both String object have the same content. Line 4 checks that s1 is indeed a reference pointing to the "hello" object. Line 5 shows that even if the content of the string refered to by s2 string is the same as s1, it doesn’t point to the "hello" object. Line 6 further drives that same point home.
The Magic
In the next half of this article, I’ll try to explain a bit why string behave the way they do in Java.
All string objects in Java are stored in what is called the Runtime Constant Pool. This mystery object is compared in the specification to the concept of symbol table that is present in many programming language.
The constant pool includes many informations, including strings, string literals, numeral constants, and references to other class methods.
String literals are load from the constant pool at the moment the class is loaded by the class loader of the virtual machine. All direct access to those literals will refer to the same instance of the object from the pool.
The Java Virtual Machine Specification goes very far to make sure that all String objects loaded by the virtual machine are not duplicated in memory:
The Java programming language requires that identical string literals (that is, literals that contain the same sequence of characters) must refer to the same instance of class String. In addition, if the method String.intern is called on any string, the result is a reference to the same class instance that would be returned if that string appeared as a literal. Thus,
(“a” + “b” + “c”).intern() == “abc”
must have the value true.
And indeed, the 2 conditions in the following program will get fired.
While the VM goes far trying to make sure strings are not duplicated in memory, the fact that new String("hello") creates another object should come as no surprise to a programmer. It’s really a case where DWIM prevails.
It’s also the same principle you can see behind the following code. If you can write a condition such as this "abc" == "abc", you will instinctively expects that the condition “a” + “b” + “c” == “abc” will be true either.
if (("a" + "b" + "c") == "abc") System.out.println("yes it is");
if (("a" + "b" + "c").intern() == "abc") System.out.println("yes it is");
It may make sense to somebody used to object-oriented programming to think that “a” + “b” + “c” should return a new string instance. Since Java, I think, sticks to the principle of least surprise, it would be a strange discrepency if the result of "a" + "b" + "c" would not be comparable to "abc" using ==.
All that work is the result of considering string literals as first class objects in the code. Things would be very much different if Java strings were defined as simple byte arrays like in many other languages. There is more high-calory sugar built around Java string that I might consider for my next blog post.
Naivety with C++
Warning, major n00bness ahead.
I’m not a big user of C++, but recently some work I have had to do with .NET has made me use C++/CLI, the .NET version of C++.
The API I work have a well defined and consistent Alloc/Use/Free cycle. This has gave me an incentive to learn to use RAII (via DrMax) to elegantly wrap the required cleanup operation in my code.
The following class around Windows GlobalAlloc is an example of such a wrapper.
// RAII friendly wrapper over Win32 GlobalAlloc.
class Memory
{
private:
bool m_isAlloc;
public:
HGLOBAL Ptr;
SIZE_T Size;
void Alloc(UINT flags, size_t dwBytes)
{
if (IsAlloc()) Free();
Size = dwBytes;
Ptr = GlobalAlloc(flags, dwBytes);
if (Ptr == 0)
throw gcnew OutOfMemoryException();
m_isAlloc = 1;
}
void Free()
{
if (Ptr) GlobalFree(Ptr);
m_isAlloc = 0;
Size = 0;
Ptr = 0;
}
bool IsAlloc()
{
return m_isAlloc;
}
Memory(UINT flags, size_t dwBytes)
{
Alloc(flags, dwBytes);
}
Memory()
{
Ptr = 0;
}
~Memory()
{
if (Ptr) GlobalFree(Ptr);
}
};
Expert eyes will obviously see that this code lacks 2 important things:
- there is no copy constructor
- there is no assignment operator
I’m not very experienced in C++ so I don’t the reflexes that make C++ programmers write those things when the define a class, and I don’t yet know when the implicit copy constructor and assignment operator are called. I’ve found that the easiest way to discover that is to to prevent them from being usable by the clients of the class. In the case of my small class above, I needed to make 2 functions private.
class Memory {
...
private:
Memory& operator=(const Memory& mem);
Memory(const Memory& mem);
...
This makes the compiler freak out when compiling my program…
...Memory::operator =' : cannot access private member declared in class 'Memory'...
The compiler has helpfully pointed to me out which place in my code those functions needs to be called.
Oops, so I really need that assignment operator after all.
Making up memory
I find it amazing how your own brain can fool you sometimes. I did not dig this subject very much but I have been intrigues by studies about how people can suggest things to individuals and make them believe in it like it was their own and like it has always been true.
In some circumstances, you can create and believe in your own false memory. This post is about an interesting example of how that has happened to me yesterday night.

At the beginning of the year, I have bought an Asus N10E laptop. It’s a sweet little machine, like a cross between a netbook and a laptop. There is nothing exotic in the configuration of that laptop. The N10 serie of laptops have models that include fancier options. If you look on the net, you will find reviews of the fancier models (see a revew of the N10J). Most of them include a Bluetooth module.
Yesterday, I felt like linking my laptop to my N800 using Bluetooth. I thought it would be like, and that I need needed was to learn how to activate the link and that user-friendly programs would do the rest. I was mistaken. Linux did not detect the Bluetooth device at all. Since I build my own kernel, I decided to check my kernel configuration against other known good configuration for similar models but failed to find anything I would be missing. At that point, I decided to boot back in Windows, thinking I would find more information about Bluetooth there.
At this point, I began to lose patience. Windows had no information about the Bluetooth device in the laptop. I tried reinstalling a few drivers and programs. I even checked the laptop manual, something I seldom do, to see how to activate Bluetooth. It was failure. The normal documented way to activate Bluetooth failed. The Bluetooth device drive was even missing. The BIOS did not have the option to activate or deactivate it.
I began to worry why was my Bluetooth module not working. After all, I had vivid rememberance of the shiny Bluetooth icon displayed on the OSD when I pressed the WLAN hotkey on my laptop.

I first suspected that some experiment I had done in Linux went awry and disabled the Bluetooth module for good, something that could happen by extrapolating from some forums posts on similar problems…
My Occam Razor safety device finally kicked in and I began suspecting I was the source of the problem more than the computer was. After further research, I had to come to this conclusion…
There was probably no Bluetooth module in that laptop!
I write probably for correctness, because the only way to know for sure would mean opening the laptop and search its guts for the Bluetooth chip.
The memory I had of seeing the Bluetooth icon was probably manufactured by my own certitude of that laptop having the Bluetooth option combined with the screen shots of the icon in the laptop manual. The certitude was created by myself using incorrect information since the reviews you can read of this laptop usually talk about Bluetooth, but they usually don’t use of the particular model I own. Some N10E might also have a Bluetooth module pre-installed since it’s an optional feature of the model. Add the fact that the laptop has a Bluetooth led and you have all the ingredients you need to think this laptop would have the Bluetooth module. NCIX, the place from where I ordered the laptop, make no mention of Bluetooth support.
I don’t want to sound overly clever and say I’ve learned my lesson. It’s just too easy to mix up memories with other information. This is just a simple example of what can happen. I feel good about the fact that I was able to sit back and consider that my certitudes might have been fabricated by myself.
Linux Symposium talk, slide and paper
Edit: I fixed the links, sorry.
Yes, I’m the nervous french geek that did the talk on non-privileged user package management. Steven Pigeon was my co-author.
I don’t think it’s groundbreaking in any or form, and I have no immediate plan to follow through with an implementation. I still think the basic idea in itself is defendable and I’m ready to stand up for it. On the other hand, what I now think is that maybe non-privileged user package management would be better served by a more radical departure from the current way software are packaged.
I have had at least one good comment after the talk and, all nervous that I was, I would be happy to repeat the experience.
The slides are pretty lame but, thanks the Steven’s mastery of everything english and LaTeX, the article is pretty solid.
Non-privileged user package management (.odp slides)
Non-privileged user package management (.pdf article)
Automatically set terminal title in X
I’ve been using the Mercurial Shell Prompt hack for a while until I got annoyed at it. It caused a Python interpeter to start at every prompt, which is expansize especially if your system is already under strain.
This new shell hack is a lot faster much more generic. This small snippet is used to dynamically set the title of the terminal window in the following situation:
- if the terminal is at the prompt, set the title of the window to the name of the current directory
- if a program is running, set the title of the window to the name of the running program
The code is pretty straightforward. It uses prompt expansion and a magical escape sequence which is understood by the terminal.
case $TERM in
xterm*)
precmd () {print -Pn "\e]0;%1~\a"}
preexec () {print -n "\e]0;$1\a"}
;;
esac
This is for Zsh. See this page for how to do the same with Bash and other shells.
There are a lot of variants you can make in the format of the title. Check your shell manual for more information.
If you use Konsole or GNOME Terminal, make sure they are configured to actually use what the emulated terminal dumps. Konsole has an option to set the terminal name to what you want so I suppose the GNOME Terminal has a similar feature.
As usual, I’m not claiming I’ve invented this. I probably read this on a blog somewhere, but I don’t remember where. This is too bad for me because I missing on possible pingbacks. Kudos to whoever I’ve picked this from.
Zsh manual links
Good safeguards
In my last post I’ve shown that some people are annoyed at the fact that they can no longer erase their root directory simply by typing rm -rf /. I’m happy that this possibility is removed. I’m not scared that means Linux is being dumbed down. There are already some safeguards in Linux and nobody is complaining about them because they guard even seasoned users to do things that are dangerous or silly.
Proper safeguards
dpkg won’t remove itself
Erasing the primary package manager on your system prevents your from installing any other package. It is hard to argue that it is a good thing to let that happen without warnings.
fdgonthier@moka:~/ > sudo dpkg --purge dpkg dpkg: error processing dpkg (--purge): This is an essential package - it should not be removed. Errors were encountered while processing: dpkg
You can still erase dpkg if you want by using the --force-remove-essential option. I can actually think of reasons somebody might want to do that but this is a bad idea, and probably a mistake, most of the time its attempted. dpkg and apt protect essential and important packages on a Debian system by asking for obscure force options or confirmation, depending on what is attempted.
You can’t unmount /
fdgonthier@moka:~/ > sudo umount / umount: /: device is busy umount: /: device is busy
That is akin to removing the wheels of a running car. You can’t even force-unmount it.
You really shouldn’t fsck a drive in use
It is possible to do that, but when you call fsck.ext3 on a mounted partition, it will ask you with a rather serious prompt if you really want to proceed. fsck.ext3 has a force option but it has no effects on this prompt. This speaks volume about how much doing this is discouraged.
In good Unix fashion it is still possible to do it if you really want to but the developer of fsck.ext3 has made clear in the man page that you don’t want to do that.
Some kernel modules can’t be unloaded
modprobe has a force option (-f) too. It can be used to unload reluctant modules. It is clearly documented in modprobe manual page that removing by force may crash your system. I’ve used it a few times, it worked a few times, it crashed a few times, but most of the time it will not work if the module is important.
Why should it be possible to remove the module for the computer chipset while it is running? The answer is left to the imagination of the reader. I think its a good thing this kind of module won’t unload.
You can’t kill the init process
kill -9 1 will do nothing. This is actually hardcoded in the Linux kernel. The init process is the mother of all process in the system. Without it, you won’t be able to boot, or reboot, or use your virtual consoles. It is the reaper of zombies so if it dies, prepare for zombie invasion. There is really no reason to kill this process, ever.
You can’t format a mounted filesystem
fdgonthier@moka:~/ > sudo mkfs.ext3 /dev/sda1 mke2fs 1.41.5 (23-Apr-2009) /dev/sda1 is mounted; will not make a filesystem here!
mkfs.ext3 offers a way to force this but you have to use the force option (-F)twice.
Files in /dev are dynamically recreated
The health of your system is no longer tied to what is in the mysterious /dev directory. You can delete those files if you wan’t, and, depending what you erase, your currently running system may or may not be affected, but those problems will not survive a reboot or the invocation of /etc/init.d/udev restart.
GUI environment won’t let you in the dark
This is something common now. If for some reason, you change your resolution to something your monitor can’t support and your screen goes blank, desktop environment will automatically switch to your last used resolution. This is a safety mechanism preventing desktop users to set their screen to a resolution that leaves them without graphic display. Any resolution can still be configured statically into the system-wide xorg.conf if necessary.
Conclusion
All the safeguards and behaviors I’ve described above go against the Do What I Mean (DWIM) philosophy of Unix, and the something against the semantic of some option of the command: the kernel won’t let you unload your chipset module because it won’t work without it, mkfs.ext3 won’t let your format a partition that is in use because it’s certainly not what you want to do, dpkg won’t let your remove itself because there is a chance you won’t be able to reinstall it after it was removed.
If you think doing anything of what I’ve named above would be totaly stupid anyway, then you are right. Good safeguards aren’t there to nag you, and won’t ask you to double check everything you do. They simply prevent you from doing things that are possibly catastrophically detrimental to your system. Stop thinking rm -rf / should work because the Unix pilosophy about DYIM, because some command you can type have might no meaning at all.
Then a few things surprised me…
While testing potentially destructive commands in my test virtual machine, I’ve found I was able to do things I think I shouldn’t have. There might be some reason those things are possible. If you know why, please comment.
deluser: delete the root user
You can run deluser root as root without problems. This is of no consequences to the system because the root user is always the user with UID 0, but I think many scripts would be broken by that.
mkfs.ext3: tries to formats a directory
I don’t think a directory can hold a ext3 filesystem, yet mkfs.ext3 /etc will still try to proceed, and fail, after showing a warning telling that will probably won’t work.
fdgonthier@moka:~/ > sudo mkfs.ext3 /etc
[sudo] password for fdgonthier:
mke2fs 1.41.5 (23-Apr-2009)
/etc is not a block special device.
Proceed anyway? (y,n) y
mkfs.ext3: Device size reported to be zero. Invalid partition specified, or
partition table wasn't reread after running fdisk, due to
a modified partition being busy and in use. You may need to reboot
to re-read your partition table.
Should it even bother to try?
fdisk: delete an active, mounted partition
fsck.ext3 detects that if targeted partition is mounted. I don’t see why fdisk couldn’t do that. I think there is a good chance that deleting a mounted partition is a mistake and there is not even a warning before proceeding.
unmount /proc and /sys
Those pseudofilesystem have become necessary to a lot of program. It’s a bit weird that you can just unmount them without warnings.
More silly things…
cat /dev/urandom > /dev/mem will very quickly crashes your system. There are multiple variant to that, which are all as efficient as rm -rf / at causing harm to a Linux system.
Those silly commands are unlikely to outside forum of Linux users that love to abuse n00bs, so safeguarding against them is of little importance. Still, why should a superuser shell should have such a raw access to disk devices? Is it necessary? Is there a way to mitigate that?
If you like that post, please subscribe to my
RSS feed. More readers would motivate me to keep writing at least once a week.
