[
https://issues.apache.org/jira/browse/HDFS-16561?focusedWorklogId=767676&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-767676
]
ASF GitHub Bot logged work on HDFS-16561:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 08/May/22 10:44
Start Date: 08/May/22 10:44
Worklog Time Spent: 10m
Work Description: rishabh1704 opened a new pull request, #4287:
URL: https://github.com/apache/hadoop/pull/4287
<!--
Thanks for sending a pull request!
1. If this is your first time, please read our contributor guidelines:
https://cwiki.apache.org/confluence/display/HADOOP/How+To+Contribute
2. Make sure your PR title starts with JIRA issue id, e.g.,
'HADOOP-17799. Your PR title ...'.
-->
### Description of PR
Solves the bug mentioned here :
https://issues.apache.org/jira/browse/HDFS-16561
### How was this patch tested?
gtests in c++
### For code changes:
- [x] Does the title or this PR starts with the corresponding JIRA issue id
(e.g. 'HADOOP-17799. Your PR title ...')?
- [ ] Object storage: have the integration tests been executed and the
endpoint declared according to the connector-specific documentation?
- [ ] If adding new dependencies to the code, are these dependencies
licensed in a way that is compatible for inclusion under [ASF
2.0](http://www.apache.org/legal/resolved.html#category-a)?
- [ ] If applicable, have you updated the `LICENSE`, `LICENSE-binary`,
`NOTICE-binary` files?
Issue Time Tracking
-------------------
Worklog Id: (was: 767676)
Remaining Estimate: 0h
Time Spent: 10m
> Handle error returned by strtol
> -------------------------------
>
> Key: HDFS-16561
> URL: https://issues.apache.org/jira/browse/HDFS-16561
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: libhdfs++
> Affects Versions: 3.4.0
> Reporter: Gautham Banasandra
> Assignee: Gautham Banasandra
> Priority: Major
> Time Spent: 10m
> Remaining Estimate: 0h
>
> *strtol* is used in
> [hdfs-chmod.cc|https://github.com/apache/hadoop/blob/6dddbd42edd57cc26279c678756386a47c040af5/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tools/hdfs-chmod/hdfs-chmod.cc#L144].
> The call to strtol could error out when an invalid input is provided. Need
> to handle the error given out by strtol.
> Tasks to do -
> 1. Detect the error returned by strtol. The [strtol documentation
> |https://en.cppreference.com/w/cpp/string/byte/strtol]explains how to do so.
> 2. Return false to the caller if the error is detected.
> 3. Extend
> [this|https://github.com/apache/hadoop/blob/6dddbd42edd57cc26279c678756386a47c040af5/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/tools/hdfs-chmod-mock.cc]
> unit test and add a case which exercises this by passing an invalid input.
> Please refer to this PR to get more context on how this unit test is written
> - https://github.com/apache/hadoop/pull/3588.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]