BOOL zero_ip(struct in_addr ip);
BOOL matchname(char *remotehost,struct in_addr addr);
void standard_sub_basic(char *str);
-void standard_sub(connection_struct *conn,char *str);
+void standard_sub_vuser(const user_struct *vuser, char *str);
+void standard_sub(connection_struct *conn, user_struct *vuser, char *str);
BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask);
struct hostent *Get_Hostbyname(const char *name);
BOOL process_exists(int pid);
char *lp_builtinname_map(void);
char *lp_builtinrid_file(void);
char *lp_ntusrname_map(void);
-char *lp_logon_script(void);
-char *lp_logon_path(void);
-char *lp_logon_drive(void);
-char *lp_logon_home(void);
char *lp_remote_announce(void);
char *lp_remote_browse_sync(void);
char *lp_wins_server(void);
int lp_stat_cache_size(void);
int lp_map_to_guest(void);
int lp_ldap_port(void);
+char *lp_logon_script(uint16 );
+char *lp_logon_path(uint16 );
+char *lp_logon_drive(uint16 );
+char *lp_logon_home(uint16 );
char *lp_preexec(int );
char *lp_postexec(int );
char *lp_rootpreexec(int );
/*The following definitions come from printing/printing.c */
void lpq_reset(int snum);
-void print_file(connection_struct *conn, int snum, files_struct *file);
-int get_printqueue(int snum, connection_struct *conn, print_queue_struct **queue,
+void print_file(connection_struct *conn, uint16 vuid,
+ int snum, files_struct *file);
+int get_printqueue(int snum, connection_struct *conn, uint16 vuid,
+ print_queue_struct **queue,
print_status_struct *status);
-void del_printqueue(connection_struct *conn,int snum,int jobid);
-void status_printjob(connection_struct *conn,int snum,int jobid,int status);
+void del_printqueue(connection_struct *conn,uint16 vuid,
+ int snum,int jobid);
+void status_printjob(connection_struct *conn,uint16 vuid,
+ int snum,int jobid,int status);
int printjob_encode(int snum, int job);
void printjob_decode(int jobid, int *snum, int *job);
-uint32 status_printqueue(connection_struct *conn,int snum,int status);
+uint32 status_printqueue(connection_struct *conn,uint16 vuid,
+ int snum,int status);
void load_printers(void);
/*The following definitions come from profile/profile.c */
extern int DEBUGLEVEL;
-extern pstring samlogon_user;
-extern BOOL sam_logon_in_ssb;
-
void *mysql_fill_sam_passwd( MYSQL_ROW *row )
{
static struct sam_passwd *user;
/* 'Researched' from sampass.c =) */
- pstrcpy(samlogon_user, user->unix_name);
-
- if (samlogon_user[strlen(samlogon_user)-1] == '$' &&
- user->group_rid != DOMAIN_GROUP_RID_USERS)
- {
- DEBUG(0,("trust account %s should be in DOMAIN_GROUP_RID_USERS\n", samlogon_user));
- }
-
- /* XXXX hack to get standard_sub_basic() to use sam logon username */
- /* possibly a better way would be to do a become_user() call */
-
- sam_logon_in_ssb = True;
-
- pstrcpy(logon_script , lp_logon_script ());
- pstrcpy(profile_path , lp_logon_path ());
- pstrcpy(home_drive , lp_logon_drive ());
- pstrcpy(home_dir , lp_logon_home ());
+ pstrcpy(logon_script , lp_logon_script (UID_FIELD_INVALID));
+ pstrcpy(profile_path , lp_logon_path (UID_FIELD_INVALID));
+ pstrcpy(home_drive , lp_logon_drive (UID_FIELD_INVALID));
+ pstrcpy(home_dir , lp_logon_home (UID_FIELD_INVALID));
pstrcpy(workstations , "");
- sam_logon_in_ssb = False;
-
user->full_name = full_name;
user->home_dir = home_dir;
user->dir_drive = home_drive;
#ifdef USE_SMBPASS_DB
extern int DEBUGLEVEL;
-extern pstring samlogon_user;
-extern BOOL sam_logon_in_ssb;
/***************************************************************
Start to enumerate the smbpasswd list. Returns a void pointer
* as putting the nt name in is a bit meaningless.
*/
- pstrcpy(samlogon_user, user->unix_name);
-
- if (samlogon_user[strlen(samlogon_user)-1] == '$' &&
- user->group_rid != DOMAIN_GROUP_RID_USERS)
- {
- DEBUG(0,("trust account %s should be in DOMAIN_GROUP_RID_USERS\n",
- samlogon_user));
- }
-
- /* XXXX hack to get standard_sub_basic() to use sam logon username */
- /* possibly a better way would be to do a become_user() call */
-
- sam_logon_in_ssb = True;
-
pstrcpy(full_name , "");
- pstrcpy(logon_script , lp_logon_script ());
- pstrcpy(profile_path , lp_logon_path ());
- pstrcpy(home_drive , lp_logon_drive ());
- pstrcpy(home_dir , lp_logon_home ());
+ pstrcpy(logon_script , lp_logon_script (UID_FIELD_INVALID));
+ pstrcpy(profile_path , lp_logon_path (UID_FIELD_INVALID));
+ pstrcpy(home_drive , lp_logon_drive (UID_FIELD_INVALID));
+ pstrcpy(home_dir , lp_logon_home (UID_FIELD_INVALID));
pstrcpy(acct_desc , "");
pstrcpy(workstations , "");
- sam_logon_in_ssb = False;
-
/*
only overwrite values with defaults IIF specific backend
didn't filled the values
static pstring acct_desc;
static pstring workstations;
- extern BOOL sam_logon_in_ssb;
- extern pstring samlogon_user;
-
if (user == NULL) return NULL;
pwdb_init_sam(&pw_buf);
DEBUG(5,("getsamfile21pwent\n"));
- /* XXXX hack to get standard_sub_basic() to use sam logon username */
- /* possibly a better way would be to do a become_user() call */
-
- sam_logon_in_ssb = True;
-
- pstrcpy(samlogon_user, pw_buf.unix_name);
-
- pstrcpy(logon_script , lp_logon_script ());
- pstrcpy(profile_path , lp_logon_path ());
- pstrcpy(home_drive , lp_logon_drive ());
- pstrcpy(home_dir , lp_logon_home ());
- pstrcpy(workstations , "");
-
- sam_logon_in_ssb = False;
-
if (pw_buf.home_dir == NULL)
pw_buf.home_dir = home_dir;
if (pw_buf.dir_drive == NULL)
/* NT uses smbclose to start a print - weird */
if (normal_close && fsp->print_file)
- print_file(conn, SNUM(conn), fsp);
+ print_file(conn, fsp->vuid, SNUM(conn), fsp);
/* check for magic scripts */
if (normal_close) {
int outsize = set_message(outbuf,2,3,True);
int max_count = SVAL(inbuf,smb_vwv0);
int start_index = SVAL(inbuf,smb_vwv1);
+ uint16 vuid = SVAL(inbuf,smb_uid);
/* we used to allow the client to get the cnum wrong, but that
is really quite gross and only worked when there was only
{
print_queue_struct *queue = NULL;
char *p = smb_buf(outbuf) + 3;
- int count = get_printqueue(SNUM(conn), conn,&queue,NULL);
+ int count = get_printqueue(SNUM(conn), conn, vuid, &queue,NULL);
int num_to_get = ABS(max_count);
int first = (max_count>0?start_index:start_index+max_count+1);
int i;
bzero(&status,sizeof(status));
- count=get_printqueue(snum, NULL, &q, &status);
+ count=get_printqueue(snum, NULL, UID_FIELD_INVALID, &q, &status);
data->notify_data.value[0]=(uint32) status.status;
if (q) free(q);
bzero(&status,sizeof(status));
- data->notify_data.value[0]=get_printqueue(snum, NULL, &q, &status);
+ data->notify_data.value[0]=get_printqueue(snum, NULL, UID_FIELD_INVALID, &q, &status);
if (q) free(q);
}
print_queue_struct *queue=NULL;
print_status_struct status;
bzero(&status, sizeof(status));
- count=get_printqueue(snum, NULL, &queue, &status);
+ count=get_printqueue(snum, NULL, UID_FIELD_INVALID, &queue, &status);
for (j=0; j<count; j++)
{
construct_notify_jobs_info(&(queue[j]), info, pnum, snum, i, queue[j].job);
return (False);
}
- count=get_printqueue(snum, NULL, &queue, &status);
+ count=get_printqueue(snum, NULL, UID_FIELD_INVALID, &queue, &status);
/* the description and the name are of the form \\server\share */
slprintf(chaine,sizeof(chaine)-1,"\\\\%s\\%s",servername, ntprinter.info_2->printername);
print_queue_struct *queue=NULL;
print_status_struct status;
bzero(&status, sizeof(status));
- count=get_printqueue(snum, NULL, &queue, &status);
+ count=get_printqueue(snum, NULL, UID_FIELD_INVALID, &queue, &status);
if (get_a_printer(&ntprinter, 2, lp_servicename(snum)) !=0 )
{
{
case PRINTER_CONTROL_PAUSE:
/* pause the printer here */
- return status_printqueue(NULL, snum, LPSTAT_STOPPED);
+ return status_printqueue(NULL, UID_FIELD_INVALID, snum, LPSTAT_STOPPED);
case PRINTER_CONTROL_RESUME:
case PRINTER_CONTROL_UNPAUSE:
/* UN-pause the printer here */
- return status_printqueue(NULL, snum, LPSTAT_OK);
+ return status_printqueue(NULL, UID_FIELD_INVALID, snum, LPSTAT_OK);
case PRINTER_CONTROL_PURGE:
/* Envoi des dragées FUCA dans l'imprimante */
break;
return NT_STATUS_INVALID_HANDLE;
}
- count = get_printqueue(snum, NULL, &queue, &prt_status);
+ count = get_printqueue(snum, NULL, UID_FIELD_INVALID, &queue, &prt_status);
(*numofjobs) = 0;
DEBUG(4,("count:[%d], status:[%d], [%s]\n",
return NT_STATUS_INVALID_HANDLE;
}
- count=get_printqueue(snum, NULL, &queue, &prt_status);
+ count=get_printqueue(snum, NULL, UID_FIELD_INVALID, &queue, &prt_status);
while ( (i<count) && found==False )
{
case JOB_CONTROL_CANCEL:
case JOB_CONTROL_DELETE:
{
- del_printqueue(NULL, snum, jobid);
+ del_printqueue(NULL, UID_FIELD_INVALID, snum, jobid);
safe_free(queue);
return NT_STATUS_NOPROBLEMO;
}
case JOB_CONTROL_PAUSE:
{
- status_printjob(NULL, snum, jobid, LPQ_PAUSED);
+ status_printjob(NULL, UID_FIELD_INVALID, snum, jobid, LPQ_PAUSED);
safe_free(queue);
return NT_STATUS_NOPROBLEMO;
}
case JOB_CONTROL_RESUME:
{
- status_printjob(NULL, snum, jobid, LPQ_QUEUED);
+ status_printjob(NULL, UID_FIELD_INVALID, snum, jobid, LPQ_QUEUED);
safe_free(queue);
return NT_STATUS_NOPROBLEMO;
}
{
return NT_STATUS_INVALID_HANDLE;
}
- count=get_printqueue(snum, NULL, &queue, &prt_status);
+ count=get_printqueue(snum, NULL, UID_FIELD_INVALID, &queue, &prt_status);
DEBUGADD(4,("count:[%d], prt_status:[%d], [%s]\n",
count, prt_status.status, prt_status.message));