diff options
Diffstat (limited to 'source/smbd/service.c')
-rw-r--r-- | source/smbd/service.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/source/smbd/service.c b/source/smbd/service.c index 4d40d8dec1b..4a02967866b 100644 --- a/source/smbd/service.c +++ b/source/smbd/service.c @@ -486,7 +486,7 @@ connection_struct *make_connection(char *service,char *user,char *password, int { pstring s; pstrcpy(s,lp_pathname(snum)); - standard_sub_conn(conn,s); + standard_sub_conn(conn,s,sizeof(s)); string_set(&conn->connectpath,s); DEBUG(3,("Connect path is %s\n",s)); } @@ -498,19 +498,8 @@ connection_struct *make_connection(char *service,char *user,char *password, int /* Find all the groups this uid is in and store them. Used by change_to_user() */ initialise_groups(conn->user, conn->uid, conn->gid); - get_current_groups(&conn->ngroups,&conn->groups); + get_current_groups(conn->gid, &conn->ngroups,&conn->groups); -#ifdef HAVE_GETGROUPS_TOO_MANY_EGIDS - /* - * Some OSes, like FreeBSD return EGID as group 0 from getgroups - * and ignore group 0 on setgroups. - * get_current_groups returns group 0 as 0, which is wrong. - * We set it to gid here to prevent the token creation below - * from creating an incorrect token (SID for local group 0). - */ - if (conn->ngroups) conn->groups[0] = conn->gid; -#endif /* HAVE_GETGROUPS_TOO_MANY_EGIDS */ - /* check number of connections */ if (!claim_connection(conn, lp_servicename(SNUM(conn)), @@ -562,7 +551,7 @@ connection_struct *make_connection(char *service,char *user,char *password, int if (*lp_rootpreexec(SNUM(conn))) { pstring cmd; pstrcpy(cmd,lp_rootpreexec(SNUM(conn))); - standard_sub_conn(conn,cmd); + standard_sub_conn(conn,cmd,sizeof(cmd)); DEBUG(5,("cmd=%s\n",cmd)); ret = smbrun(cmd,NULL); if (ret != 0 && lp_rootpreexec_close(SNUM(conn))) { @@ -586,7 +575,7 @@ connection_struct *make_connection(char *service,char *user,char *password, int if (*lp_preexec(SNUM(conn))) { pstring cmd; pstrcpy(cmd,lp_preexec(SNUM(conn))); - standard_sub_conn(conn,cmd); + standard_sub_conn(conn,cmd,sizeof(cmd)); ret = smbrun(cmd,NULL); if (ret != 0 && lp_preexec_close(SNUM(conn))) { DEBUG(1,("preexec gave %d - failing connection\n", ret)); @@ -709,7 +698,7 @@ void close_cnum(connection_struct *conn, uint16 vuid) change_to_user(conn, vuid)) { pstring cmd; pstrcpy(cmd,lp_postexec(SNUM(conn))); - standard_sub_conn(conn,cmd); + standard_sub_conn(conn,cmd,sizeof(cmd)); smbrun(cmd,NULL); } @@ -718,7 +707,7 @@ void close_cnum(connection_struct *conn, uint16 vuid) if (*lp_rootpostexec(SNUM(conn))) { pstring cmd; pstrcpy(cmd,lp_rootpostexec(SNUM(conn))); - standard_sub_conn(conn,cmd); + standard_sub_conn(conn,cmd,sizeof(cmd)); smbrun(cmd,NULL); } |