[ 
https://issues.apache.org/jira/browse/HADOOP-4930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sreekanth Ramakrishnan updated HADOOP-4930:
-------------------------------------------

    Attachment: HADOOP-4930-4.patch

ASF Header to all files have been included.

A new enum which returns errors codes based on what is defined in enums.

Now executable accepts -l file name or -log=File name as input to logfile. Log 
file is opened in append mode with permissions of rwxrw-rw-. If no log file is 
provided then defaults to stderr. All print statement now points to the log 
file.

Removed redundant check in get_user_details.

Function signatures have been changed to accept job id, task id and tt_root 
directly instead of passing an array all of the arguments are derived from argv.

Malloc's reduced and wherever it is used an extra byte is allocated for '\0' 
and all strings forcibly terminated with '\0'.


Number of dynamic memory  allocation :
  get_configs - Allocating for configuration file name, contents of the file 
and configuration details which is right now dynamically re sized. free of 
contents and file name done in same function, whereas freeing up of 
configuration done in run_task_as_user and kill_user_task.
  get_pid_path - pid_path is malloced (freed in run_task_as_user, 
kill_user_task).
  get_task_script_path : task-script-path malloced but not freed, leaking this 
string.

All syscalls i.e like fopen, malloc are checked for return codes. Strtok and 
strncat are checked for successful completion. 
  
config parsing fails if the file is of not the right format, the executable 
fails, cleaning up all memory allocated with the same. Configuration file now 
supports a comment line by # in begining of line, but # in middle of a line is 
taken as the value of the line.

Sorting removed.

Number of numeric literals :
  get_configs : 1. for number of bytes to read into contents (const int within 
the method).
                2. for number of config items max_size (const int with in the 
function).
  
  
pid_file generated is now world readable and writable.

Check tt_root now uses strcmp instead of strncmp.

get_task_file_path is now allocating correct number of memory.

all print statements go to LOGFILE.

All cleaning up done before launching JVM except a string which is used for 
task_script_path.

hadoop_temp_dir contains a comma sperated list of tt_roots, I have used char * 
as storage, do u want me to change it to char **?

> Implement setuid executable for Linux to assist in launching tasks as job 
> owners
> --------------------------------------------------------------------------------
>
>                 Key: HADOOP-4930
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4930
>             Project: Hadoop Core
>          Issue Type: Sub-task
>          Components: mapred
>            Reporter: Hemanth Yamijala
>            Assignee: Sreekanth Ramakrishnan
>         Attachments: HADOOP-4930-1.patch, HADOOP-4930-2.patch, 
> HADOOP-4930-3.patch, HADOOP-4930-4.patch
>
>
> HADOOP-4490 tracks the design and implementation of launching tasks as job 
> owners. As per discussion there, the proposal is to implement a setuid 
> executable for Linux that would be launched by the tasktracker to run tasks 
> as the job owners. In this task we will track the implementation of the 
> setuid executable. HADOOP-4490 will be used to track changes in the 
> tasktracker.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to