1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-09 08:58:35 +03:00

Ensure dev in make_connection is const.

Jeremy.
(This used to be commit e8155fade61e9dc308a82f442453803160c36806)
This commit is contained in:
Jeremy Allison 2003-03-18 23:51:18 +00:00
parent 0331877348
commit 736c753841
2 changed files with 10 additions and 4 deletions

View File

@ -1869,7 +1869,7 @@ WERROR _srv_net_file_query_secdesc(pipes_struct *p, SRV_Q_NET_FILE_QUERY_SECDESC
r_u->status = WERR_ACCESS_DENIED; r_u->status = WERR_ACCESS_DENIED;
goto error_exit; goto error_exit;
} }
became_user = True; became_user = True;
unistr2_to_ascii(filename, &q_u->uni_file_name, sizeof(filename)); unistr2_to_ascii(filename, &q_u->uni_file_name, sizeof(filename));
unix_convert(filename, conn, NULL, &bad_path, &st); unix_convert(filename, conn, NULL, &bad_path, &st);

View File

@ -326,14 +326,17 @@ static void set_admin_user(connection_struct *conn, gid_t *groups, size_t n_grou
static connection_struct *make_connection_snum(int snum, user_struct *vuser, static connection_struct *make_connection_snum(int snum, user_struct *vuser,
DATA_BLOB password, DATA_BLOB password,
fstring dev, NTSTATUS *status) const char *pdev, NTSTATUS *status)
{ {
struct passwd *pass = NULL; struct passwd *pass = NULL;
BOOL guest = False; BOOL guest = False;
connection_struct *conn; connection_struct *conn;
struct stat st; struct stat st;
fstring user; fstring user;
fstring dev;
*user = 0; *user = 0;
fstrcpy(dev, pdev);
if (NT_STATUS_IS_ERR(*status = share_sanity_checks(snum, dev))) { if (NT_STATUS_IS_ERR(*status = share_sanity_checks(snum, dev))) {
return NULL; return NULL;
@ -717,7 +720,7 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser,
**************************************************************************************/ **************************************************************************************/
connection_struct *make_connection_with_chdir(const char *service_in, DATA_BLOB password, connection_struct *make_connection_with_chdir(const char *service_in, DATA_BLOB password,
char *dev, uint16 vuid, NTSTATUS *status) const char *dev, uint16 vuid, NTSTATUS *status)
{ {
connection_struct *conn = NULL; connection_struct *conn = NULL;
@ -747,13 +750,16 @@ connection_struct *make_connection_with_chdir(const char *service_in, DATA_BLOB
****************************************************************************/ ****************************************************************************/
connection_struct *make_connection(const char *service_in, DATA_BLOB password, connection_struct *make_connection(const char *service_in, DATA_BLOB password,
fstring dev, uint16 vuid, NTSTATUS *status) const char *pdev, uint16 vuid, NTSTATUS *status)
{ {
uid_t euid; uid_t euid;
user_struct *vuser = NULL; user_struct *vuser = NULL;
fstring service; fstring service;
fstring dev;
int snum = -1; int snum = -1;
fstrcpy(dev, pdev);
/* This must ONLY BE CALLED AS ROOT. As it exits this function as root. */ /* This must ONLY BE CALLED AS ROOT. As it exits this function as root. */
if (!non_root_mode() && (euid = geteuid()) != 0) { if (!non_root_mode() && (euid = geteuid()) != 0) {
DEBUG(0,("make_connection: PANIC ERROR. Called as nonroot (%u)\n", (unsigned int)euid )); DEBUG(0,("make_connection: PANIC ERROR. Called as nonroot (%u)\n", (unsigned int)euid ));