Skip to content

the parameter to open in kano-launch #252

@wweiradio

Description

@wweiradio
    for(int i=0;i<10;i++){
      int count=snprintf(my_contfile, STRING_SIZE,"%s/%d.%d",contdir,pid,i);
      int cf;
      if(count==0 || count==STRING_SIZE) {
	kano_log_error("kano-launcher: string too long making container file [%s]\n",contdir);
      }
      cf=open(my_contfile,S_IWUSR | S_IRUSR | S_IXUSR);
      if(cf){
	made_contfile=1;
	close(cf);
	break;
      }
    }

From kano-launcher.c Line 216-228

Looks like the line cf=open(my_contfile,S_IWUSR | S_IRUSR | S_IXUSR); has problem

  1. should the O_CREAT | O_EXCL be provided?
  2. should check if (cf > 0), instead of if(cf) ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions