string_sub(p,"%P", connectpath, l);
break;
case 'S':
- string_sub(p,"%S", lp_servicename(snum), l);
+ if ( snum != -1 )
+ string_sub(p,"%S", lp_servicename(snum), l);
break;
case 'g':
string_sub(p,"%g", gidtoname(gid), l);
* "path =" string in [homes] and so needs the
* service name, not the username. */
case 'p':
- string_sub(p,"%p", automount_path(lp_servicename(snum)), l);
+ if ( snum != -1 )
+ string_sub(p,"%p", automount_path(lp_servicename(snum)), l);
break;
case '\0':
p++;
cached_uid = current_user.uid;
}
- standard_sub_advanced(snum, cached_user, "", -1,
+ standard_sub_advanced(snum, cached_user, "", current_user.gid,
smb_user_name, str, len);
}
uint32 len;
fstrcpy( temp_name, "\\\\%L" );
- standard_sub_basic( NULL, temp_name, sizeof(temp_name)-1 );
+ standard_sub_basic( "", temp_name, sizeof(temp_name)-1 );
len = rpcstr_push(temp, temp_name, sizeof(temp)-2, STR_TERMINATE);
return WERR_BADFID;
}
- if (!print_job_exists(snum, jobid)) {
+ if (!print_job_exists(lp_const_servicename(snum), jobid)) {
return WERR_INVALID_PRINTER_NAME;
}
* a failure condition
*/
- if ( !(nt_devmode=print_job_devmode( snum, jobid )) )
+ if ( !(nt_devmode=print_job_devmode( lp_const_servicename(snum), jobid )) )
devmode = construct_dev_mode(snum);
else {
if ((devmode = (DEVICEMODE *)malloc(sizeof(DEVICEMODE))) != NULL) {
/* the client expects localtime */
t -= TimeDiff(t);
- PACKI(desc,"W",pjobid_to_rap(snum,queue->job)); /* uJobId */
+ PACKI(desc,"W",pjobid_to_rap(lp_const_servicename(snum),queue->job)); /* uJobId */
if (uLevel == 1) {
PACKS(desc,"B21",queue->fs_user); /* szUserName */
PACKS(desc,"B",""); /* pad */
PACKS(desc, "z", driver.info_3->monitorname); /* language monitor */
fstrcpy(location, "\\\\%L\\print$\\WIN40\\0");
- standard_sub_basic( NULL, location, sizeof(location)-1 );
+ standard_sub_basic( "", location, sizeof(location)-1 );
PACKS(desc,"z", location); /* share to retrieve files */
PACKS(desc,"z", driver.info_3->defaultdatatype); /* default data type */
char *p = skip_string(str2,1);
uint32 jobid;
int snum;
+ fstring sharename;
int errcode;
extern struct current_user current_user;
WERROR werr = WERR_OK;
- if(!rap_to_pjobid(SVAL(p,0),&snum,&jobid))
+ if(!rap_to_pjobid(SVAL(p,0), sharename, &jobid))
return False;
/* check it's a supported varient */
*rparam = REALLOC(*rparam,*rparam_len);
*rdata_len = 0;
- if (!print_job_exists(snum, jobid)) {
+ if (!print_job_exists(sharename, jobid)) {
errcode = NERR_JobNotFound;
goto out;
}
char *p = skip_string(str2,1);
uint32 jobid;
int snum;
+ fstring sharename;
int uLevel = SVAL(p,2);
int function = SVAL(p,4);
int place, errcode;
- if(!rap_to_pjobid(SVAL(p,0),&snum,&jobid))
+ if(!rap_to_pjobid(SVAL(p,0), sharename, &jobid))
return False;
*rparam_len = 4;
*rparam = REALLOC(*rparam,*rparam_len);
(!check_printjob_info(&desc,uLevel,str2)))
return(False);
- if (!print_job_exists(snum, jobid)) {
+ if (!print_job_exists(sharename, jobid)) {
errcode=NERR_JobNotFound;
goto out;
}
int count;
int i;
int snum;
+ fstring sharename;
uint32 jobid;
struct pack_desc desc;
print_queue_struct *queue=NULL;
if (strcmp(str1,"WWrLh") != 0) return False;
if (!check_printjob_info(&desc,uLevel,str2)) return False;
- if(!rap_to_pjobid(SVAL(p,0),&snum,&jobid))
+ if(!rap_to_pjobid(SVAL(p,0), sharename, &jobid))
return False;
if (snum < 0 || !VALID_SNUM(snum)) return(False);