search for: f_name

Displaying 20 results from an estimated 42 matches for "f_name".

Did you mean: __name
2003 Dec 30
3
The dangers of static buffers in rsync code
I have been trying for quite a while now to understand why is the flist.c:f_name() function implemented using static buffers. Anyone care to comment? The immediate problem is that any call to f_name overrides the previous content (well, obvious). This, combined with the fact that several function calls are made with the result of f_name(file) results in problems handling hard...
2008 Sep 03
0
rsync-3.0.3 crashes with protection exception
...ashes everytime with a protection exception. rsync-2.6.9 was running fine! I can't figure out why exactly it crashes. I hope that someone on this list can give me a hint on that. This is the debug output (appeared when I tried to copy a local directory to another location): FDBX0302: calling f_name(f = 0x1EA94000, fbuf = ".s.-.~~q.s.-.~~..~~.") from function send_file_name FDBX0303: returning <no value> from f_name FDBX0302: calling f_name(f = 0x1EA93FC8, fbuf = "") from function send_file_name FDBX0303: returning <no value> from f_name FDBX0302: calling f_name...
2011 May 24
4
Rails hates my recursive function
...term.insert 3, ''-'' term.insert 6,''-'' end end def self.find_record(rec) if /^([A-Z]|[a-z]|\d|-){11}$/.match(rec) student=Student.where(:studentID=>rec).all elsif /^([A-Z\s]|[a-z\s])+$/.match(rec) split=rec.split '' '',2 f_name=split.first l_name=split.second student=Student.where(:fname=>f_name,:lname=>l_name).all else bar=insert_dashes(rec) find_record(bar) end end If I try to enter a string of the for "a12345678" I am greeted with the following error: SystemStackError (...
2011 Mar 10
2
Trying to test flash messaging with rspec
...to @user else @title = "Sign up" render ''new'' end end def show @user = User.find(params[:id]) @title = @user.userName end end [/code] And the view displays with: [code] <%= flash_helper %> The helper is: def flash_helper f_names = [:success] fl = '''' for name in f_names if flash[name] fl = fl + "<div class=\"notice\">#{flash[name]}</div>" end flash[name] = nil; end return fl.html_safe end [/code] Like I said the flash...
2003 Oct 01
1
PATCH: option to ignore case in filenames
...;basename) return 0; if (!(*f1)->basename) @@ -1144,8 +1151,8 @@ if (!(*f2)->basename) return 1; if ((*f1)->dirname == (*f2)->dirname) - return u_strcmp((*f1)->basename, (*f2)->basename); - return u_strcmp(f_name(*f1), f_name(*f2)); + return cf((*f1)->basename, (*f2)->basename); + return cf(f_name(*f1), f_name(*f2)); } ===== options.c 1.1 vs edited ===== --- 1.1/rsync/options.c Thu Feb 13 11:51:39 2003 +++ edited/options.c Tue Sep 30 18:16:47 2003 @@ -83,6 +83,7 @@ int ign...
2002 Feb 19
1
rsync bug in clean_flist() while removing duplicted names
...hange in future, i'd run into deep problems.. the next problem i run into while testing my fixes on my debian woody -where i compiled rsync 2.3.2 from the package pool with debuild- was, that the strlcat() function in lib/compat.c was used. from senfile.c strlcat() was called: strlcat(fname,f_name(file),MAXPATHLEN); but f_name(file) returned (char *) 0. now strlcat() did a strlen on a nullpointer, and was not very happy. now, everything works fine. but it may be worth to check if it's ok that this null-file that sendfile() has in his list exists. i'll append both fixes here. btw,...
2006 Jul 21
0
[Slightly OT] Need Query Help
I need to select 1 record from each client. This record has the charge with the most severe charge type (lowest charge_type_id). How do I go about this? I have been using a find_by_sql query out of the client.rb that looks like: SELECT c.f_name AS f_name, c.l_name AS l_name, c.gender AS gender, c.race AS race, c.dob AS dob, c.address AS address, c.city AS city, c.state AS state, c.zipcode AS zipcode, m.date_of_arrest AS date_of_arrest, ch.name AS charge_name, t.classification AS charge_type, t.classif...
2004 Feb 10
3
rsync 2.6.1cvs dumps core when preserve_hard_links and backup
...e backup.c. 266 if (!kept && preserve_hard_links && file->link_u.links 267 && hlink_list[file->F_HLINDEX] != file) { 268 if (verbose > 1) 269 rprintf(FINFO, "%s is a hard link\n", f_name(file)); 270 } file->link_u.links (and also file->F_HLINDEX) has some values, but no meanings because it's only an union with file->link_u.idev. It may be if (!kept && preserve_hard_links && file->u.link) { or some ? -- Yes, I'm in...
2004 Jan 25
2
scan for first existing hard-link file
...static int keep_backup(char *fname) } #endif if (!kept && preserve_hard_links && file->link_u.links - && file->F_HEAD != file) { + && hlink_list[file->F_INDEX] != file) { if (verbose > 1) rprintf(FINFO, "%s is a hard link\n", f_name(file)); } --- generator.c 22 Jan 2004 04:38:18 -0000 1.72 +++ generator.c 25 Jan 2004 09:56:10 -0000 @@ -43,6 +43,7 @@ extern int protocol_version; extern int always_checksum; extern char *compare_dest; extern int link_dest; +extern struct file_struct **hlink_list; /* choose whether to sk...
2006 Jan 06
4
Upload Progress Bar Problems
I''m writing an application where the user will be uploading many images and user feedback is essential. I''ve been trying to get the upload progress bar plug-in to work, but thus far have not had any success. I''ve downloaded Sean Treadway''s application code from his site http://sean.treadway.info/demo/upload/ and I followed the steps in his Upload
2004 Apr 10
0
patches for copying atimes
...3:28:35 -0000 @@ -140,16 +140,16 @@ #if SUPPORT_LINKS if (preserve_links && S_ISLNK(f->mode)) { - rprintf(FINFO, "%s %11.0f %s %s -> %s\n", + rprintf(FINFO, "%s %11.0f %s %s %s -> %s\n", perms, (double) f->length, timestring(f->modtime), - f_name(f), f->u.link); + timestring(f->atime), f_name(f), f->u.link); } else #endif - rprintf(FINFO, "%s %11.0f %s %s\n", + rprintf(FINFO, "%s %11.0f %s %s %s\n", perms, (double) f->length, timestring(f->modtime), - f_name(f)); + timestring(f->atime...
2004 Mar 10
4
HFS+ resource forks: WIP patch included
...nd EBCDIC systems!) complicate this assertion, but I haven't decided exactly what to do about it yet.) So then the only trick is to get send_file_entry to use the DESTINATION filename isntead of the local filename when sending the flist to the other side. This is done by replacing the call to f_name in send_file_entry with f_name_dst, which duplicates f_name except for the above change. It's ugly, but it works for now. NOTE: this is currently a ONE-WAY, SEND-ONLY operation. Files will have to be manually reassembled if restoration is required. It would be easy to add automatic reassembl...
2024 Mar 18
0
[PATCH] add option to skip files based on age/mtime
...nt flist_eof; extern int allowed_lull; @@ -1706,6 +1708,23 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, goto cleanup; } + if (max_age > 0 && time(NULL)-file->modtime > max_age) { + if (INFO_GTE(SKIP, 1)) { + if (solo_file) + fname = f_name(file, NULL); + rprintf(FINFO, "%s is over max-age\n", fname); + } + goto cleanup; + } + if (min_age > 0 && time(NULL)-file->modtime < min_age) { + if (INFO_GTE(SKIP, 1)) { + if (solo_file) + fname = f_name(file, NULL); + rprintf(FINFO, "%s is under min-ag...
2003 Sep 05
1
new option suggestion '--backup-only'
...:55.000000000 +0900 +++ rsync-backuponly/receiver.c 2003-09-05 15:06:37.000000000 +0900 @@ -39,6 +39,7 @@ extern char *backup_dir; extern char *backup_suffix; extern int backup_suffix_len; +extern int backup_only; static struct delete_list { DEV64_T dev; @@ -159,13 +160,14 @@ char *f = f_name(local_file_list->files[i]); if (make_backups && (backup_dir || !is_backup_file(f))) { (void) make_backup(f); - if (verbose) + if (verbose && !backup_only) rprintf(FINFO, "deleting %s\n", f); } else { int mode = local_file_list->fi...
2003 Mar 12
1
patch: typo's and gcc warnings
...file->mode = st.st_mode; } -------------- next part -------------- diff -ru orig/rsync-2.5.6/receiver.c rsync-2.5.6/receiver.c --- orig/rsync-2.5.6/receiver.c 2003-01-21 00:32:17.000000000 +0100 +++ rsync-2.5.6/receiver.c 2003-03-10 16:28:10.000000000 +0100 @@ -55,8 +55,8 @@ if (link_stat(f_name(flist->files[j]), &st)) return 1; for (i=0;i<dlist_len;i++) { - if (st.st_ino == delete_list[i].inode && - st.st_dev == delete_list[i].dev) + if (st.st_ino == (unsigned long)delete_list[i].inode && + st.st_dev == (unsigned long)delete_list[i].dev) retur...
2003 Jun 24
2
[PATCH] Limit recursion depth
...ry(file, f, base_flags); } - - if (S_ISDIR(file->mode) && recursive) { + if (S_ISDIR(file->mode) && recursive ) { struct exclude_struct **last_exclude_list = local_exclude_list; - - send_directory(f, flist, f_name(file)); - - local_exclude_list = last_exclude_list; + + if ( recurse_level>1 || !recurse_level) { + if (recurse_level) + recurse_level--; + + send_directory(f, flist, f_name(file)); +...
2004 Apr 20
1
improved atime patch
...1:06:18 -0000 @@ -140,16 +140,16 @@ #if SUPPORT_LINKS if (preserve_links && S_ISLNK(f->mode)) { - rprintf(FINFO, "%s %11.0f %s %s -> %s\n", + rprintf(FINFO, "%s %11.0f %s %s %s -> %s\n", perms, (double) f->length, timestring(f->modtime), - f_name(f), f->u.link); + timestring(f->atime), f_name(f), f->u.link); } else #endif - rprintf(FINFO, "%s %11.0f %s %s\n", + rprintf(FINFO, "%s %11.0f %s %s %s\n", perms, (double) f->length, timestring(f->modtime), - f_name(f)); + timestring(f->atime...
2003 Mar 22
2
[RFC] protocol version
I'm in the midst of coding a patch set for consideration that will bump the protocol version and have a couple of observations. The current minimum backwards-compatible protocol is 15 but we have code that checks for protocol versions as old as 12. If someone else doesn't beat me to it i'm considering cleaning out the pre-15 compatibility code. A backwards compatibility patch could
2010 Jan 22
12
DO NOT REPLY [Bug 7057] New: Buffer overflow when sending a file with long name
...Priority: P3 Component: core AssignedTo: wayned at samba.org ReportedBy: jzeleny at redhat.com QAContact: rsync-qa at samba.org There is a description of the issue in the bug report given in URL. What I found out is that most likely there is a bug in function f_name(). There is no string bounding checked when making a copy of a file path. That leads to buffer overflow in function send1extra() and possibly in other functions. Attaching a patch, which should be resolving this, but I'm not sure if I took the right approach. Please check it. -- Configure bu...
2003 Jun 07
1
patch to rsync to add options for pre- and post-transfer commands
...ror(errno)); + return(RERR_MALLOC); + } + + /* first arg is basename of command to be run */ + pargv[0] = basename(script); + + /* add file list */ + j = 1; + for (i = 0; i < flist->count; ++i) + { + /* get full path to file; need to make a copy + * because f_name uses a static buffer + */ + fname = f_name(flist->files[i]); + if (fname == NULL) continue; + + pargv[j] = strdup(fname); + if (pargv[j] == NULL) { + rprintf(FERROR,"ERROR: strdup of file name %s failed: %s\n", + fname, strerror(errno)); + r...