diff options
author | Volker Lendecke <vlendec@samba.org> | 2006-10-21 17:00:47 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:15:36 -0500 |
commit | 2a10d7686553a2c2377165b7f80269d2dcae8847 (patch) | |
tree | 57aeaaf00ce40449e9a603d05124ce22c6636d36 /source3/param/loadparm.c | |
parent | f916352de90f5f5cd1e33d7264895e9d7e2992b5 (diff) | |
download | samba-2a10d7686553a2c2377165b7f80269d2dcae8847.tar.gz samba-2a10d7686553a2c2377165b7f80269d2dcae8847.tar.bz2 samba-2a10d7686553a2c2377165b7f80269d2dcae8847.zip |
r19448: Convert delete_share_security to struct share_params plus some cleanups
(This used to be commit c73d0815a3a1f58b951caa62fac601a8f4630894)
Diffstat (limited to 'source3/param/loadparm.c')
-rw-r--r-- | source3/param/loadparm.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 0dff2e36c7..fe1dc8ec50 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -4879,7 +4879,7 @@ int load_usershare_shares(void) /* Remove from the share ACL db. */ DEBUG(10,("load_usershare_shares: Removing deleted usershare %s\n", lp_servicename(iService) )); - delete_share_security(iService); + delete_share_security(snum2params_static(iService)); free_service_byindex(iService); } } @@ -5113,7 +5113,7 @@ int lp_servicenumber(const char *pszServiceName) if (!usershare_exists(iService, &last_mod)) { /* Remove the share security tdb entry for it. */ - delete_share_security(iService); + delete_share_security(snum2params_static(iService)); /* Remove it from the array. */ free_service_byindex(iService); /* Doesn't exist anymore. */ @@ -5146,12 +5146,16 @@ struct share_params *get_share_params(TALLOC_CTX *mem_ctx, const char *sharename) { struct share_params *result; - fstring sname; + char *sname; int snum; - fstrcpy(sname, sharename); + if (!(sname = SMB_STRDUP(sharename))) { + return NULL; + } snum = find_service(sname); + SAFE_FREE(sname); + if (snum < 0) { return NULL; } @@ -5213,6 +5217,18 @@ struct share_params *next_printer(struct share_iterator *list) return result; } +/* + * This is a hack for a transition period until we transformed all code from + * service numbers to struct share_params. + */ + +struct share_params *snum2params_static(int snum) +{ + static struct share_params result; + result.service = snum; + return &result; +} + /******************************************************************* A useful volume label function. ********************************************************************/ |