{"id":3299,"date":"2018-04-26T12:20:48","date_gmt":"2018-04-26T16:20:48","guid":{"rendered":"https:\/\/antipaucity.com\/?p=3299"},"modified":"2018-04-26T12:20:48","modified_gmt":"2018-04-26T16:20:48","slug":"dont-use-symlinks-unless-you-know-you-can","status":"publish","type":"post","link":"https:\/\/merikebi.warrenmyers.com\/?p=3299","title":{"rendered":"don&#8217;t use symlinks unless you *know* you can"},"content":{"rendered":"<p>I first ran into this on Solaris in the context of [then] <a href=\"https:\/\/antipaucity.com\/2012\/02\/27\/binding-your-mounts\/#.Wt9SSMgpDgo\">Opsware SAS<\/a> (then <a href=\"https:\/\/antipaucity.com\/?s=hpsa#.WuEAUsjLfgo\">HP SA<\/a>, now owned by Microfocus). Bind mounts might be OK &#8230; so unless the tarball has symlinks included, don&#8217;t use them &#8211; they get traversed differently than &#8220;real&#8221; directories.<\/p>\n<p>In short, when directory traversals are done, sometimes it looks at the permissions bits and if the first character is not a <code>d<\/code> (for a symlink, it&#8217;s always an <code>l<\/code>), many processes can fail.<\/p>\n<p>Symlinking <em>files<\/em> is [possibly] a different story: though permissions are usually wonky on symlinks (most often <code>lrwxrwxrwx<\/code> vs <code>-rw-r--r--<\/code>, for example), since you cannot traverse into a file (whereas you can into a directory), it&#8217;s <strong>generally<\/strong> ok<\/p>\n<p>Also &#8211; sometimes when directory listings are pulled, the symlink is fully-dereferenced, and something that <em>appears<\/em> to be in, say, <code>$SPLUNK_HOME\/etc\/deployment_apps<\/code> but is <em>reall<\/em>y in, say, <code>\/some\/other\/place<\/code>, there are some times when {{Splunk}} will decide <em>not<\/em> to deploy it, because it&#8217;s not where it &#8220;belongs&#8221;.<\/p>\n<p>Also &#8211; checksums can be computed on the <em>symlink<\/em> and not the actual file, in some (perhaps all) instances: so if, for example, you have the same <code>outputs.conf<\/code> in several apps by way of symlink, and you change it in one, the checksum for all the others may (and typically do) not get updated &#8230; so you can be left in an inconsistent state for your configs (because not all locations that should&#8217;ve received the updated <code>outputs.conf<\/code> have received it, since they&#8217;re symlinks and not a real file, and the checksum may not update on those particular apps).<\/p>\n<h4>Moral of the story?<\/h4>\n<p>Unless you really know what you&#8217;re doing, never use symlinks with {{Splunk}}.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I first ran into this on Solaris in the context of [then] Opsware SAS (then HP SA, now owned by Microfocus). Bind mounts might be OK &#8230; so unless the tarball has symlinks included, don&#8217;t use them &#8211; they get traversed differently than &#8220;real&#8221; directories. In short, when directory traversals are done, sometimes it looks &hellip;<br \/><a href=\"https:\/\/merikebi.warrenmyers.com\/?p=3299\" class=\"more-link pen_button pen_element_default pen_icon_arrow_double\">Continue reading <span class=\"screen-reader-text\">don&#8217;t use symlinks unless you *know* you can<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[41],"tags":[705,740],"keyring_services":[],"class_list":["post-3299","post","type-post","status-publish","format-standard","hentry","category-technical","tag-splunk","tag-symlink"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/3299","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3299"}],"version-history":[{"count":0,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/3299\/revisions"}],"wp:attachment":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3299"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3299"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3299"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fkeyring_services&post=3299"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}