Skip to content

Commit

Permalink
add flag to allow creation of symbolic links when the process is not …
Browse files Browse the repository at this point in the history
…elevated (mhammond#1176)

* add flag to allow creation of symbolic links when the process is not elevated

* added documentation
  • Loading branch information
Ivan Muzzolini authored and mhammond committed Apr 25, 2018
1 parent 87d2a36 commit d0ba7b3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion win32/src/win32file.i
Original file line number Diff line number Diff line change
Expand Up @@ -3286,7 +3286,7 @@ static PyObject *py_CreateSymbolicLink(PyObject *self, PyObject *args, PyObject
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO|kO:CreateSymbolicLink", keywords,
&oblinkname, // @pyparm <o PyUnicode>|SymlinkFileName||Path of the symbolic link to be created
&obtargetname, // @pyparm <o PyUnicode>|TargetFileName||The name of file to which link will point
&flags, // @pyparm int|Flags|0|SYMBOLIC_LINK_FLAG_DIRECTORY is only defined flag
&flags, // @pyparm int|Flags|0|SYMBOLIC_LINK_FLAG_DIRECTORY and SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE are the only defined flags
&obtrans)) // @pyparm <o PyHANDLE>|Transaction|None|Handle to a transaction, as returned by <om win32transaction.CreateTransaction>
return NULL;
if (!PyWinObject_AsHANDLE(obtrans, &htrans))
Expand Down Expand Up @@ -6227,6 +6227,7 @@ PyCFunction pfnpy_OpenFileById=(PyCFunction)py_OpenFileById;

// Flags for CreateSymbolicLink/CreateSymbolicLinkTransacted
#define SYMBOLIC_LINK_FLAG_DIRECTORY 1
#define SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE 2

// FILE_INFO_BY_HANDLE_CLASS used with GetFileInformationByHandleEx
#define FileBasicInfo FileBasicInfo
Expand Down

0 comments on commit d0ba7b3

Please sign in to comment.