#define DEBUG_TRACE_CLIENT 0
#define HACK_NO_REFUNDS 1
+#define PIDFILE "/var/run/dispsrv.pid"
+
// Statistics
#define MAX_CONNECTION_QUEUE 5
#define INPUT_BUFFER_SIZE 256
// write pidfile
{
- FILE *fp = fopen("/var/run/dispsrv.pid", "w");
+ FILE *fp = fopen(PIDFILE, "w");
if( fp ) {
fprintf(fp, "%i", getpid());
fclose(fp);
{
printf("\nClose(%i)\n", giServer_Socket);
close(giServer_Socket);
- unlink("/var/run/dispsrv.pid");
+ unlink(PIDFILE);
}
/**
sendf(Client->Socket, "404 User not found\n");
return ;
}
-
- // You can't be an internal account
+ // You can't be an internal account (unless you're an admin)
if( !(userFlags & USER_FLAG_ADMIN) )
{
eUserFlags = Bank_GetFlags(Client->EffectiveUID);
// Disabled accounts
if( userFlags & USER_FLAG_DISABLED ) {
- Client->UID = -1;
+ Client->EffectiveUID = -1;
sendf(Client->Socket, "403 Account disabled\n");
return ;
}
}
}
- if( Item->Price == 0 )
+ if( !gbNoCostMode && Item->Price == 0 )
status = "error";
// KNOWN HACK: Naming a slot 'dead' disables it
if( strcmp(Item->Name, "dead") == 0 )