Skip to content

Some kind of permission issue on Windows on subprocess.check_call #110

@put

Description

@put

My question in a StackOverflow post, I'm just gonna paste it here:

I'm trying to edit the frida-ios-dump project to actually work for on my PC and I'm currently running into a weird issue that I think has to do with permissions somehow.

chmod_dir = os.path.join(PAYLOAD_PATH, os.path.basename(dump_path))
chmod_args = ('chmod', '655', chmod_dir)
try:
    subprocess.check_call(chmod_args)
except subprocess.CalledProcessError as err:
    print(err)

This piece of code here throws this error: FileNotFoundError: [WinError 2] The system cannot find the file specified but I had a good feeling that that file DID in fact exist, so I added the following except:

except FileNotFoundError:
    print(chmod_dir)
    print("FileNotFound, yet path exists: " + str(os.path.exists(chmod_dir)))

And as suspected, the file DOES exist! My code prints FileNotFound, yet path exists: True
and since I also printed the path, we can see that here: C:\Users\Admin\AppData\Local\Temp\Payload\protobuf.fid and upon manually visiting that folder, I confirmed that the file does indeed exist there.

I have a strong feeling that this is some permission problem, but I'm not sure what I could do to fix it.

Note: The Python script is ran from Windows PowerShell which in turn was opened with administrator privileges.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions