summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-02-21 10:25:52 +0100
committerAndrew Bartlett <abartlet@samba.org>2011-02-22 16:20:10 +1100
commit2e69e894566d32001120d76d7ba58cdacb56d279 (patch)
tree2ac3ab5945d6bc9ed9ac4757c05dd8a72057e1ec /source3/printing
parent985c7da604ac30e67ee4b5a829935074900d6f26 (diff)
downloadsamba-2e69e894566d32001120d76d7ba58cdacb56d279.tar.gz
samba-2e69e894566d32001120d76d7ba58cdacb56d279.tar.bz2
samba-2e69e894566d32001120d76d7ba58cdacb56d279.zip
s3-auth Rename auth_serversupplied_info varaiables: server_info -> session_info
These variables, of type struct auth_serversupplied_info were poorly named when added into 2001, and in good consistant practice, this has extended all over the codebase in the years since. The structure is also not ideal for it's current purpose. Originally intended to convey the results of the authentication modules, it really describes all the essential attributes of a session. This rename will reduce the volume of a future patch to replaced these with a struct auth_session_info, with auth_serversupplied_info confined to the lower levels of the auth subsystem, and then eliminated. (The new structure will be the output of create_local_token(), and the change in struct definition will ensure that this is always run, populating local groups and privileges). Andrew Bartlett Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/nt_printing.c48
-rw-r--r--source3/printing/nt_printing_ads.c32
-rw-r--r--source3/printing/nt_printing_migrate.c8
-rw-r--r--source3/printing/printspoolss.c6
4 files changed, 47 insertions, 47 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 67c2d8732c..68b53c747c 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -618,7 +618,7 @@ static uint32 get_correct_cversion(struct pipes_struct *p,
nt_status = create_conn_struct(talloc_tos(), &conn, printdollar_snum,
lp_pathname(printdollar_snum),
- p->server_info, &oldcwd);
+ p->session_info, &oldcwd);
if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(0,("get_correct_cversion: create_conn_struct "
"returned %s\n", nt_errstr(nt_status)));
@@ -989,7 +989,7 @@ WERROR move_driver_to_download_area(struct pipes_struct *p,
nt_status = create_conn_struct(talloc_tos(), &conn, printdollar_snum,
lp_pathname(printdollar_snum),
- p->server_info, &oldcwd);
+ p->session_info, &oldcwd);
if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(0,("move_driver_to_download_area: create_conn_struct "
"returned %s\n", nt_errstr(nt_status)));
@@ -1564,7 +1564,7 @@ bool driver_info_ctr_to_info8(struct spoolss_AddDriverInfoCtr *r,
****************************************************************************/
bool printer_driver_in_use(TALLOC_CTX *mem_ctx,
- const struct auth_serversupplied_info *server_info,
+ const struct auth_serversupplied_info *session_info,
struct messaging_context *msg_ctx,
const struct spoolss_DriverInfo8 *r)
{
@@ -1587,7 +1587,7 @@ bool printer_driver_in_use(TALLOC_CTX *mem_ctx,
continue;
}
- result = winreg_get_printer(mem_ctx, server_info, msg_ctx,
+ result = winreg_get_printer(mem_ctx, session_info, msg_ctx,
lp_servicename(snum),
&pinfo2);
if (!W_ERROR_IS_OK(result)) {
@@ -1613,18 +1613,18 @@ bool printer_driver_in_use(TALLOC_CTX *mem_ctx,
"Windows NT x86" version 2 or 3 left */
if (!strequal("Windows NT x86", r->architecture)) {
- werr = winreg_get_driver(mem_ctx, server_info, msg_ctx,
+ werr = winreg_get_driver(mem_ctx, session_info, msg_ctx,
"Windows NT x86",
r->driver_name,
DRIVER_ANY_VERSION,
&driver);
} else if (r->version == 2) {
- werr = winreg_get_driver(mem_ctx, server_info, msg_ctx,
+ werr = winreg_get_driver(mem_ctx, session_info, msg_ctx,
"Windows NT x86",
r->driver_name,
3, &driver);
} else if (r->version == 3) {
- werr = winreg_get_driver(mem_ctx, server_info, msg_ctx,
+ werr = winreg_get_driver(mem_ctx, session_info, msg_ctx,
"Windows NT x86",
r->driver_name,
2, &driver);
@@ -1792,7 +1792,7 @@ static bool trim_overlap_drv_files(TALLOC_CTX *mem_ctx,
****************************************************************************/
bool printer_driver_files_in_use(TALLOC_CTX *mem_ctx,
- const struct auth_serversupplied_info *server_info,
+ const struct auth_serversupplied_info *session_info,
struct messaging_context *msg_ctx,
struct spoolss_DriverInfo8 *info)
{
@@ -1815,7 +1815,7 @@ bool printer_driver_files_in_use(TALLOC_CTX *mem_ctx,
/* get the list of drivers */
- result = winreg_get_driver_list(mem_ctx, server_info, msg_ctx,
+ result = winreg_get_driver_list(mem_ctx, session_info, msg_ctx,
info->architecture, version,
&num_drivers, &drivers);
if (!W_ERROR_IS_OK(result)) {
@@ -1832,7 +1832,7 @@ bool printer_driver_files_in_use(TALLOC_CTX *mem_ctx,
driver = NULL;
- result = winreg_get_driver(mem_ctx, server_info, msg_ctx,
+ result = winreg_get_driver(mem_ctx, session_info, msg_ctx,
info->architecture, drivers[i],
version, &driver);
if (!W_ERROR_IS_OK(result)) {
@@ -1886,7 +1886,7 @@ static NTSTATUS driver_unlink_internals(connection_struct *conn,
this.
****************************************************************************/
-bool delete_driver_files(const struct auth_serversupplied_info *server_info,
+bool delete_driver_files(const struct auth_serversupplied_info *session_info,
const struct spoolss_DriverInfo8 *r)
{
int i = 0;
@@ -1916,7 +1916,7 @@ bool delete_driver_files(const struct auth_serversupplied_info *server_info,
nt_status = create_conn_struct(talloc_tos(), &conn, printdollar_snum,
lp_pathname(printdollar_snum),
- server_info, &oldcwd);
+ session_info, &oldcwd);
if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(0,("delete_driver_files: create_conn_struct "
"returned %s\n", nt_errstr(nt_status)));
@@ -2076,7 +2076,7 @@ void map_job_permissions(struct security_descriptor *sd)
3) "printer admins" (may result in numerous calls to winbind)
****************************************************************************/
-bool print_access_check(const struct auth_serversupplied_info *server_info,
+bool print_access_check(const struct auth_serversupplied_info *session_info,
struct messaging_context *msg_ctx, int snum,
int access_type)
{
@@ -2092,8 +2092,8 @@ bool print_access_check(const struct auth_serversupplied_info *server_info,
/* Always allow root or SE_PRINT_OPERATROR to do anything */
- if (server_info->utok.uid == sec_initial_uid()
- || security_token_has_privilege(server_info->security_token, SEC_PRIV_PRINT_OPERATOR)) {
+ if (session_info->utok.uid == sec_initial_uid()
+ || security_token_has_privilege(session_info->security_token, SEC_PRIV_PRINT_OPERATOR)) {
return True;
}
@@ -2114,7 +2114,7 @@ bool print_access_check(const struct auth_serversupplied_info *server_info,
}
result = winreg_get_printer_secdesc(mem_ctx,
- get_server_info_system(),
+ get_session_info_system(),
msg_ctx,
pname,
&secdesc);
@@ -2149,7 +2149,7 @@ bool print_access_check(const struct auth_serversupplied_info *server_info,
}
/* Check access */
- status = se_access_check(secdesc, server_info->security_token, access_type,
+ status = se_access_check(secdesc, session_info->security_token, access_type,
&access_granted);
DEBUG(4, ("access check was %s\n", NT_STATUS_IS_OK(status) ? "SUCCESS" : "FAILURE"));
@@ -2157,9 +2157,9 @@ bool print_access_check(const struct auth_serversupplied_info *server_info,
/* see if we need to try the printer admin list */
if (!NT_STATUS_IS_OK(status) &&
- (token_contains_name_in_list(uidtoname(server_info->utok.uid),
- server_info->info3->base.domain.string,
- NULL, server_info->security_token,
+ (token_contains_name_in_list(uidtoname(session_info->utok.uid),
+ session_info->info3->base.domain.string,
+ NULL, session_info->security_token,
lp_printer_admin(snum)))) {
talloc_destroy(mem_ctx);
return True;
@@ -2178,7 +2178,7 @@ bool print_access_check(const struct auth_serversupplied_info *server_info,
Check the time parameters allow a print operation.
*****************************************************************************/
-bool print_time_access_check(const struct auth_serversupplied_info *server_info,
+bool print_time_access_check(const struct auth_serversupplied_info *session_info,
struct messaging_context *msg_ctx,
const char *servicename)
{
@@ -2189,7 +2189,7 @@ bool print_time_access_check(const struct auth_serversupplied_info *server_info,
struct tm *t;
uint32 mins;
- result = winreg_get_printer(NULL, server_info, msg_ctx,
+ result = winreg_get_printer(NULL, session_info, msg_ctx,
servicename, &pinfo2);
if (!W_ERROR_IS_OK(result)) {
return False;
@@ -2216,13 +2216,13 @@ bool print_time_access_check(const struct auth_serversupplied_info *server_info,
}
void nt_printer_remove(TALLOC_CTX *mem_ctx,
- const struct auth_serversupplied_info *server_info,
+ const struct auth_serversupplied_info *session_info,
struct messaging_context *msg_ctx,
const char *printer)
{
WERROR result;
- result = winreg_delete_printer_key(mem_ctx, server_info, msg_ctx,
+ result = winreg_delete_printer_key(mem_ctx, session_info, msg_ctx,
printer, "");
if (!W_ERROR_IS_OK(result)) {
DEBUG(0, ("nt_printer_remove: failed to remove rpinter %s",
diff --git a/source3/printing/nt_printing_ads.c b/source3/printing/nt_printing_ads.c
index b375d94c2b..70057ffad3 100644
--- a/source3/printing/nt_printing_ads.c
+++ b/source3/printing/nt_printing_ads.c
@@ -35,7 +35,7 @@ static void store_printer_guid(struct messaging_context *msg_ctx,
const char *printer, struct GUID guid)
{
TALLOC_CTX *tmp_ctx;
- struct auth_serversupplied_info *server_info = NULL;
+ struct auth_serversupplied_info *session_info = NULL;
const char *guid_str;
DATA_BLOB blob;
NTSTATUS status;
@@ -47,10 +47,10 @@ static void store_printer_guid(struct messaging_context *msg_ctx,
return;
}
- status = make_server_info_system(tmp_ctx, &server_info);
+ status = make_session_info_system(tmp_ctx, &session_info);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("store_printer_guid: "
- "Could not create system server_info\n"));
+ "Could not create system session_info\n"));
goto done;
}
@@ -70,7 +70,7 @@ static void store_printer_guid(struct messaging_context *msg_ctx,
goto done;
}
- result = winreg_set_printer_dataex(tmp_ctx, server_info, msg_ctx,
+ result = winreg_set_printer_dataex(tmp_ctx, session_info, msg_ctx,
printer,
SPOOL_DSSPOOLER_KEY, "objectGUID",
REG_SZ, blob.data, blob.length);
@@ -233,14 +233,14 @@ static WERROR nt_printer_unpublish_ads(ADS_STRUCT *ads,
* Publish a printer in the directory
*
* @param mem_ctx memory context
- * @param server_info server_info to access winreg pipe
+ * @param session_info session_info to access winreg pipe
* @param pinfo2 printer information
* @param action publish/unpublish action
* @return WERROR indicating status of publishing
***************************************************************************/
WERROR nt_printer_publish(TALLOC_CTX *mem_ctx,
- const struct auth_serversupplied_info *server_info,
+ const struct auth_serversupplied_info *session_info,
struct messaging_context *msg_ctx,
struct spoolss_PrinterInfo2 *pinfo2,
int action)
@@ -271,7 +271,7 @@ WERROR nt_printer_publish(TALLOC_CTX *mem_ctx,
sinfo2->attributes = pinfo2->attributes;
- win_rc = winreg_update_printer(mem_ctx, server_info, msg_ctx,
+ win_rc = winreg_update_printer(mem_ctx, session_info, msg_ctx,
pinfo2->sharename, info2_mask,
sinfo2, NULL, NULL);
if (!W_ERROR_IS_OK(win_rc)) {
@@ -322,7 +322,7 @@ WERROR check_published_printers(struct messaging_context *msg_ctx)
int snum;
int n_services = lp_numservices();
TALLOC_CTX *tmp_ctx = NULL;
- struct auth_serversupplied_info *server_info = NULL;
+ struct auth_serversupplied_info *session_info = NULL;
struct spoolss_PrinterInfo2 *pinfo2;
NTSTATUS status;
WERROR result;
@@ -348,10 +348,10 @@ WERROR check_published_printers(struct messaging_context *msg_ctx)
goto done;
}
- status = make_server_info_system(tmp_ctx, &server_info);
+ status = make_session_info_system(tmp_ctx, &session_info);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("check_published_printers: "
- "Could not create system server_info\n"));
+ "Could not create system session_info\n"));
result = WERR_ACCESS_DENIED;
goto done;
}
@@ -361,7 +361,7 @@ WERROR check_published_printers(struct messaging_context *msg_ctx)
continue;
}
- result = winreg_get_printer(tmp_ctx, server_info, msg_ctx,
+ result = winreg_get_printer(tmp_ctx, session_info, msg_ctx,
lp_servicename(snum),
&pinfo2);
if (!W_ERROR_IS_OK(result)) {
@@ -384,7 +384,7 @@ done:
}
bool is_printer_published(TALLOC_CTX *mem_ctx,
- const struct auth_serversupplied_info *server_info,
+ const struct auth_serversupplied_info *session_info,
struct messaging_context *msg_ctx,
const char *servername, char *printer, struct GUID *guid,
struct spoolss_PrinterInfo2 **info2)
@@ -396,7 +396,7 @@ bool is_printer_published(TALLOC_CTX *mem_ctx,
WERROR result;
NTSTATUS status;
- result = winreg_get_printer(mem_ctx, server_info, msg_ctx,
+ result = winreg_get_printer(mem_ctx, session_info, msg_ctx,
printer, &pinfo2);
if (!W_ERROR_IS_OK(result)) {
return false;
@@ -413,7 +413,7 @@ bool is_printer_published(TALLOC_CTX *mem_ctx,
/* fetching printer guids really ought to be a separate function. */
- result = winreg_get_printer_dataex(mem_ctx, server_info, msg_ctx,
+ result = winreg_get_printer_dataex(mem_ctx, session_info, msg_ctx,
printer,
SPOOL_DSSPOOLER_KEY, "objectGUID",
&type, &data, &data_size);
@@ -456,7 +456,7 @@ done:
}
#else
WERROR nt_printer_publish(TALLOC_CTX *mem_ctx,
- const struct auth_serversupplied_info *server_info,
+ const struct auth_serversupplied_info *session_info,
struct messaging_context *msg_ctx,
struct spoolss_PrinterInfo2 *pinfo2,
int action)
@@ -470,7 +470,7 @@ WERROR check_published_printers(struct messaging_context *msg_ctx)
}
bool is_printer_published(TALLOC_CTX *mem_ctx,
- const struct auth_serversupplied_info *server_info,
+ const struct auth_serversupplied_info *session_info,
struct messaging_context *msg_ctx,
const char *servername, char *printer, struct GUID *guid,
struct spoolss_PrinterInfo2 **info2)
diff --git a/source3/printing/nt_printing_migrate.c b/source3/printing/nt_printing_migrate.c
index 61fb9a602b..59fd04067b 100644
--- a/source3/printing/nt_printing_migrate.c
+++ b/source3/printing/nt_printing_migrate.c
@@ -631,7 +631,7 @@ bool nt_printing_tdb_migrate(struct messaging_context *msg_ctx)
bool drivers_exists = file_exist(drivers_path);
bool printers_exists = file_exist(printers_path);
bool forms_exists = file_exist(forms_path);
- struct auth_serversupplied_info *server_info;
+ struct auth_serversupplied_info *session_info;
struct rpc_pipe_client *spoolss_pipe = NULL;
TALLOC_CTX *tmp_ctx = talloc_stackframe();
NTSTATUS status;
@@ -640,9 +640,9 @@ bool nt_printing_tdb_migrate(struct messaging_context *msg_ctx)
return true;
}
- status = make_server_info_system(tmp_ctx, &server_info);
+ status = make_session_info_system(tmp_ctx, &session_info);
if (!NT_STATUS_IS_OK(status)) {
- DEBUG(0, ("Couldn't create server_info: %s\n",
+ DEBUG(0, ("Couldn't create session_info: %s\n",
nt_errstr(status)));
talloc_free(tmp_ctx);
return false;
@@ -650,7 +650,7 @@ bool nt_printing_tdb_migrate(struct messaging_context *msg_ctx)
status = rpc_pipe_open_internal(tmp_ctx,
&ndr_table_spoolss.syntax_id,
- server_info,
+ session_info,
NULL,
msg_ctx,
&spoolss_pipe);
diff --git a/source3/printing/printspoolss.c b/source3/printing/printspoolss.c
index 9b06ece307..d7ce9713f9 100644
--- a/source3/printing/printspoolss.c
+++ b/source3/printing/printspoolss.c
@@ -125,7 +125,7 @@ NTSTATUS print_spool_open(files_struct *fsp,
status = rpc_pipe_open_interface(fsp->conn,
&ndr_table_spoolss.syntax_id,
- fsp->conn->server_info,
+ fsp->conn->session_info,
&fsp->conn->sconn->client_id,
fsp->conn->sconn->msg_ctx,
&fsp->conn->spoolss_pipe);
@@ -278,7 +278,7 @@ void print_spool_end(files_struct *fsp, enum file_close_type close_type)
status = rpc_pipe_open_interface(fsp->conn,
&ndr_table_spoolss.syntax_id,
- fsp->conn->server_info,
+ fsp->conn->session_info,
&fsp->conn->sconn->client_id,
fsp->conn->sconn->msg_ctx,
&fsp->conn->spoolss_pipe);
@@ -321,7 +321,7 @@ void print_spool_terminate(struct connection_struct *conn,
status = rpc_pipe_open_interface(conn,
&ndr_table_spoolss.syntax_id,
- conn->server_info,
+ conn->session_info,
&conn->sconn->client_id,
conn->sconn->msg_ctx,
&conn->spoolss_pipe);