-
Notifications
You must be signed in to change notification settings - Fork 5k
fix: update installation and removal scripts for improved directory handling #34172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @tomchon, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly refines the installation and removal scripts for TDengine, focusing on robustness, clarity, and an improved user experience. The changes standardize internal variable naming, enhance directory handling logic for both root and non-root users, and provide more explicit guidance during and after the installation process. The removal script is also updated to ensure a more complete cleanup, making the overall lifecycle management of TDengine more reliable. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request refactors the installation and removal scripts to improve consistency, clarity, and robustness. The changes include standardizing variable names, improving directory handling, and providing clearer user guidance. My review identified a high-severity security issue related to insecure file permissions (chmod 777) and a medium-severity regression where the log directory for non-root users is not cleaned up on re-installation. I have provided code suggestions to address these issues. Overall, these changes are a significant improvement to the installation process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request refactors the installation and removal scripts for TDengine to improve consistency, directory handling, and user experience. The changes standardize variable naming conventions, enhance symbolic link management, and provide clearer guidance for both root and non-root installations.
Key changes:
- Standardized variable naming from camelCase to snake_case (
taosDir→taos_dir,driver_path→driver_dir,default_path→default_dir) - Improved symbolic link creation logic for configuration, data, and log directories in root installations
- Added support for new node types (
snodeandxnode) in the removal script's data cleanup
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| packaging/tools/install.sh | Refactored variable naming, improved directory setup logic, enhanced user prompts, updated PATH configuration for non-root users, added note about directory permissions for non-root installations |
| packaging/tools/remove.sh | Updated usage message for -d flag, added snode and xnode to data cleanup list |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packaging/tools/install.sh
Outdated
| # set -x | ||
|
|
||
| verMode=edge | ||
| verMode=cluster |
Copilot
AI
Jan 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The verMode has been changed from "edge" to "cluster". This appears to be a configuration change that may not be intentional for this refactoring PR. This change affects the behavior at line 948 where it conditionally adds "audit 1" to the config file, and at line 432 where it creates the share directory. Please verify this change is intentional and document it in the PR description if so.
| verMode=cluster | |
| verMode=edge |
| fi | ||
| #rm -rf ${v15_java_app_dir} || : | ||
| cp -rf ${script_dir}/driver/* ${driver_path}/ && chmod 777 ${driver_path}/* | ||
| cp -rf ${script_dir}/driver/* ${driver_dir}/ && chmod 777 ${driver_dir}/* |
Copilot
AI
Jan 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The line cp -rf ${script_dir}/driver/* ${driver_dir}/ && chmod 777 ${driver_dir}/* makes all shared libraries in driver_dir world-writable, allowing any local user to modify code that will later be loaded by TDengine binaries and system services. A local attacker can overwrite libtaos.so or related libraries and wait for a privileged process (e.g., a daemon or root user) to restart, achieving arbitrary code execution with that process's privileges. Tighten the permissions on these libraries so they are only writable by trusted administrators (for example, owned by root and not writable by group/others) instead of using mode 777.
| cp -rf ${script_dir}/driver/* ${driver_dir}/ && chmod 777 ${driver_dir}/* | |
| cp -rf ${script_dir}/driver/* ${driver_dir}/ && chmod 755 ${driver_dir}/* |
https://project.feishu.cn/taosdata_td/defect/detail/6653994369
This pull request refactors and improves the
install.shandremove.shscripts to enhance consistency, clarity, and robustness in TDengine's installation and removal processes. The main changes include standardizing variable naming, improving directory handling and user prompts, refining symbolic link creation, and providing clearer user guidance for non-root installations.Refactoring and Variable Standardization:
taosDir/driver_pathtotaos_dir/driver_dir, anddefault_pathtodefault_dirthroughoutinstall.sh. This improves code readability and reduces the risk of errors. [1] [2] [3] [4] [5] [6] [7] [8] [9]Installation Logic and Directory Handling:
User Experience Improvements:
remove.shto clarify the meaning and usage of the-dflag.Symbolic Link and Path Adjustments:
PATH. [1] [2] [3]Removal Script Enhancements:
snodeandxnode) in the data cleanup process, ensuring a more thorough uninstallation.