diff options
author | Jeremy Allison <jra@samba.org> | 2007-11-15 14:19:52 -0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2007-11-15 14:19:52 -0800 |
commit | 68be9a820059ee96dd26c527efd7c14e679d3f2c (patch) | |
tree | c3c853a01013fc7977ab02a31e673fe17b4135e6 /source3/rpc_server/srv_winreg_nt.c | |
parent | 8e1b0f81c27dc332560f19de27fb86ac96c59775 (diff) | |
download | samba-68be9a820059ee96dd26c527efd7c14e679d3f2c.tar.gz samba-68be9a820059ee96dd26c527efd7c14e679d3f2c.tar.bz2 samba-68be9a820059ee96dd26c527efd7c14e679d3f2c.zip |
More pstring removal. This one was tricky. I had to add
one horror (pstring_clean_name()) which will have to
remain until I've removed all pstrings from the client code.
Jeremy.
(This used to be commit 1ea3ac80146b83c2522b69e7747c823366a2b47d)
Diffstat (limited to 'source3/rpc_server/srv_winreg_nt.c')
-rw-r--r-- | source3/rpc_server/srv_winreg_nt.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/source3/rpc_server/srv_winreg_nt.c b/source3/rpc_server/srv_winreg_nt.c index ce34211420..4b268dda19 100644 --- a/source3/rpc_server/srv_winreg_nt.c +++ b/source3/rpc_server/srv_winreg_nt.c @@ -580,17 +580,16 @@ WERROR _winreg_AbortSystemShutdown(pipes_struct *p, struct winreg_AbortSystemShu if ( can_shutdown ) become_root(); - + ret = smbrun( abort_shutdown_script, NULL ); - + if ( can_shutdown ) unbecome_root(); - + /********** END SeRemoteShutdownPrivilege BLOCK **********/ DEBUG(3,("_reg_abort_shutdown: Running the command `%s' gave %d\n", abort_shutdown_script, ret)); - return (ret == 0) ? WERR_OK : WERR_ACCESS_DENIED; } @@ -605,19 +604,19 @@ static int validate_reg_filename( pstring fname ) int snum; pstring share_path; pstring unix_fname; - + /* convert to a unix path, stripping the C:\ along the way */ - - if ( !(p = valid_share_pathname( fname ) )) + + if ( !(p = valid_share_pathname(NULL, fname))) return -1; /* has to exist within a valid file share */ - + for ( snum=0; snum<num_services; snum++ ) { - + if ( !lp_snum_ok(snum) || lp_print_ok(snum) ) continue; - + pstrcpy( share_path, lp_pathname(snum) ); /* make sure we have a path (e.g. [homes] ) */ @@ -628,12 +627,14 @@ static int validate_reg_filename( pstring fname ) if ( strncmp( share_path, p, strlen( share_path )) == 0 ) break; } - + /* p and fname are overlapping memory so copy out and back in again */ - + pstrcpy( unix_fname, p ); pstrcpy( fname, unix_fname ); - + + TALLOC_FREE(p); + return (snum < num_services) ? snum : -1; } |