惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
罗磊的独立博客
博客园 - 【当耐特】
M
MIT News - Artificial intelligence
月光博客
月光博客
博客园_首页
博客园 - 叶小钗
T
Tailwind CSS Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
I
InfoQ
量子位
小众软件
小众软件
爱范儿
爱范儿
The GitHub Blog
The GitHub Blog
IT之家
IT之家
Jina AI
Jina AI
阮一峰的网络日志
阮一峰的网络日志
G
Google Developers Blog
WordPress大学
WordPress大学
人人都是产品经理
人人都是产品经理
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
J
Java Code Geeks
云风的 BLOG
云风的 BLOG
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报

jdhao's digital space

Conversion between base64 and OpenCV or PIL Image 腾讯云对象存储博客图床开启 CDN 加速(不需要购买额外域名) Search and Replace in Multiple Files in Vim/Neovim Change Table Column Width in LaTeX Image or Table Side by Side in LaTeX LaTeX 并排显示图像或表格 Firenvim: Neovim inside Your Browser Content inside HTML tags missing in Latest Hugo? Creating Markdown Front Matter with Ultisnips Labelme JSON 标注格式转 voc XML 格式 Nifty Nvim Techniques That Make My Life Easier -- Series 6 macOS 下如何为视频制作字幕 Running Command Asynchronously inside Neovim Resolving Merge Conflict after Git Stash Pop Pylint: command not found? A Hands-on Experience with Neovim's Built-in LSP Support How to Convert PDF to Images with Imagemagick 互联网上常用缩略语集锦 File Backup in Neovim Converting PDF Pages to Images with Poppler Nifty Nvim Techniques That Make My Life Easier -- Series 5 Neovim Configuration for System-wide Use How to sort a list of tuple or list in Python -- lambda or itemgetter? Building A Vim Statusline from Scratch 人类第一颗原子弹爆炸始末 Distributed Training in PyTorch with Horovod Learning Expect Programming Essential Knowledge about SSH Nifty LaTeX Techniques -- Series 1 更改 Adsense 邮寄地址,重新寄送 PIN
Empty Entry in LD_LIBRARY_PATH May Lead to Security Issues
2021-07-03 · via jdhao's digital space

When I want to build glibc using the provided configure script (./configure --prefix=xxx), I saw the following error message:

configure: error: *** LD_LIBRARY_PATH shouldn’t contain the current directory when *** building glibc. Please change the environment variable *** and run configure again.

How could my LD_LIBRARY_PATH contains the current directory? Upon inspecting the env variable, I see a spurious :: inside the value of LD_LIBRARY_PATH, which means an empty item. An empty item is interpreted by ld as the current working directory. As a result, as a result, ld may load library from the current working directory, causing unintended effects, or even security vulnerability if an attacker puts some harmful library in the current directory.

The :: in my LD_LIBRARY_PATH is caused by the initial empty LD_LIBRARY_PATH. For example, if we use export LD_LIBRARY_PATH=/home/xxx/local/lib: $LD_LIBRARY_PATH while LD_LIBRARY_PATH is empty, it actually becomes /home/xxx/local/lib:.

To fix this issue, we need to check if the value of LD_LIBRARY_PATH is empty before using it:

if [-z $LD_LIBRARY_PATH]; then
  export LD_LIBRARY_PATH=/home/xxx/local/lib
else
  export LD_LIBRARY_PATH=/home/xxx/local/lib:$LD_LIBRARY_PATH
fi

References#