pwman

Check-in [4a8cb3e9a0]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:WIP on tweaks: 98593a8 Extend the "don't overwrite fields if only carriage return is entered" to password field
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | trunk | refs/stash
Files: files | file ages | folders
SHA3-256: 4a8cb3e9a04c7fc84efb59a7e50873dc5ea2cab1cd4f5d152671ec320bc639d1
User & Date: base@atomicules.co.uk 2014-01-03 22:25:41
Context
2014-01-03
22:25
WIP on tweaks: 98593a8 Extend the "don't overwrite fields if only carriage return is entered" to password field Leaf check-in: 4a8cb3e9a0 user: base@atomicules.co.uk tags: trunk, refs/stash
22:25
index on tweaks: 98593a8 Extend the "don't overwrite fields if only carriage return is entered" to password field check-in: db8bd43770 user: base@atomicules.co.uk tags: trunk, refs/stash
2013-03-23
21:27
Extend the "don't overwrite fields if only carriage return is entered" to password field And also use malloc. What I'd done before wasn't doing what I thought. C newbie and all that. It must have picked up whatever `input` was initialised at, which must be one of STRING_SHORT, STRING_MEDIUM, etc. So it was just by luck it was working. It could have ended up truncating strings I guess? I'm in two minds about the benefit of dynamic allocation though. Since this is hardly a big memory hungry application I could probably just set `oldinput` to the largest possible string length and it'd be fine. check-in: 378769ec43 user: atomicules@lavabit.com tags: origin/tweaks, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/pwman.c.

27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
...
153
154
155
156
157
158
159

160

161
162
163
164
165
166
167
168
169
170
171
172

173
174
175
176
177
178
179
180
181
182
#include <fcntl.h>
#include <stdarg.h>

static void pwman_parse_command_line(int argc, char **argv);
static void pwman_show_usage();
static void pwman_show_version();
static void pwman_quit();


static int
pwman_check_lock_file()
{
	char fn[STRING_LONG];
	FILE *fp;
	
................................................................................

	ui_refresh_windows();
}

static void
pwman_quit()
{

	pwlist_write_file();

	pwlist_free_all();
	pwman_delete_lock_file();
	
	ui_end();
	options_write();
	
	exit(0);
}

int
main(int argc, char *argv[])
{

	pwman_init(argc, argv);

	ui_run();

	pwman_quit();
	return 0;
}

static void
pwman_parse_command_line(int argc, char **argv)







|







 







>
|
>












>


|







27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
...
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
#include <fcntl.h>
#include <stdarg.h>

static void pwman_parse_command_line(int argc, char **argv);
static void pwman_show_usage();
static void pwman_show_version();
static void pwman_quit();
int EXIT_STATUS;

static int
pwman_check_lock_file()
{
	char fn[STRING_LONG];
	FILE *fp;
	
................................................................................

	ui_refresh_windows();
}

static void
pwman_quit()
{
	if (EXIT_STATUS != 0) {
		pwlist_write_file();
	}
	pwlist_free_all();
	pwman_delete_lock_file();
	
	ui_end();
	options_write();
	
	exit(0);
}

int
main(int argc, char *argv[])
{
	int exit_status;
	pwman_init(argc, argv);

	EXIT_STATUS = ui_run();

	pwman_quit();
	return 0;
}

static void
pwman_parse_command_line(int argc, char **argv)

Changes to src/ui.c.

187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
...
208
209
210
211
212
213
214

215
216
217
218
219
220
221
	int load_worked = 0;
#ifdef DEBUG
	int debug_i = 0;
#endif
	char msg[80];

	time_base = time(NULL);

	while(1){
		can_resize = TRUE;
		if( should_resize ){
			ui_resize();
		}
		ch = getch();
		ui_statusline_clear();
................................................................................

			ui_statusline_msg("Passphrase has timed out and you must enter it again.");
			getch();
			
			load_worked = pwlist_read_file();
			if(load_worked != 0) {
				ui_statusline_msg("Error - unable to re-load the password file!");

				break;
			}

			time_base = time(NULL);
		}
		
		switch(ch){







|







 







>







187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
...
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
	int load_worked = 0;
#ifdef DEBUG
	int debug_i = 0;
#endif
	char msg[80];

	time_base = time(NULL);
	//return 1;
	while(1){
		can_resize = TRUE;
		if( should_resize ){
			ui_resize();
		}
		ch = getch();
		ui_statusline_clear();
................................................................................

			ui_statusline_msg("Passphrase has timed out and you must enter it again.");
			getch();
			
			load_worked = pwlist_read_file();
			if(load_worked != 0) {
				ui_statusline_msg("Error - unable to re-load the password file!");
				//return 0;
				break;
			}

			time_base = time(NULL);
		}
		
		switch(ch){