* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
+struct cli_state;
#include "includes.h"
#include "popt_common.h"
#include "../libcli/security/security.h"
-#include "../librpc/gen_ndr/ndr_security.h"
#include "passdb/machine_sid.h"
+#include "util_sd.h"
static TALLOC_CTX *ctx;
struct security_descriptor *old = NULL;
size_t sd_size = 0;
uint32 i, j;
- char *sd_str;
if (mode != SMB_ACL_SET && mode != SMB_SD_DELETE) {
if (!(old = get_share_security( mem_ctx, sharename, &sd_size )) ) {
/* should not happen */
return 0;
case SMB_ACL_VIEW:
- sd_str = ndr_print_struct_string(mem_ctx,
- (ndr_print_fn_t)ndr_print_security_descriptor,
- "", old);
- fprintf(stdout, "%s\n", sd_str);
- talloc_free(sd_str);
+ sec_desc_print(NULL, stdout, old, true);
return 0;
case SMB_ACL_DELETE:
for (i=0;sd->dacl && i<sd->dacl->num_aces;i++) {
}
if (!found) {
- sd_str = ndr_print_struct_string(mem_ctx,
- (ndr_print_fn_t)ndr_print_security_ace,
- "", &sd->dacl->aces[i]);
- printf("ACL for ACE: %s not found\n", sd_str);
- talloc_free(sd_str);
+ printf("ACL for ACE:");
+ print_ace(NULL, stdout, &sd->dacl->aces[i], true);
+ printf(" not found\n");
}
}
break;
LIBEVENTLOG''')
bld.SAMBA3_BINARY('sharesec',
- source='utils/sharesec.c',
+ source='utils/sharesec.c lib/util_sd.c',
deps='''
talloc
+ msrpc3
+ libcli_lsa3
popt_samba3''')
bld.SAMBA3_BINARY('pdbtest',