From 6df844550e75f4b09103a74f75a1fdd0d934c51c Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Fri, 4 Feb 2011 17:05:20 +0100 Subject: [PATCH] Increase Windows backup/restore privileges possible fix to Virtual Disk ticket --- bacula/src/findlib/enable_priv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bacula/src/findlib/enable_priv.c b/bacula/src/findlib/enable_priv.c index 57fd5d993b..89b9b795da 100644 --- a/bacula/src/findlib/enable_priv.c +++ b/bacula/src/findlib/enable_priv.c @@ -84,7 +84,7 @@ enable_priv(JCR *jcr, HANDLE hToken, const char *name, int ignore_errors) /* Set the security privilege for this process. */ tkp.PrivilegeCount = 1; tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; - p_AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, NULL, NULL); + p_AdjustTokenPrivileges(hToken, FALSE, &tkp, sizeof(TOKEN_PRIVILEGES), NULL, NULL); lerror = GetLastError(); if (lerror != ERROR_SUCCESS) { if (!ignore_errors) { @@ -130,7 +130,6 @@ int enable_backup_privileges(JCR *jcr, int ignore_errors) if (enable_priv(jcr, hToken, SE_RESTORE_NAME, ignore_errors)) { stat |= 1<<2; } -#if 0 if (enable_priv(jcr, hToken, SE_SECURITY_NAME, ignore_errors)) { stat |= 1<<0; } @@ -155,7 +154,7 @@ int enable_backup_privileges(JCR *jcr, int ignore_errors) if (enable_priv(jcr, hToken, SE_CREATE_PERMANENT_NAME, ignore_errors)) { stat |= 1<<10; } -#endif + if (stat) { stat |= 1<<9; } -- 2.39.5