Interesting Tip: Know how to create an infinite link in Linux ?

In this post, we will look something really interesting.

Do you know how to create an infinite link in linux ?

We can create an infinite loop and our path will increase like below.

 

I. Going deep infinite.

[user@ngelinux001 SLES15_x86_64]$ pwd
/grid/common/pkgs/pstack/latest/SLES15_x86_64/SLES15_x86_64

[user@ngelinux001 SLES15_x86_64]$ cd SLES15_x86_64
[user@ngelinux001 SLES15_x86_64]$ pwd
/grid/common/pkgs/pstack/latest/SLES15_x86_64/SLES15_x86_64/SLES15_x86_64

[user@ngelinux001 SLES15_x86_64]$ cd SLES15_x86_64
[user@ngelinux001 SLES15_x86_64]$ pwd
/grid/common/pkgs/pstack/latest/SLES15_x86_64/SLES15_x86_64/SLES15_x86_64/SLES15_x86_64

[user@ngelinux001 SLES15_x86_64]$ cd SLES15_x86_64
[user@ngelinux001 SLES15_x86_64]$ pwd
/grid/common/pkgs/pstack/latest/SLES15_x86_64/SLES15_x86_64/SLES15_x86_64/SLES15_x86_64/SLES15_x86_64
[user@ngelinux001 SLES15_x86_64]$

 

II. Why this is happening ?

[user@ngelinux001 SLES15_x86_64]$ pwd
/grid/common/pkgs/pstack/latest/SLES15_x86_64/

[user@ngelinux001 SLES15_x86_64]$ ls -ltr
total 8
drwxr-sr-x 3 matrix ngegrp 4096 Apr 1 2009 man
drwxr-sr-x 2 matrix ngegrp 4096 Apr 1 2009 bin
lrwxrwxrwx 1 matrix ngegrp 53 Sep 8 2021 SLES15_x86_64 -> /grid/common/pkgsData/pstack-v1.1/Linux/SLES15_x86_64
[user@ngelinux001 SLES15_x86_64]$

 

III. Impact
Such links can have major impact on your production system.

Suppose a backup job is running that traverse all paths and take rsync of files.

The job will goto infinite loop here and will keep running for years until killed.

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments