From: Kern Sibbald Date: Fri, 4 Feb 2011 16:05:20 +0000 (+0100) Subject: Increase Windows backup/restore privileges possible fix to Virtual Disk ticket X-Git-Tag: Release-7.0.0~1154 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6df844550e75f4b09103a74f75a1fdd0d934c51c;p=bacula%2Fbacula Increase Windows backup/restore privileges possible fix to Virtual Disk ticket --- 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; }